The Arms Race, in Words
- 1988--1996: stack overflows overwrite the return address and jump to injected shellcode (the classic "smashing the stack").
- Defense: NX / DEP marks the stack non-executable, so injected shellcode will not run.
- Response: ret2libc and ROP reuse code that is already executable, no injection needed.
- Defense: ASLR randomizes addresses, so attackers do not know where that code lives.
- Response: information leaks disclose real addresses at runtime, defeating randomization.
- Defenses layer up: stack canaries, PIE, RELRO, CFI, and shadow stacks raise the cost of each step.
Key Takeaway
No single mitigation is a silver bullet. Modern defense is defense in depth, and modern exploits chain multiple techniques.