CyberGlossary

Vulnerabilities

Integer Overflow

Also known as: Integer wraparound

Definition

A bug where an arithmetic operation produces a value outside the representable range of its integer type, wrapping or truncating in security-critical ways.

Integer overflows occur when computations exceed the maximum (or minimum) value an integer type can hold, causing wraparound, sign flips, or truncation. They become security issues when the wrong value is later used as a buffer size, loop counter, array index, or authorization check — frequently producing buffer overflows, infinite loops, or bypassed limits. Defences include checked arithmetic (Rust checked_add, C23 ckd_*, compiler -ftrapv), wide-then-narrow patterns with explicit range checks, type choices that match the data, and aggressive fuzzing. Many high-impact CVEs in image codecs, font parsers and kernels stem from integer overflow chains.

Examples

  • CVE-2002-0639 (OpenSSH challenge-response) — integer overflow leading to heap corruption.
  • CVE-2018-9568 (Android WiFi) — integer overflow in 802.11 frame handling.

Related terms