logo

CWE-190 - Integer Overflow or Wraparound

CWE-190 Medium

  • Abstraction:
  • Base
  • Structure:
  • Simple
  • Status:
  • Stable
Weakness Name

Integer Overflow or Wraparound

Description

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.

Common Consequences

Scope: Availability

Impact: DoS: Crash, Exit, or Restart, DoS: Resource Consumption (Memory), DoS: Instability

Notes: 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.

Scope: Integrity

Impact: Modify Memory

Notes: 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.

Scope: Confidentiality, Availability, Access Control

Impact: Execute Unauthorized Code or Commands, Bypass Protection Mechanism

Notes: 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.

Scope: Availability, Other

Impact: Alter Execution Logic, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU)

Notes: 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.

Scope: Access Control

Impact: Bypass Protection Mechanism

Notes: 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.

Related Weaknesses
Related Alerts
  • Release Date:
  • 2006-07-19
  • Latest Modification Date:
  • 2024-07-16

Free security scan for your website