CWE-805: Buffer Access with Incorrect Length Value

low-risk

The product uses a sequential operation to read or write a buffer, but it uses an incorrect length value that causes it to access memory that is outside of the bounds of the buffer.

Abstraction: Base

Common Consequences

Integrity Read Memory
Availability Modify Memory

Detection Methods

Automated Static Analysis

This weakness can often be detected using automated static analysis tools. Many modern tools use data flow analysis or constraint-based techniques to minimize the number of false positives. Automated static analysis generally does not account for environmental considerations when reporting out-of-bounds memory operations. This can make it difficult for users to determine which warnings should be investigated first. For example, an analysis tool might report buffer overflows that originate from command line arguments in a program that is not expected to run with setuid or other special privileges.

Automated Dynamic Analysis

This weakness can be detected using dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.

Manual Analysis

Manual analysis can be useful for finding this weakness, but it might not achieve desired code coverage within limited time constraints. This becomes difficult for weaknesses that must be considered for all inputs, since the attack surface can be too large.

Automated Dynamic Analysis

Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ [REF-1518].

Real-World Examples (10)

CVE CVSS EPSS KEV
CVE-2023-20049 8.6 1.1%
CVE-2025-23319 8.1 0.9%
CVE-2023-5396 7.4 0.9%
CVE-2025-20169 7.7 0.5%
CVE-2025-20170 7.7 0.5%
CVE-2025-20175 7.7 0.5%
CVE-2025-20174 7.7 0.5%
CVE-2024-24851 7.5 0.5%
CVE-2025-30651 7.5 0.4%
CVE-2020-16101 7.5 0.4%
0
/ 100
low-risk
Active Threat 0/50 · Minimal
Exploit Availability 0/50 · Minimal