Skip to content
uencoder

Stack Overflow

A stack overflow is overlong writes to a stack buffer overwriting the stack frame (return address, saved registers); it can hijack control flow.

Purpose

To analyze the exploitation of stack buffer overflows and their defenses; the classic memory-safety vulnerability.

Mechanism

Overlong writes to a local stack buffer overwrite the saved return address; on return, execution jumps to an attacker-chosen address (shellcode/ROP). Defenses: stack canaries, NX/DEP, ASLR, memory-safe languages.

Use cases

  • Exploit development
  • Stack protection mechanisms
  • Reverse engineering

Related tools

References