CWE-375
Weakness AllowedReturning a Mutable Object to an Untrusted Caller
Abstraction: Base · Status: Draft
The code sends non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function.
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
Content history
updated Time_of_Introduction
updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings
updated Name, Taxonomy_Mappings
updated Common_Consequences, Relationships, Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated Demonstrative_Examples
updated Description, Other_Notes, Potential_Mitigations
updated Relationships, Taxonomy_Mappings
updated Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated References
updated Relationships
updated Relationships
updated Mapping_Notes
updated Applicable_Platforms, Weakness_Ordinalities
updated Common_Consequences, Description
0 vulnerabilities reference this CWE, most recent first.
No vulnerabilities reference this CWE.
Mitigation
Declare returned data which should not be altered as constant or immutable.
Mitigation
Clone all mutable data before returning references to it. This is the preferred mitigation. This way, regardless of what changes are made to the data, a valid copy is retained for use by the class.
No CAPEC attack patterns related to this CWE.