CWE-122: Heap-based Buffer Overflow
7 real-world CVEs classified as CWE-122: Heap-based Buffer Overflow. Each one is a short hands-on exercise in Hexret: find the vulnerable line, follow the exploit and learn the fix.
- CVE-2026-42533critical 9.22026
NGINX map regex two-pass capture clobbering
A regex-backed map can replace shared capture state during two-pass script evaluation, making the value pass outgrow its allocation or return an uninitialized heap tail.
- CVE-2026-42945high 8.12026
NGINX Rift: rewrite capture sizing heap overflow
The rewrite engine can size a captured replacement with cleared argument-escaping state, then copy it with escaping enabled and overrun the allocation.
- CVE-2024-38077critical 9.82024
MadLicense: base-24 license-key heap overflow
The licensing RPC decoder allocates 21 bytes for an expected 35-character base-24 value but converts a null-terminated, attacker-controlled string of unbounded length into that buffer.
- CVE-2024-30051high 7.82024
Windows DWM: 0x90 rounding undersizes a shared command buffer
A local caller can provide an unaligned DirectComposition command-buffer length that DWM rounds down for allocation but preserves for copying, causing a heap overwrite in the high-integrity desktop compositor process.
- CVE-2023-27997critical 9.82023
XORtigate: FortiOS SSL-VPN hex-length heap overflow
The SSL-VPN parser validates a raw-byte length against the hexadecimal character count, allowing its XOR decryption loop and terminator write to continue beyond the decoded heap buffer.
- CVE-2019-3568critical 9.82019
WhatsApp SRTCP pre-answer heap overflow
The native SRTCP call handler trusted oversized and internally inconsistent packet lengths before the recipient answered, allowing crafted VoIP packet series to overflow a heap buffer.
- CVE-2017-9417critical 9.82017
Broadpwn: Broadcom WMM information-element heap overflow
Broadcom Wi-Fi firmware allocates 0x2c bytes for a saved WMM information element but copies the attacker's full one-byte IE length, allowing an association response to overwrite as many as 211 adjacent heap bytes.