T57 Dec 24, 2025 2 min read

Buffer overflow

A memory safety bug where writes exceed a buffer’s bounds and overwrite adjacent memory, causing corruption, crashes, or exploits.

Definition

A buffer overflow happens when code writes past the end of a fixed-size buffer.

Instead of stopping at the buffer boundary, the write overwrites adjacent memory.

Why it matters

Buffer overflows can cause:

  • data corruption
  • crashes
  • security vulnerabilities if the overflow can change control flow or data used for security decisions

Relationship to “executing data as code”

One classic exploitation path is: overflow overwrites a return address or function pointer, and execution jumps into attacker-controlled bytes.

That is one way executing data as code can happen.