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-935365.32026-10-28CVE-2026-935237.82026-10-28CVE-2026-1186116.82026-10-28CVE-2026-935227.82026-10-28CVE-2026-935217.82026-10-28CVE-2026-472352026-10-28CVE-2026-1167762026-10-28CVE-2026-935207.82026-10-28CVE-2026-935197.82026-10-28CVE-2026-935187.82026-10-28CVE-2026-935172026-10-28CVE-2026-863924.92026-10-28CVE-2026-1083077.82026-10-27CVE-2026-571982026-10-27CVE-2026-571972026-10-27CVE-2026-1090907.52026-10-27CVE-2026-1090897.52026-10-27CVE-2026-1127102026-10-27CVE-2026-1127092026-10-27CVE-2026-865769.42026-10-27