A buffer overflow attack is a type of cyberattack that targets vulnerabilities in how a program handles memory. Specifically, it exploits situations where a program writes more data to a fixed-size memory buffer than it can hold, causing the excess data to “overflow” into adjacent memory locations.

Programs use buffers—fixed-size blocks of memory—to temporarily store data. If a program does not properly check the amount of data being written, an attacker can deliberately supply more data than the buffer can accommodate. The extra data spills over into neighboring memory, potentially overwriting critical program information such as function return addresses, pointers, or executable code.

Attackers use buffer overflow vulnerabilities to: (1) Crash the program, causing a denial of service (DoS). (2) Inject and execute malicious code with the same permissions as the vulnerable program, potentially taking control of the system. (3) Alter the program’s execution flow, bypassing security controls or exposing sensitive data.