CVE Vulnerabilities

CVE-2002-2439

Integer Overflow or Wraparound

Published: Oct 23, 2019 | Modified: Oct 31, 2019
CVSS 3.x
7.8
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
4.6 MEDIUM
AV:L/AC:L/Au:N/C:P/I:P/A:P
RedHat/V2
3.7 MODERATE
AV:L/AC:H/Au:N/C:P/I:P/A:P
RedHat/V3
Ubuntu
LOW

Integer overflow in the new[] operator in gcc before 4.8.0 allows attackers to have unspecified impacts.

Weakness

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 can introduce other weaknesses when the calculation is used for resource management or execution control.

Affected Software

Name Vendor Start Version End Version
Gcc Gnu * 4.8.0 (excluding)
Gcc-4.1 Ubuntu lucid *
Gcc-4.3 Ubuntu lucid *
Gcc-4.4 Ubuntu lucid *
Gcc-4.4 Ubuntu precise *
Gcc-4.4 Ubuntu trusty *
Gcc-4.4 Ubuntu utopic *
Gcc-4.4 Ubuntu vivid *
Gcc-4.4-armel-cross Ubuntu precise *
Gcc-4.4-armhf-cross Ubuntu precise *
Gcc-4.5 Ubuntu precise *
Gcc-4.5-armel-cross Ubuntu precise *
Gcc-4.5-armhf-cross Ubuntu precise *
Gcc-4.6 Ubuntu precise *
Gcc-4.6 Ubuntu precise/esm *
Gcc-4.6 Ubuntu trusty *
Gcc-4.6 Ubuntu utopic *
Gcc-4.6 Ubuntu vivid *
Gcc-4.6-armel-cross Ubuntu precise *
Gcc-4.6-armhf-cross Ubuntu precise *
Gcc-4.7 Ubuntu esm-apps/xenial *
Gcc-4.7 Ubuntu trusty *
Gcc-4.7 Ubuntu utopic *
Gcc-4.7 Ubuntu vivid *
Gcc-4.7 Ubuntu wily *
Gcc-4.7 Ubuntu xenial *
Gcc-4.7 Ubuntu yakkety *
Gcc-4.7 Ubuntu zesty *
Gcc-4.7-armel-cross Ubuntu trusty *
Gcc-4.7-armel-cross Ubuntu utopic *
Gcc-4.7-armel-cross Ubuntu vivid *
Gcc-4.7-armel-cross Ubuntu wily *
Gcc-4.7-armel-cross Ubuntu xenial *
Gcc-4.7-armel-cross Ubuntu yakkety *
Gcc-4.7-armel-cross Ubuntu zesty *
Gcc-4.7-armhf-cross Ubuntu trusty *
Gcc-4.7-armhf-cross Ubuntu utopic *
Gcc-4.7-armhf-cross Ubuntu vivid *
Gcc-4.7-armhf-cross Ubuntu wily *
Gcc-4.7-armhf-cross Ubuntu xenial *
Gcc-4.7-armhf-cross Ubuntu yakkety *
Gcc-4.7-armhf-cross Ubuntu zesty *
Gcc-4.8 Ubuntu upstream *
Gcc-arm-linux-androideabi Ubuntu trusty *
Gcc-arm-linux-androideabi Ubuntu utopic *
Gcc-arm-linux-androideabi Ubuntu vivid *
Gcc-arm-linux-androideabi Ubuntu wily *
Gcc-arm-linux-androideabi Ubuntu xenial *
Gcc-arm-linux-androideabi Ubuntu yakkety *
Gcc-arm-linux-androideabi Ubuntu zesty *
Gcc-arm-none-eabi Ubuntu artful *
Gcc-arm-none-eabi Ubuntu bionic *
Gcc-arm-none-eabi Ubuntu cosmic *
Gcc-arm-none-eabi Ubuntu disco *
Gcc-arm-none-eabi Ubuntu eoan *
Gcc-arm-none-eabi Ubuntu groovy *
Gcc-arm-none-eabi Ubuntu hirsute *
Gcc-arm-none-eabi Ubuntu impish *
Gcc-arm-none-eabi Ubuntu kinetic *
Gcc-arm-none-eabi Ubuntu lunar *
Gcc-arm-none-eabi Ubuntu mantic *
Gcc-arm-none-eabi Ubuntu trusty *
Gcc-arm-none-eabi Ubuntu utopic *
Gcc-arm-none-eabi Ubuntu vivid *
Gcc-arm-none-eabi Ubuntu wily *
Gcc-arm-none-eabi Ubuntu xenial *
Gcc-arm-none-eabi Ubuntu yakkety *
Gcc-arm-none-eabi Ubuntu zesty *
Gcc-avr Ubuntu lucid *
Gcc-avr Ubuntu precise *
Gcc-h8300-hms Ubuntu artful *
Gcc-h8300-hms Ubuntu bionic *
Gcc-h8300-hms Ubuntu cosmic *
Gcc-h8300-hms Ubuntu disco *
Gcc-h8300-hms Ubuntu eoan *
Gcc-h8300-hms Ubuntu groovy *
Gcc-h8300-hms Ubuntu hirsute *
Gcc-h8300-hms Ubuntu impish *
Gcc-h8300-hms Ubuntu kinetic *
Gcc-h8300-hms Ubuntu lucid *
Gcc-h8300-hms Ubuntu lunar *
Gcc-h8300-hms Ubuntu mantic *
Gcc-h8300-hms Ubuntu precise *
Gcc-h8300-hms Ubuntu trusty *
Gcc-h8300-hms Ubuntu utopic *
Gcc-h8300-hms Ubuntu vivid *
Gcc-h8300-hms Ubuntu wily *
Gcc-h8300-hms Ubuntu xenial *
Gcc-h8300-hms Ubuntu yakkety *
Gcc-h8300-hms Ubuntu zesty *
Gcc-i686-linux-android Ubuntu trusty *
Gcc-i686-linux-android Ubuntu utopic *
Gcc-i686-linux-android Ubuntu vivid *
Gcc-i686-linux-android Ubuntu wily *
Gcc-i686-linux-android Ubuntu xenial *
Gcc-i686-linux-android Ubuntu yakkety *
Gcc-i686-linux-android Ubuntu zesty *
Gcc-mingw-w64 Ubuntu artful *
Gcc-mingw-w64 Ubuntu bionic *
Gcc-mingw-w64 Ubuntu cosmic *
Gcc-mingw-w64 Ubuntu disco *
Gcc-mingw-w64 Ubuntu eoan *
Gcc-mingw-w64 Ubuntu groovy *
Gcc-mingw-w64 Ubuntu hirsute *
Gcc-mingw-w64 Ubuntu impish *
Gcc-mingw-w64 Ubuntu kinetic *
Gcc-mingw-w64 Ubuntu lunar *
Gcc-mingw-w64 Ubuntu mantic *
Gcc-mingw-w64 Ubuntu precise *
Gcc-mingw-w64 Ubuntu trusty *
Gcc-mingw-w64 Ubuntu utopic *
Gcc-mingw-w64 Ubuntu vivid *
Gcc-mingw-w64 Ubuntu wily *
Gcc-mingw-w64 Ubuntu xenial *
Gcc-mingw-w64 Ubuntu yakkety *
Gcc-mingw-w64 Ubuntu zesty *
Gcc-mingw32 Ubuntu lucid *
Gcc-msp430 Ubuntu artful *
Gcc-msp430 Ubuntu bionic *
Gcc-msp430 Ubuntu cosmic *
Gcc-msp430 Ubuntu disco *
Gcc-msp430 Ubuntu eoan *
Gcc-msp430 Ubuntu groovy *
Gcc-msp430 Ubuntu hirsute *
Gcc-msp430 Ubuntu impish *
Gcc-msp430 Ubuntu kinetic *
Gcc-msp430 Ubuntu lunar *
Gcc-msp430 Ubuntu mantic *
Gcc-msp430 Ubuntu precise *
Gcc-msp430 Ubuntu trusty *
Gcc-msp430 Ubuntu utopic *
Gcc-msp430 Ubuntu vivid *
Gcc-msp430 Ubuntu wily *
Gcc-msp430 Ubuntu xenial *
Gcc-msp430 Ubuntu yakkety *
Gcc-msp430 Ubuntu zesty *
Gcc-snapshot Ubuntu lucid *
Gcc-snapshot Ubuntu precise *
Gcc-snapshot Ubuntu utopic *
Gcc-snapshot Ubuntu vivid *

Potential Mitigations

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • If possible, choose a language or compiler that performs automatic bounds checking.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • Use libraries or frameworks that make it easier to handle numbers without unexpected consequences.
  • Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++). [REF-106]
  • Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
  • Use unsigned integers where possible. This makes it easier to perform validation for integer overflows. When signed integers are required, ensure that the range check includes minimum values as well as maximum values.
  • Understand the programming language’s underlying representation and how it interacts with numeric calculation (CWE-681). Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, “not-a-number” calculations, and how the language handles numbers that are too large or too small for its underlying representation. [REF-7]
  • Also be careful to account for 32-bit, 64-bit, and other potential differences that may affect the numeric representation.

References