CWE•Variant•Stable•20 recent CVEs
CWE-416Use After Free
Description
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Common consequences
- Integrity→Modify MemoryThe use of previously freed memory may corrupt valid data, if the memory area in question has been allocated and used properly elsewhere.
- Availability→DoS: Crash, Exit, or RestartIf chunk consolidation occurs after the use of previously freed data, the process may crash when invalid data is used as chunk information.
- Confidentiality→Read MemoryRead operations on freed memory can sometimes leak sensitive information instead of causing a crash
- Integrity,Confidentiality,Availability→Execute Unauthorized Code or CommandsIf malicious data is entered before chunk consolidation can take place, it may be possible to take advantage of a write-what-where primitive to execute arbitrary code. If the newly allocated data happens to hold a class, in C++ for example,
Potential mitigations
- Architecture and DesignChoose a language that provides automatic memory management.
- ImplementationWhen freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.
Related CWEs
CWE-825Expired Pointer DereferenceCWE-672Operation on a Resource after Expiration or ReleaseCWE-672Operation on a Resource after Expiration or ReleaseCWE-672Operation on a Resource after Expiration or ReleaseCWE-120Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')CWE-123Write-what-where Condition
Recent CVEs classified under this CWE
CVE-2026-117008.32026-06-09CVE-2026-116998.82026-06-09CVE-2026-116988.82026-06-09CVE-2026-116947.52026-06-09CVE-2026-116928.32026-06-09CVE-2026-116878.82026-06-09CVE-2026-116838.82026-06-09CVE-2026-116812026-06-09CVE-2026-116808.82026-06-09CVE-2026-116798.32026-06-09CVE-2026-116748.82026-06-09CVE-2026-116738.82026-06-09CVE-2026-116719.62026-06-09CVE-2026-116708.82026-06-09CVE-2026-116642026-06-09CVE-2026-116638.32026-06-09CVE-2026-116612026-06-09CVE-2026-116578.82026-06-09CVE-2026-116568.32026-06-09CVE-2026-116542026-06-09