Skip to content

CWE-124: Buffer Underwrite ('Buffer Underflow')

BaseLikelihood of exploit: Medium

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

Consequences

  • Integrity, Availability: Modify Memory, DoS: Crash, Exit, or Restart
  • Integrity, Confidentiality, Availability, Access Control, Other: Execute Unauthorized Code or Commands, Modify Memory, Bypass Protection Mechanism, Other
  • Access Control, Other: Bypass Protection Mechanism, Other

How to prevent it

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

Recent advisories

All advisories for CWE-124

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor