CWE-122: Heap-based Buffer Overflow
3789 CVEs have CWE-122 as their primary weakness. 16 of them are in the CISA KEV catalog. The highest EPSS score among them is 94.010%.
The product writes past the end of a buffer that was allocated on the heap.
Child of CWE-788: Access of Memory Location After End of Buffer
Mitigations
- Pre-design: Use a language or compiler that performs automatic bounds checking.
- Architecture and Design: Use an abstraction library to abstract away risky APIs. Not a complete solution.
- Operation Build and Compilation: Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.
- Operation Build and Compilation: Run or compile the software using features or extensions that randomly arrange the positions of a program's executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code. Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as rebasing (for Windows) and prelinking (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking. For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].
- Implementation: Implement and perform bounds checking on input.
- Implementation: Do not use dangerous functions such as gets. Look for their safe equivalent, which checks for the boundary.
- Operation: Use OS-level preventative functionality. This is not a complete solution, but it provides some defense in depth.
Observed examples
- CVE-2025-46687: Chain: Javascript engine code does not perform a length check (CWE-1284) leading to integer overflow (CWE-190) causing allocation of smaller buffer than expected (CWE-131) resulting in a heap-based buffer overflow (CWE-122)
- CVE-2021-43537: Chain: in a web browser, an unsigned 64-bit integer is forcibly cast to a 32-bit integer (CWE-681) and potentially leading to an integer overflow (CWE-190). If an integer overflow occurs, this can cause heap memory corruption (CWE-122)
- CVE-2007-4268: Chain: integer signedness error (CWE-195) passes signed comparison, leading to heap overflow (CWE-122)
- CVE-2009-2523: Chain: product does not handle when an input string is not NULL terminated (CWE-170), leading to buffer over-read (CWE-125) or heap-based buffer overflow (CWE-122).
- CVE-2021-29529: Chain: machine-learning product can have a heap-based buffer overflow (CWE-122) when some integer-oriented bounds are calculated by using ceiling() and floor() on floating point values (CWE-1339)
- CVE-2010-1866: Chain: integer overflow (CWE-190) causes a negative signed value, which later bypasses a maximum-only check (CWE-839), leading to heap-based buffer overflow (CWE-122).
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2023-27997 | 2023-06-13 | CRITICAL | 9.2 | 86.750% | A heap-based buffer overflow vulnerability [CWE-122] in FortiOS version 7.2.4 and below, version 7.0.11 and below, version 6.4.12 and below, version 6.0.16 and… |
| CVE-2021-21017 | 2021-02-11 | HIGH | 8.8 | 86.274% | Acrobat Reader DC versions versions 2020.013.20074 (and earlier), 2020.001.30018 (and earlier) and 2017.011.30188 (and earlier) are affected by a heap-based… |
| CVE-2023-4911 | 2023-10-03 | HIGH | 7.8 | 63.769% | A buffer overflow was discovered in the GNU C Library's dynamic loader ld.so while processing the GLIBC_TUNABLES environment variable. This issue could allow a… |
| CVE-2024-38812 | 2024-09-17 | CRITICAL | 9.8 | 54.571% | The vCenter Server contains a heap-overflow vulnerability in the implementation of the DCERPC protocol. A malicious actor with network access to vCenter Server… |
| CVE-2023-28252 | 2023-04-11 | HIGH | 7.8 | 48.892% | Windows Common Log File System Driver Elevation of Privilege Vulnerability |
| CVE-2019-3568 | 2019-05-14 | CRITICAL | 9.8 | 30.076% | A buffer overflow vulnerability in WhatsApp VOIP stack allowed remote code execution via specially crafted series of RTCP packets sent to a target phone… |
| CVE-2026-94127 | 2026-09-22 | CRITICAL | 9.8 | 26.550% | When a BIG-IP APM access policy and an OAuth profile are configured on a virtual server, specific malicious traffic can lead to remote code execution (RCE).… |
| CVE-2024-49138 | 2024-12-10 | HIGH | 7.8 | 26.215% | Windows Common Log File System Driver Elevation of Privilege Vulnerability |
| CVE-2023-36036 | 2023-11-14 | HIGH | 7.8 | 15.315% | Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability |
| CVE-2023-23376 | 2023-02-14 | HIGH | 7.8 | 10.766% | Windows Common Log File System Driver Elevation of Privilege Vulnerability |
| CVE-2025-21333 | 2025-01-14 | HIGH | 7.8 | 10.066% | Windows Hyper-V NT Kernel Integration VSP Elevation of Privilege Vulnerability |
| CVE-2024-30051 | 2024-05-14 | HIGH | 7.8 | 6.168% | Windows DWM Core Library Elevation of Privilege Vulnerability |
| CVE-2025-25249 | 2026-01-13 | HIGH | 7.4 | 3.742% | A heap-based buffer overflow vulnerability in Fortinet FortiOS 7.6.0 through 7.6.3, FortiOS 7.4.0 through 7.4.8, FortiOS 7.2.0 through 7.2.11, FortiOS 7.0.0… |
| CVE-2025-24993 | 2025-03-11 | HIGH | 7.8 | 2.216% | Heap-based buffer overflow in Windows NTFS allows an unauthorized attacker to execute code locally. |
| CVE-2025-21418 | 2025-02-11 | HIGH | 7.8 | 2.132% | Windows Ancillary Function Driver for WinSock Elevation of Privilege Vulnerability |
| CVE-2026-85880 | 2026-09-08 | HIGH | 7.8 | 0.387% | Heap-based buffer overflow in Windows ALPC allows an authorized attacker to elevate privileges locally. |
| CVE-2026-126526 | 2026-11-16 | HIGH | 8.8 | 0.837% | Heap-based buffer overflow in Microsoft Office OneNote allows an unauthorized attacker to execute code over a network. |
| CVE-2026-130320 | 2026-11-16 | CRITICAL | 9.3 | 0.131% | In Open Object Rexx (ooRexx) before 5.2.0, RXAPI mishandles nameArg and userid bounds checking, possibly leading to arbitrary code execution via crafted… |
| CVE-2026-130634 | 2026-11-17 | MEDIUM | 5.5 | not scored | GPAC before 26.07.0 contains a heap-based buffer overflow in gf_mpd_resolve_url() in src/media_tools/mpd.c that allows attackers to write past a heap buffer… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-122'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-122'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).