CWE-124

Buffer Underwrite ('Buffer Underflow')
AI Translation Available

The product writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.

Status
incomplete
Abstraction
base
Likelihood
medium
C C++ Memory-Unsafe

Common Consequences

integrity availability confidentiality access control other
Impacts
modify memory dos: crash, exit, or restart execute unauthorized code or commands bypass protection mechanism other

Detection Methods

automated static analysis automated dynamic analysis

Potential Mitigations

Phases:
requirements implementation
Descriptions:
• All calculated values that are used as index or for pointer arithmetic should be validated to ensure that they are within an expected range.
• Choose a language that is not susceptible to these issues.

Functional Areas

memory management