VariantDraft

CWE-244Improper Clearing of Heap Memory Before Release ('Heap Inspection')

Category: memory

Description

Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory. When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a "heap inspection" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.

Common consequences· 1

  • Confidentiality / Other — Read Memory, Other
    Be careful using vfork() and fork() in security sensitive code. The process state will not be cleaned up and will contain traces of data from past use.

References

  1. https://cwe.mitre.org/data/definitions/244.html

(incoming)3

TypeTargetConfidenceTier
VulnerabilityCVE-2025-26304cve-2025-263040%live
VulnerabilityCVE-2025-26305cve-2025-263050%live
VulnerabilityCVE-2026-20039cve-2026-200390%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Free of Memory not on the Heap
CWE
Heap-based Buffer Overflow
CWE
Sensitive Information in Resource Not Removed Before Reuse
CWE
Free of Pointer not at Start of Buffer
CWE
Expired Pointer Dereference
CWE
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.