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-425367.52026-06-08CVE-2026-343567.52026-06-08CVE-2026-343557.52026-06-08CVE-2026-221647.52026-06-08CVE-2026-111436.52026-06-04CVE-2026-111248.82026-06-04CVE-2026-109958.82026-06-04CVE-2026-109936.52026-06-04CVE-2026-109898.82026-06-04CVE-2026-109498.32026-06-04CVE-2026-109467.52026-06-04CVE-2026-109298.32026-06-04CVE-2026-01007.82026-06-01CVE-2026-00598.02026-06-01CVE-2025-556645.52026-06-01CVE-2026-102315.32026-06-01CVE-2026-102305.32026-06-01CVE-2026-102295.32026-06-01CVE-2026-204528.02026-06-01CVE-2026-102005.32026-05-31