1. CVE archive
  2. Vulnerability types
  3. CWE-374
CWE-374 · #730 most frequent type in the archive

Passing Mutable Objects to an Untrusted Method

The product sends non-cloned mutable data as an argument to a method or function.

Part of: CWE-668 · Exposure of Resource to Wrong Sphere

1CVEs of this type in the archive
0critical (CVSS ≥ 9)
1high severity (7–8.9)
Apr 17, 2024latest published

What it is

The product sends non-cloned mutable data as an argument to a method or function.

Impact on systems

ScopeImpact
Integrity Modify Memory
The function or method that has been called can alter or delete the mutable data. This could violate assumptions that the calling function has made about its state. In situations where unknown code is called with references to mutable data, this external code could make changes to the data sent. If this data was not previously cloned, the modified data might not be valid in the context of execution.

How to prevent it

Implementation Pass in data which should not be altered as constant or immutable.
Implementation Clone all mutable data before passing it into an external function . 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.

Source: MITRE CWE catalog · Official entry on the MITRE website

All CWE-374 CVEs

1 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.