CWEweakness
CWE-1061 Insufficient Encapsulation
- Abstraction
- Class
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not sufficiently hide the
internal representation and implementation details of data or
methods.
Common consequences
• Access Control: Varies by Context, Bypass Protection Mechanism, Modify Application Data — An attacker might be able to use external
components or modules to modify data unexpectedly,
invoke unexpected functionality, introduce dependencies
that the programmer did not intend, or access data or
methods that were not intended to be accessible.
• Other: Reduce Maintainability, Increase Analytical Complexity — This issue makes it more difficult to maintain the product, which indirectly affects security by making it more difficult or time-consuming to find and/or fix vulnerabilities. It also might make it easier to introduce vulnerabilities.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2010-3860: variables declared public allow remote read of system properties such as user name and home directory.
Related
Observed example · CVE (1)
- CVE-2010-3860 IcedTea 1.7.x before 1.7.6, 1.8.x before 1.8.3, and 1.9.x before 1.9.2, as based on OpenJDK 6, declares multiple sensitive variables as… vulnerability
Child of · CWE (1)
- CWE-710 Improper Adherence to Coding Standards weakness
Referenced by CWE · child of (8)
- CWE-1054 Invocation of a Control Element at an Unnecessarily Deep Horizontal Layer weakness
- CWE-1057 Data Access Operations Outside of Expected Data Manager Component weakness
- CWE-1062 Parent Class with References to Child Class weakness
- CWE-1083 Data Access from Outside Expected Data Manager Component weakness
- CWE-1090 Method Containing Access of a Member Element from Another Class weakness
- CWE-1100 Insufficient Isolation of System-Dependent Functions weakness
- CWE-1105 Insufficient Encapsulation of Machine-Dependent Functionality weakness
- CWE-766 Critical Data Element Declared Public weakness