What it is
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
Impact on systems
| Scope | Impact |
|---|---|
| Availability | DoS: Crash, Exit, or Restart, DoS: Resource Consumption (Memory), DoS: Instability This weakness can generally lead to undefined behavior and therefore crashes. When the calculated result is used for resource allocation, this weakness can cause too many (or too few) resources to be allocated, possibly enabling crashes if the product requests more resources than can be provided. If the calculated result involves time values, then the product might crash when it encounters a time that is less than the previously-calculated time. |
| Integrity | Modify Memory If the value in question is important to data (as opposed to flow), simple data corruption has occurred. Also, if the overflow/wraparound 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 the product's implicit security policy. |
| Availability, Other | Alter Execution Logic, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU) If the overflow/wraparound occurs in a loop index variable, this could cause the loop to terminate at the wrong time - too early, too late, or not at all (i.e., infinite loops). With too many iterations, some loops could consume too many resources such as memory, file handles, etc., possibly leading to a crash or other DoS. |
| Access Control | Bypass Protection Mechanism If integer values are used in security-critical decisions, such as calculating quotas or allocation limits, integer overflows can be used to cause an incorrect security decision. |
| Access Control | Bypass Protection Mechanism, DoS: Crash, Exit, or Restart If integer values are used in time-based, security-critical decisions, such as calculating expiration times or determining whether an event occurs within a specific time or date range, to cause an incorrect security decision. The consequences could even include self-DoS if the overflow produces a time value that is not accounted for in protection mechanism logic. |
How to prevent it
Source: MITRE CWE catalog · Official entry on the MITRE website