grandekos.com we tend to secure projects
← Back to Blog

Buffer overflow today - still possible?

2026-11-24 03:08 · d1677a3b
Generalc/cpp
# Buffer Overflow on 64-bit C — Still Possible?

Short answer: Yes, but the classic stack-smash overflow is much harder. Memory corruption bugs in C are still the #1 vulnerability class in the wild.

---

How 64-bit Changed the Game



| Mitigation | What it does | Bypass difficulty |
|---|---|---|
| NX / DEP | Code pages can't be executed | Still need ROP/JOP gadgets |
| ASLR | Randomizes memory layout (stack, heap, libs) | 48-bit address space makes brute-forcing impossible; need info leak |
| Stack canaries | Magic value on stack, checked before ret | Bypassed with format-string or UAF |
| CFI (Compiler-Front-End) | Validates indirect branch targets | Newer, not universally enabled |
| PIE / RELRO | Relocatable binaries, full RELRO | Reduces ROP gadget availability |

On a modern 64-bit distro, all of these are ON by default. So a naive printf("%s", user_input) → jmp $rip exploit is essentially dead.

---

But Memory Corruption Is Still Everywhere



The classic "overflow a buffer and overwrite the return address" is rare now. What's actually exploited in production:

| Bug class | Why it still works | Real examples |
|---|---|---|
| Use-After-Free (UAF) | Dangling pointer → heap metadata corruption | Chrome's #1 CVE source, Linux kernel bugs |
| **Out-of-bounds write (not read) | Corrupts adjacent heap objects → type confusion | libjpeg-turbo, libwebp |
|
Integer overflow → buffer overflow | size_t wraps → malloc(0) or huge alloc | Historically common in parsers |
|
Format string | Leaks stack/heap addresses → defeats ASLR | Still found in C code |
|
Heap corruption / type confusion | Vtable pointer overwrite → arbitrary code exec | ffmpeg, curl |

> A 64-bit integer overflow is still a 64-bit integer overflow. The address space being bigger doesn't fix a size_t wrap.

---

Why 64-bit Specifically Makes It Harder (But Not Impossible)



``
32-bit: 0x00000000 – 0xFFFFFFFF (4 GB, 32-bit ASLR space)
64-bit: 0x0000000000000000 – 0xFFFFFFFFFFFF (16 EB, 48-bit ASLR)
`

-
ASLR entropy: 48-bit ASLR means ~2⁴⁸ possible placements. Brute-forcing is out. You must leak an address first (format string, UAF info leak, etc.).
-
Gadget hunting: With PIE + RELRO, the libc is at a random address and RELRO prevents overwriting GOT entries. You need a leak to find
libc → find gadgets.
-
But: Once you have one address leak, the rest is mechanical. 64-bit just adds one extra step (the leak), not a wall.

---

Real-World Proof (Last 5 Years)



-
Linux kernel: ~200+ memory-corruption CVEs per year (UAF, OOB write)
-
Chrome: ~1000 security bugs/year, many in C/C++ native code
-
FFmpeg / curl / OpenSSL: Regular OOB-write and UAF CVEs
-
2023–2025: Multiple 0-days in C++ (not C) exploit heap corruption in browsers

---

So — Can You Still Exploit a C Buffer Overflow on 64-bit?



| Scenario | Feasible? |
|---|---|
| Classic
overflow return address → jmp shellcode` | ❌ Dead (NX + ASLR + canaries) |
| Overflow → ROP chain | ⚠️ Only after an address leak |
| Overflow → heap corruption → type confusion → AAE | ✅ Still very much alive |
| Overflow in a binary compiled
without hardening | ✅ Still easy (many embedded/IoT C apps) |
| Overflow in a 32-bit legacy C app on a 64-bit OS | ✅ Still easy |

Bottom line:** 64-bit + modern mitigations killed the textbook exploit. But C's lack of bounds checking means memory corruption bugs are still born every day, and skilled attackers still find them. The exploit chain got longer (leak → leak → exploit), but it's not gone.

Comments

0 comments