Software Securityhome
Fix a findingSearch
Glossary

Buffer overflow

Writing past the end, or before the start, of a buffer, which corrupts adjacent memory (CWE-120; out-of-bounds writes are CWE-787, with CWE-121 and CWE-122 for stack and heap buffers). In C and C++ it can overwrite return addresses, function pointers or allocator metadata; bounds-checked APIs, sanitizers in testing and memory-safe languages prevent it.

Also called
buffer overrun · heap overflow · heap-based buffer overflow · stack-based buffer overflow · out-of-bounds write
Defined in
MITRE CWE-120

Covered in

Practice: Buffer over-read lab: Stop a heartbeat over-read

Find your next answer

Type to search. Search runs in your browser.

Searches run in your browser, but the host can infer them from the index files they load. The address shows your search so you can bookmark or share it.