Skip to content

Memory safety, from the defender's side

Understand the bug.Ship the mitigation.

A structured reference to memory-corruption vulnerabilities in C and C++: how stack and heap overflows, use-after-free and integer bugs happen, and how compilers, sanitizers, fuzzers and safer languages stop them.

areas
9
in-depth guides
28
glossary terms
23

Memory map

Seven areas, one bug lifecycle

Start with how memory is laid out, learn the classes of bugs that corrupt it, then the layers that prevent, detect, contain and triage them.

Defense in depth

No single control is enough

Every mitigation has gaps. Real resilience comes from stacking layers so a bug that slips past one is caught or contained by the next.

  1. Prevent

    Memory-safe languages, bounds-checked APIs, compiler warnings and code review stop bugs from being written.

    • Rust
    • std::span
    • -Wformat=2
    • ckd_add
  2. Detect

    ASan, UBSan and coverage-guided fuzzing surface the bugs that were written, before an attacker does.

    • ASan
    • UBSan
    • libFuzzer
    • AFL++
  3. Mitigate

    Canaries, NX, ASLR/PIE, RELRO, CFI and shadow stacks make the remaining bugs hard to exploit.

    • canary
    • NX
    • PIE
    • RELRO
    • CET
  4. Respond

    Crash triage, core dumps and deduplication turn field crashes into prioritised fixes.

    • gdb
    • coredumpctl
    • !analyze

Latest guides

Read the deep dives

All guides
0x8000 · ARM64 Exploitation

ARM64 Exploitation: the Link Register and ret2win

On AArch64 the return address lives in a register, not on the stack — until a non-leaf function saves it. Build the ARM ret2win in a lab and see where the saved link register sits.

0x8000 · ARM64 Exploitation

PAC and BTI: ARM's Answer to Code Reuse

Pointer authentication signs return addresses so a forged one faults; BTI forces indirect branches onto landing pads. How both work, how to enable and verify them, and their limits.

0x8000 · ARM64 Exploitation

ROP on ARM64: Gadgets and the Link Register

AArch64 gadgets end in ret, which branches to x30 — so the chain is threaded through the link register with ldp gadgets. Build a system("/bin/sh") chain, then watch PAC and BTI break it.

0x7000 · Exploitation Techniques

one-gadget: One Address to a Shell

Sometimes you control just one pointer. A one-gadget is a single libc address that calls execve("/bin/sh") — if its register and stack constraints hold. Find one, check the constraints, and use it.

0x7000 · Exploitation Techniques

ret2dlresolve: Resolving a Symbol Without a Leak

No libc leak, no problem: forge the relocation the dynamic linker reads and make it resolve and call system for you. A pwntools walkthrough — and why Full RELRO ends it.

0x7000 · Exploitation Techniques

Seccomp Sandboxes and the open-read-write Chain

A seccomp policy that bans execve takes the shell off the table, so attackers switch goals: open the flag, read it, write it back. Build the ORW chain, and see what a tighter policy stops.

Editorial line

Defensive by design

Understanding exploitation is what makes mitigations make sense. We teach the mechanics at the level a secure coder, reviewer or incident responder needs, and stop short of weaponisation.

What you will find

  • Vulnerable patterns next to their fixes
  • Compiler, linker and sanitizer flags you can ship
  • How to verify mitigations with checksec and readelf
  • How to read crash and sanitizer reports

What we never publish

  • Working exploit chains or shellcode
  • Step-by-step bypasses of mitigations
  • Payloads aimed at real software
  • Solutions to live CTF challenges