🚀 Join our AI Wargame at Black Hat Asia and our Workshop + Wargame at NDC Sydney .


Buffer Over-read

Occurs when a program reads more data from a buffer than the buffer actually contains, causing the program to access memory beyond the intended boundary. This results in reading adjacent memory locations that may contain unrelated or sensitive data.

Reading beyond the bounds of a buffer can expose confidential information stored in nearby memory, such as credentials, encryption keys, or memory addresses. In some cases, this unintended access can also trigger crashes or unstable program behavior if the read operation reaches invalid memory locations.

A buffer over-read condition typically occurs when indexes, pointers, or length values are used without validating that they remain within the valid limits of the buffer. This often happens when trusting externally supplied length values or failing to properly terminate strings.

Remediation:

  • Always validate buffer lengths before reading data.
  • Ensure indexes and pointer arithmetic remain within valid buffer bounds.
  • Do not trust externally supplied size or length values without verification.
  • Ensure strings are properly null-terminated before processing.
  • Use memory-safe libraries or language features that enforce bounds checking.

Metadata

  • Severity: high
  • Slug: buffer-over-read

CWEs

  • 126: Buffer Over-read

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more