CWE•Variant•Draft•20 recent CVEs
CWE-122Heap-based Buffer Overflow
Description
A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
Common consequences
- Availability→DoS: Crash, Exit, or Restart,DoS: Resource Consumption (CPU),DoS: Resource Consumption (Memory)Buffer overflows generally lead to crashes. Other attacks leading to lack of availability are possible, including putting the program into an infinite loop.
- Integrity,Confidentiality,Availability,Access Control→Execute Unauthorized Code or Commands,Bypass Protection Mechanism,Modify MemoryBuffer overflows often can be used to execute arbitrary code, which is usually outside the scope of a program's implicit security policy. Besides important user data, heap-based overflows can be used to overwrite function pointers that may
- Integrity,Confidentiality,Availability,Access Control,Other→Execute Unauthorized Code or Commands,Bypass Protection Mechanism,OtherWhen the consequence is arbitrary code execution, this can often be used to subvert any other security service.
Potential mitigations
- Pre-design: Use a language or compiler that performs automatic bounds checking.
- Architecture and DesignUse an abstraction library to abstract away risky APIs. Not a complete solution.
- Operation,Build and Compilation[object Object]
- Operation,Build and Compilation[object Object]
- ImplementationImplement and perform bounds checking on input.
- ImplementationDo not use dangerous functions such as gets. Look for their safe equivalent, which checks for the boundary.
- OperationUse OS-level preventative functionality. This is not a complete solution, but it provides some defense in depth.
Related CWEs
Recent CVEs classified under this CWE
CVE-2026-905775.32026-09-13CVE-2026-905567.82026-09-12CVE-2026-542417.42026-09-11CVE-2026-793937.52026-09-11CVE-2026-184956.12026-09-11CVE-2026-457613.32026-09-10CVE-2026-449509.02026-09-10CVE-2026-428078.02026-09-10CVE-2026-851039.82026-09-09CVE-2026-211046.72026-09-09CVE-2026-210969.82026-09-09CVE-2026-210959.82026-09-09CVE-2026-876549.62026-09-09CVE-2026-875798.82026-09-09CVE-2026-875279.62026-09-09CVE-2026-874308.82026-09-09CVE-2026-539388.22026-09-09CVE-2026-819935.52026-09-08CVE-2026-819927.82026-09-08CVE-2026-820067.82026-09-08