C/C++ vulnerabilities
43 real-world CVEs in C/C++ code. Each one is a short hands-on exercise in Hexret: find the vulnerable line, follow the exploit and learn the fix.
- CVE-2025-33073high 8.82025
Windows SMB marshalled-target reflection
An SMB target name can hide marshalled metadata that LSASS later strips, turning an attacker-routed hostname into a local target identity and reviving same-host authentication reflection when SMB signing is not enforced.
- 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-6387high 8.12024
OpenSSH regreSSHion: unsafe logging in a signal handler
A connection-timeout alarm handler calls a logging path that is not async-signal-safe, so firing it while the main thread is mid-allocation races and corrupts the heap.
- CVE-2024-2961high 8.82024
glibc iconv ISO-2022-CN-EXT out-of-bounds write
Converting to a multibyte charset, one escape-sequence path skips its output-bounds check, writing up to 3 fixed bytes past the buffer.
- CVE-2024-1086high 7.82024
Linux nf_tables double-free via unvalidated verdict (CVE-2024-1086)
A packet-verdict validator checks only the masked action bits, so a DROP verdict carrying a positive error field slips through; the drop path then frees the packet and returns that positive value as an accept, freeing it a second time.
- CVE-2023-4911high 7.82023
Looney Tunables: glibc ld.so GLIBC_TUNABLES buffer overflow
The loader's tunables parser copies each recognized name=value pair into a fixed-size buffer, but a malformed name=name=value string is parsed and appended twice, overflowing the buffer during setuid startup.
- CVE-2023-5217high 8.82023
libvpx VP8 encoder heap overflow on thread/height reconfigure
A per-row worker array sized from the current frame height is only reallocated when threads exceed one, so a reconfigure that drops to a single thread while growing the frame leaves it undersized and the encoder writes past it.
- CVE-2023-4863high 8.82023
libwebp lossless Huffman table heap overflow (BLASTPASS)
A variable-length code table is written into a buffer sized only for its first level, so crafted long codes make the builder append second-level tables past the allocation: an out-of-bounds heap write reached by decoding one image.
- CVE-2023-25690critical 9.82023
Apache HTTP Server rewrite-to-proxy request splitting
A broad rewrite capture could decode percent-encoded control characters and reinsert them into a proxied request target, turning one frontend request into multiple backend requests.
- CVE-2022-4304medium 5.92023
Marvin: OpenSSL RSA big-number timing reveals plaintext
OpenSSL private RSA processing normalized big numbers in time that depended on high zero words in the decrypted result, creating a network-observable oracle across PKCS#1 v1.5, OAEP, and RSASVE that adaptive ciphertexts could use to recover plaintext.
- CVE-2022-3602high 7.52022
SpookySSL: OpenSSL X.509 punycode four-byte overflow
The punycode decoder allowed insertion when its output buffer was already full, so a crafted X.509 SmtpUTF8Mailbox domain processed during name-constraint checks could shift one attacker-controlled unsigned integer past the stack buffer.
- CVE-2022-37434critical 9.82022
zlib inflate gzip-header extra-field over-read (CVE-2022-37434)
When a gzip extra field is larger than the caller's buffer and arrives across several inflate calls, the write offset outgrows the buffer and the copy's size clamp underflows, corrupting the heap.
- CVE-2022-0847high 7.82022
Dirty Pipe: uninitialized pipe-buffer flag overwrites read-only pages
A newly populated pipe buffer never resets its flags field, so a stale merge flag lets a later write land directly in a read-only file's page cache.
- CVE-2021-4034high 7.82022
polkit pkexec empty-argv environment corruption (PwnKit, CVE-2021-4034)
Run with an empty argument vector, the setuid-root pkexec reads and then writes argv[1], which aliases the environment, reintroducing a stripped variable (GCONV_PATH) to gain local root. Nicknamed PwnKit (a pun on polkit), it sat unnoticed for over twelve years and affects nearly every Linux distribution.
- CVE-2021-42013critical 9.82021
Apache path traversal (incomplete fix of CVE-2021-41773)
The 2.4.50 fix for the 2.4.49 traversal only decoded one layer, so a double-encoded dot-segment slips past it and re-traverses.
- CVE-2021-41773critical 9.82021
Apache HTTP Server mixed-encoding path traversal
Apache 2.4.49 decoded and normalized a path in one pass, allowing a literal dot plus an encoded dot to evade parent-directory removal.
- CVE-2021-38647critical 9.82021
OMIGOD: OMI unauthenticated RCE via missing auth check
An HTTP request that omits the Authorization header is dispatched without ever confirming it was authenticated, so an unauthenticated attacker runs commands as root on the OMI management agent.
- CVE-2021-30860high 7.82021
FORCEDENTRY: JBIG2 integer overflow in Apple CoreGraphics
A crafted JBIG2 stream makes a 32-bit symbol count wrap to a small value, so an undersized heap buffer is overrun with the full run of attacker-referenced bitmap pointers.
- CVE-2021-34527high 8.82021
Windows Print Spooler RpcAddPrinterDriverEx privilege escalation to RCE (PrintNightmare)
PrintNightmare (CVE-2021-34527): an authenticated low-privileged user calls RpcAddPrinterDriverEx and points a driver file at an attacker SMB share, so the SYSTEM Print Spooler loads the attacker DLL. The famous incomplete-fix saga, CVE-2021-1675 was patched first as a low-severity local escalation, but the fix was bypassable, so this RCE followed and still needed Point and Print mitigations. The PoC was published accidentally (released believing 1675 was fully patched, before 34527 was understood as a separate unpatched RCE), forcing an emergency response. The spooler runs as SYSTEM and is enabled by default, including on domain controllers.
- CVE-2021-3156high 7.82021
Sudo 'Baron Samedit' heap overflow (CVE-2021-3156)
A shell-mode argument-unescaping loop skips its string-terminator check, so an argument ending in a lone backslash makes sudo read past the end of the string and copy adjacent heap into a fixed buffer, a heap overflow that yields local root.
- CVE-2020-15999critical 9.62020
FreeType Load_SBit_Png 16-bit dimension truncation heap overflow
An embedded-PNG loader narrows a 32-bit image width and height to 16 bits to size its bitmap buffer, but the untruncated 32-bit dimensions still drive the decode write, so a PNG larger than 0xFFFF overflows the heap.
- CVE-2020-1968low 3.72020
Raccoon: reused TLS DH secrets turn timing into plaintext recovery
OpenSSL 1.0.2 could reuse a finite-field DH private value while TLS processing exposed whether the resulting shared secret began with zero bytes, allowing adaptive timing probes to target one long-lived exponent and recover connection secrets.
- CVE-2020-1472critical 10.02020
Netlogon Zerologon authentication bypass (CVE-2020-1472)
MS-NRPC computes its session credential with AES-CFB8 using an all-zero IV, so an all-zero challenge has a 1-in-256 chance of validating. An unauthenticated attacker on the network retries until the domain controller accepts, then empties its machine-account password. Named Zerologon by Secura's Tom Tervoort, it scored a perfect CVSS 10.0 and takes a DC to Domain Admin in seconds, one of the most severe Active Directory flaws ever disclosed.
- CVE-2020-1206high 7.52020
SMBleed: SMBv3 decompression exposes uninitialized kernel memory
The SMB compression wrapper reports the destination capacity as though every byte was produced, so a declared output larger than the real decompressed data leaves kernel-pool bytes inside a message that can be returned to the client.
- CVE-2020-1048high 7.82020
PrintDemon: Print Spooler privileged file write
The spooler accepts an arbitrary file path as a port through a server-side API that omitted validation, then processes a persisted job after restart without the submitting user's impersonation token.
- CVE-2020-0796critical 10.02020
SMBGhost: Windows SMBv3 compression integer overflow
An unchecked 32-bit addition in the SMB 3.1.1 compression path can allocate a wrapped-small buffer before decompression writes the attacker-declared output into it.
- CVE-2019-2215high 7.82019
Bad Binder: freed binder thread still on an epoll waitlist
A device thread hands its wait queue to epoll, then a thread-exit path frees the thread without removing that registration, so epoll cleanup later dereferences freed kernel memory.
- CVE-2019-14271critical 9.82019
Docker cp container escape via untrusted libnss load (CVE-2019-14271)
The docker cp helper chroots into the container, then a routine archive walk resolves file owners and glibc's NSS facility lazily loads libnss modules from inside that container filesystem, so a trojaned libnss runs as root on the host.
- CVE-2019-0708critical 9.82019
BlueKeep: Windows RDP MS_T120 pre-auth use-after-free (CVE-2019-0708)
RDP binds the internal channel MS_T120 to a fixed slot, but a client can bind that same name to a second slot too. On teardown the channel object is freed once while the duplicate binding still points at it, so a later channel operation dereferences a dangling pointer: a pre-authentication, wormable use-after-free. So dangerous that Microsoft shipped out-of-band patches even for out-of-support Windows XP and Server 2003, and the NSA issued a rare public advisory urging patching for fear of a WannaCry-scale worm.
- CVE-2017-9798high 7.52017
Optionsbleed: a request-pool method enters a global table
An unrecognized method in a per-directory Limit directive was registered globally using memory owned by temporary `.htaccess` processing. After that pool was freed, an OPTIONS response walked stale method-name pointers and could reflect process memory in its Allow header.
- CVE-2017-0144high 8.12017
Windows SMBv1 FEA-list integer truncation pool overflow (EternalBlue, CVE-2017-0144)
In SMBv1's OS/2 FEA-list conversion, a 32-bit list size is tracked in a 16-bit field, so a size just over 0xFFFF truncates and the non-paged-pool buffer is allocated too small for the data copied into it. EternalBlue, an Equation Group tool leaked by The Shadow Brokers, weaponized this and powered WannaCry and NotPetya, the most consequential SMB exploit in history.
- CVE-2016-2183high 7.52016
Sweet32: 64-bit block collisions reveal long-session plaintext
A long-lived session using 3DES or another 64-bit block cipher reaches the birthday bound after about 2^32 blocks, making ciphertext collisions useful for relating repeated known text to nearby secrets.
- CVE-2016-0800medium 5.92016
DROWN: SSLv2 decrypts modern TLS through shared RSA keys
An SSLv2 service using the same RSA private key as a modern TLS endpoint exposes response differences that can be queried as a Bleichenbacher oracle against captured TLS RSA ciphertexts.
- CVE-2015-1538critical 10.02015
Stagefright: libstagefright sample-table entry-count integer overflow
A media sample-table atom carries a 32-bit entry count; a nearby size check and the array allocation both multiply that count by the entry size, so a huge count wraps 32-bit arithmetic and a tiny buffer is allocated, then filled far past its end.
- CVE-2015-3456high 7.72015
VENOM: QEMU floppy controller FIFO index escapes its buffer
One byte-at-a-time write into a fixed 512-byte device FIFO advances its index with no bound, so a guest that keeps feeding the I/O port writes attacker-controlled bytes past the buffer into host process memory.
- CVE-2015-0204medium 4.32015
FREAK: OpenSSL accepts an export RSA key in a stronger suite
An OpenSSL client accepted a signed temporary export-grade RSA key even when its view of the negotiated cipher suite did not permit one, allowing an active attacker to substitute a factorable 512-bit key.
- CVE-2014-3566medium 4.32014
POODLE: SSL 3.0 CBC padding oracle
When a block-cipher record layer strips CBC padding using only the final byte and never authenticates the padding content, accept-versus-reject leaks one plaintext byte per aligned request.
- CVE-2014-0224high 7.42014
CCS Injection: an early TLS state change fixes weak keys
OpenSSL accepted ChangeCipherSpec after cipher selection but before the master secret existed, so injected CCS messages could install keys derived from an empty master secret and let a man-in-the-middle decrypt or alter traffic.
- CVE-2014-0160high 7.52014
OpenSSL heartbeat over-read (Heartbleed, CVE-2014-0160)
A TLS heartbeat handler copies a peer-supplied payload length without checking it against the bytes actually received, reading up to roughly 64KB of process memory per request and echoing it back. Nicknamed Heartbleed because the heartbeat extension was made to bleed memory, it leaked session data, credentials, and even private keys, and is widely credited with popularizing branded vulnerabilities (its own name, logo, and website).
- CVE-2014-1266high 7.42014
Apple goto fail: skipped TLS signature check
A duplicated goto jumps past the signature verification in a TLS key-exchange handler, so the function returns success without ever checking the signature, letting a man-in-the-middle spoof any server.
- CVE-2013-0169low 2.62013
Lucky Thirteen: TLS CBC MAC timing reveals plaintext
CBC record processing performed a padding-dependent amount of MAC work, so crafted records with unified error messages still produced timing distributions that revealed padding validity and ultimately plaintext.
- CVE-2008-4250critical 10.02008
Windows Server service path-canonicalization stack overflow (MS08-067)
A crafted RPC path with more "..\" segments than real ones drives the canonicalizer's backward scan before the start of its stack buffer, corrupting the saved return address. Fun fact: shipped as MS08-067, it became the classic Metasploit ms08_067_netapi demo and the engine of the Conficker worm, which infected millions of machines in 2008 to 2009, one of the most-exploited Windows RCEs ever.
- CVE-2008-0166high 7.82008
Debian OpenSSL predictable PRNG
A Debian patch commented out the one line that mixed fresh entropy into the OpenSSL PRNG pool, so generated keys depended only on the process ID: about 32,767 possible keys per type and size.