CyberGlossary

Vulnerabilities

Buffer Overflow

Also known as: Buffer overrun

Definition

A memory-safety flaw where a program writes past the end of an allocated buffer, corrupting adjacent memory and often enabling code execution.

Buffer overflows occur when input lengths are not properly bounded against the size of the destination buffer in languages like C and C++. The extra bytes overwrite neighbouring stack frames, heap chunks, function pointers, or return addresses, allowing attackers to hijack control flow or leak data. Classic stack overflows underpin many historical exploits, while heap overflows remain very common today. Modern mitigations include stack canaries, ASLR, DEP/NX, Control-Flow Integrity, safer libc functions, fuzz testing and — increasingly — porting to memory-safe languages like Rust. Buffer overflows are tracked under CWE-119 and related entries and remain in OWASP and SANS Top lists.

Examples

  • CVE-2014-0160 (Heartbleed) — a memory read overflow in OpenSSL.
  • Morris Worm (1988) exploited a stack buffer overflow in fingerd.

Related terms