315
Alternate Terms
Stack Overflow : "Stack Overflow" is often used to mean the same thing as stack-based buffer
overflow, however it is also used on occasion to mean stack exhaustion, usually a result from
an excessively recursive function call. Due to the ambiguity of the term, use of stack overflow to
describe either circumstance is discouraged.
Likelihood Of Exploit
High
Common Consequences
Scope Impact Likelihood
Availability Modify Memory
DoS: Crash, Exit, or Restart
DoS: Resource Consumption (CPU)
DoS: Resource Consumption (Memory)
Buffer overflows generally lead to crashes. Other attacks
leading to lack of availability are possible, including putting
the program into an infinite loop.
Integrity
Confidentiality
Availability
Access Control
Modify Memory
Execute Unauthorized Code or Commands
Bypass Protection Mechanism
Buffer overflows often can be used to execute arbitrary
code, which is usually outside the scope of a program's
implicit security policy.
Integrity
Confidentiality
Availability
Access Control
Other
Modify Memory
Execute Unauthorized Code or Commands
Bypass Protection Mechanism
Other
When the consequence is arbitrary code execution, this
can often be used to subvert any other security service.
Detection Methods
Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs
- either randomly or algorithmically - and dynamically invoking the code with those inputs.
Even with random inputs, it is often capable of generating unexpected results such as crashes,
memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases
that clearly indicate bugs, which helps developers to diagnose the issues.
Effectiveness = High
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST),
can find some instances of this weakness by analyzing source code (or binary/compiled code)
without having to execute it. Typically, this is done by building a model of data flow and control
flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input)
with "sinks" (destinations where the data interacts with external components, a lower layer such
as the OS, etc.)
Effectiveness = High
Potential Mitigations
Phase: Operation
Phase: Build and Compilation
CWE Version 4.14
CWE-121: Stack-based Buffer Overflow
CWE-121: Stack-based Buffer Overflow