Category: 7PK - Encapsulation

Draft
Summary

This category represents one of the phyla in the Seven Pernicious Kingdoms vulnerability classification. It includes weaknesses that occur when the product does not sufficiently encapsulate critical data or functionality. According to the authors of the Seven Pernicious Kingdoms, "Encapsulation is about drawing strong boundaries. In a web browser that might mean ensuring that your mobile code cannot be abused by other mobile code. On the server it might mean differentiation between validated data and unvalidated data, between one user's data and another's, or between data users are allowed to see and data that they are not."

Membership
IDNameDescription
CWE-486Comparison of Classes by NameThe product compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.
CWE-488Exposure of Data Element to Wrong SessionThe product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.
CWE-489Active Debug CodeThe product is released with debugging code still enabled or active.
CWE-491Public cloneable() Method Without Final ('Object Hijack')A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.
CWE-492Use of Inner Class Containing Sensitive DataInner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.
CWE-493Critical Public Variable Without Final ModifierThe product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.
CWE-495Private Data Structure Returned From A Public MethodThe product has a method that is declared public, but returns a reference to a private data structure, which could then be modified in unexpected ways.
CWE-496Public Data Assigned to Private Array-Typed FieldAssigning public data to a private array is equivalent to giving public access to the array.
CWE-497Exposure of Sensitive System Information to an Unauthorized Control SphereThe product does not properly prevent sensitive system-level information from being accessed by unauthorized actors who do not have the same level of access to the underlying system as the product does.
CWE-501Trust Boundary ViolationThe product mixes trusted and untrusted data in the same data structure or structured message.
CWE-700Seven Pernicious KingdomsThis view (graph) organizes weaknesses using a hierarchical structure that is similar to that used by Seven Pernicious Kingdoms.
Vulnerability Mapping Notes
Usage: Prohibited
Reasons: Category
Rationale:
This entry is a Category. Using categories for mapping has been discouraged since 2019. Categories are informal organizational groupings of weaknesses that can help CWE users with data aggregation, navigation, and browsing. However, they are not weaknesses in themselves.
Comment:
See member weaknesses of this category.