Write past the end of a stack-allocated buffer to overwrite the return address (RIP/EIP) and redirect execution to attacker-controlled code. The classic vulnerability — enabled by unsafe string functions like strcpy that perform no bounds checking.
Overflowing a heap-allocated buffer corrupts the malloc chunk metadata of adjacent allocations. By crafting fake size/prev_size fields, an attacker can manipulate the allocator during a subsequent free() into performing an arbitrary write to any memory address.
Free a heap object, then let the allocator give the same memory to a different allocation. If the original pointer is used again, it now reads or writes the new owner's data. When the freed object contained a function pointer, UAF achieves control-flow hijacking.
A race condition between a security check and the operation it guards. If an attacker can change the resource between the check and the use, the check becomes meaningless. Classic example: a setuid program calls access() then open() — with a symlink swap in between.
Two threads concurrently read-modify-write a shared variable without synchronisation. Because counter++ is not atomic (it compiles to READ + ADD + WRITE), threads can interleave and produce incorrect results — from lost updates to corrupted security state.
Test your understanding of stack overflows, heap corruption, use-after-free, TOCTOU races, and data races.