- What is CWE-131?
- The product does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.
- What CVEs are caused by CWE-131?
- 117 recorded CVEs are attributed to CWE-131, including CVE-2020-17087, CVE-2024-23622, CVE-2024-23621. 1 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-131?
- When allocating a buffer for the purpose of transforming, converting, or encoding an input, allocate enough memory to handle the largest possible encoding. For example, in a routine that converts "&" characters to "&" for HTML entity encoding, the output buffer needs to be at least 5 times as large as the input buffer.
- How is CWE-131 detected?
- 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.
- What are the consequences of CWE-131?
- Exploiting CWE-131 can lead to: DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands, Read Memory, Modify Memory.
- Is CWE-131 actively exploited?
- Yes. 1 CWE-131 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 117 recorded CVEs.