CWE-375: Returning a Mutable Object to an Untrusted Caller
Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function.
Last updated
Overview
In situations where functions return references to mutable data, it is possible that the external code which called the function may make changes to the data sent. If this data was not previously cloned, the class will then be using modified data which may violate assumptions about its internal state.
Common consequences
What can happen when CWE-375 is exploited.
Modify Memory
Affects: Access Control, Integrity
Potentially data could be tampered with by another function which should not have been tampered with.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages