CWE-124: Buffer Underwrite
45 CVEs have CWE-124 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 18.331%.
The product writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.
Child of CWE-786: Access of Memory Location Before Start of Buffer
Mitigations
- 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.
Observed examples
- CVE-2021-24018: buffer underwrite in firmware verification routine allows code execution via a crafted firmware image
- CVE-2002-2227: Unchecked length of SSLv2 challenge value leads to buffer underflow.
- CVE-2007-4580: Buffer underflow from a small size value with a large buffer (length parameter inconsistency, CWE-130)
- CVE-2007-1584: Buffer underflow from an all-whitespace string, which causes a counter to be decremented before the buffer while looking for a non-whitespace character.
- CVE-2007-0886: Buffer underflow resultant from encoded data that triggers an integer overflow.
- CVE-2006-6171: Product sets an incorrect buffer size limit, leading to off-by-two buffer underflow.
- CVE-2006-4024: Negative value is used in a memcpy() operation, leading to buffer underflow.
- CVE-2004-2620: Buffer underflow due to mishandled special characters
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-124'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-124'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).