Weakness (CWE)
CWE-495: Private Data Structure Returned From A Public Method
Variant Draft
The 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.
How to prevent it (3 mitigations)
-
Implementation
Declare the method private.
-
Implementation
Clone the member data and keep an unmodified version of the data private to the object.
-
Implementation
Use public setter methods that govern how a private member can be modified.
Source: MITRE CWE-495
0 results · Clear filters · Feed
Nothing found.