CWE-787: Out-of-bounds Write
low-riskThe product writes data past the end, or before the beginning, of the intended buffer.
Common Consequences
Detection Methods
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.
This weakness can be detected using dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
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-2021-35211 | 9.0 | 94.3% | Y |
| CVE-2021-35211 | 9.0 | 94.3% | Y |
| CVE-2021-20038 | 9.8 | 94.3% | Y |
| CVE-2018-8174 | 7.5 | 94.3% | Y |
| CVE-2018-8174 | 7.5 | 94.3% | Y |
| CVE-2025-0282 | 9.0 | 94.1% | Y |
| CVE-2018-0802 | 7.8 | 94.1% | Y |
| CVE-2018-0802 | 7.8 | 94.1% | Y |
| CVE-2018-0798 | 8.8 | 94.1% | Y |
| CVE-2018-0798 | 8.8 | 94.1% | Y |