CWE-193Off-by-one Error

PUBLISHEDweakness record
released 2006-07-19 · last modified 2025-12-11

Metadata

CWE ID:
CWE-193
摘要:
Base
结构:
Simple
状态:
Draft
发布日期:
2006-07-19
更新日期:
2025-12-11

名称

Off-by-one Error

描述

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

常见后果

范围:
Availability
影响:
DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Instability
注释:
This weakness will generally lead to undefined behavior and therefore crashes. In the case of overflows involving loop index variables, the likelihood of infinite loops is also high.
范围:
Integrity
影响:
Modify Memory
注释:
If the value in question is important to data (as opposed to flow), simple data corruption has occurred. Also, if the wrap around results in other conditions such as buffer overflows, further memory corruption may occur.
范围:
Confidentiality, Availability, Access Control
影响:
Execute Unauthorized Code or Commands, Bypass Protection Mechanism
注释:
This weakness can sometimes trigger buffer overflows which can be used to execute arbitrary code. This is usually outside the scope of a program's implicit security policy.

相关 CWE