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