buffer overflow
termprogrammingsecurityhacking
Writing more data into a buffer than it can hold, so the excess lands in adjacent memory that was never meant to receive it.
The mechanism is simple enough to state in one line: a fixed-size buffer, an unchecked copy, and whatever sat next to it in memory gets overwritten. Historically what sat next to a stack buffer was the saved return address, so a long enough input could redirect execution when the function returned, which is what made this the defining vulnerability class of the 1990s and the engine of the Morris worm and Code Red. Everything about modern process hardening is a response to it: stack canaries to detect the overwrite, NX/DEP so overwritten data cannot execute, ASLR so the attacker cannot predict addresses, and bounds-checked or memory-safe languages so the write never happens. It is CWE-787, still near the top of the CWE Top 25 thirty years on.
Also known as: buffer overrun, stack smashing, CWE-787