CWE-193
Off-by-one Error
Description
A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
Parent Weaknesses (ChildOf)
Related Weaknesses
Common Consequences
Scope
Impact
DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Instability
Scope
Impact
Modify Memory
Scope
Impact
Execute Unauthorized Code or Commands, Bypass Protection Mechanism
Potential Mitigations
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().
CVE-2003-0252Off-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-1391Off-by-one vulnerability in driver allows users to modify kernel memory.
CVE-2002-0083Off-by-one error allows local users or remote malicious servers to gain privileges.
CVE-2002-0653Off-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-0844Off-by-one buffer overflow in version control system allows local users to execute arbitrary code.
CVE-1999-1568Off-by-one error in FTP server allows a remote attacker to cause a denial of service (crash) via a long PORT command.
CVE-2004-0346Off-by-one buffer overflow in FTP server allows local users to gain privileges via a 1024 byte RETR command.
CVE-2004-0005Multiple buffer overflows in chat client allow remote attackers to cause a denial of service and possibly execute arbitrary code.
CVE-2003-0356Multiple off-by-one vulnerabilities in product allow remote attackers to cause a denial of service and possibly execute arbitrary code.
CVE-2001-1496Off-by-one buffer overflow in server allows remote attackers to cause a denial of service and possibly execute arbitrary code.
+8 more examples
Applicable Platforms
Security Training
Train your team to recognize and prevent security threats with our comprehensive security awareness program.
Start TrainingVulnerability Scanning
Discover vulnerabilities in your applications and infrastructure before attackers do.
Scan Now