CWE-193: Off-by-one Error
234 CVEs have CWE-193 as their primary weakness. 1 of them are in the CISA KEV catalog. The highest EPSS score among them is 99.962%.
A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
Child of CWE-682: Incorrect Calculation
Mitigations
- Implementation: When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().
Observed examples
- CVE-2003-0252: Off-by-one error allows remote attackers to cause a denial of service and possibly execute arbitrary code via requests that do not contain newlines.
- CVE-2001-1391: Off-by-one vulnerability in driver allows users to modify kernel memory.
- CVE-2002-0083: Off-by-one error allows local users or remote malicious servers to gain privileges.
- CVE-2002-0653: Off-by-one buffer overflow in function usd by server allows local users to execute arbitrary code as the server user via .htaccess files with long entries.
- CVE-2002-0844: Off-by-one buffer overflow in version control system allows local users to execute arbitrary code.
- CVE-1999-1568: Off-by-one error in FTP server allows a remote attacker to cause a denial of service (crash) via a long PORT command.
- CVE-2004-0346: Off-by-one buffer overflow in FTP server allows local users to gain privileges via a 1024 byte RETR command.
- CVE-2004-0005: Multiple buffer overflows in chat client allow remote attackers to cause a denial of service and possibly execute arbitrary code.
- CVE-2003-0356: Multiple off-by-one vulnerabilities in product allow remote attackers to cause a denial of service and possibly execute arbitrary code.
- CVE-2001-1496: Off-by-one buffer overflow in server allows remote attackers to cause a denial of service and possibly execute arbitrary code.
- CVE-2004-0342: This is an interesting example that might not be an off-by-one.
- CVE-2001-0609: An off-by-one enables a terminating null to be overwritten, which causes 2 strings to be merged and enable a format string.
- CVE-2002-1745: Off-by-one error allows source code disclosure of files with 4 letter extensions that match an accepted 3-letter extension.
- CVE-2002-1816: Off-by-one buffer overflow.
- CVE-2002-1721: Off-by-one error causes an snprintf call to overwrite a critical internal variable with a null value.
- CVE-2003-0466: Off-by-one error in function used in many products leads to a buffer overflow during pathname management, as demonstrated using multiple commands in an FTP server.
- CVE-2003-0625: Off-by-one error allows read of sensitive memory via a malformed request.
- CVE-2006-4574: Chain: security monitoring product has an off-by-one error that leads to unexpected length values, triggering an assertion.
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2021-3156 | 2021-01-26 | HIGH | 7.8 | 99.962% | Sudo before 1.9.5p2 contains an off-by-one error that can result in a heap-based buffer overflow, which allows privilege escalation to root via "sudoedit -s"… |
| CVE-2026-128846 | 2026-11-16 | LOW | 3.7 | 0.253% | @fastify/busboy is a streaming parser for multipart form data used by Fastify. In versions 3.2.1 through 3.2.5, the parser can interpret the same multipart… |
| CVE-2026-109151 | 2026-11-17 | HIGH | 7.0 | 0.169% | In the Matter and Aliro Door Lock Application of the Nordic Semiconductor nRF Door Lock and Access Control Add-on v1.0.0 through v1.1.1 with… |
| CVE-2026-130386 | 2026-11-17 | MEDIUM | 6.5 | not scored | Contiki-NG through 5.2 contains an out-of-bounds access vulnerability in buffer_reclaim() and domain_set_free() in mpl.c that iterate the seed_set array one… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-193'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-193'
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).