CAPEC Definitions / CAPEC-100
CAPEC-100: Overflow Buffers
Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an adversary. As a consequence, an adversary is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the adversaries' choice.
Extended Description
No Extended Description.
Mitigations
Use a language or compiler that performs automatic bounds checking.
Use secure functions not vulnerable to buffer overflow.
If you have to use dangerous functions, make sure that you do boundary checking.
Compiler-based canary mechanisms such as StackGuard, ProPolice and the Microsoft Visual Studio /GS flag. Unless this provides automatic bounds checking, it is not a complete solution.
Use OS-level preventative functionality. Not a complete solution.
Utilize static source code analysis tools to identify potential buffer overflow weaknesses in the software.
Relationships with other CAPECs
CAPEC-123: Buffer Manipulation
Prerequisites
Targeted software performs buffer operations.
Targeted software inadequately performs bounds-checking on buffer operations.
Adversary has the capability to influence the input to buffer operations.
Related Weaknesses
CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
CWE-131: Incorrect Calculation of Buffer Size
CWE-129: Improper Validation of Array Index
CWE-805: Buffer Access with Incorrect Length Value
CWE-680: Integer Overflow to Buffer Overflow
