Skip to content
OpenAdvisories

Weakness (CWE)

CWE-190: Integer Overflow or Wraparound

Base

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.

How to prevent it (7 mitigations)
  1. Requirements

    Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.

  2. Requirements

    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.

  3. Architecture and Design

    Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].

    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]

  4. Implementation

    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.

  5. Implementation

    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.

  6. Architecture and Design

    For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

  7. Implementation

    Examine compiler warnings closely and eliminate problems with potential security implications, such as signed / unsigned mismatch in memory operations, or use of uninitialized variables. Even if the weakness is rarely exploitable, a single failure may lead to the compromise of the entire system.

Source: MITRE CWE-190

598 results · Clear filters · Feed

  • Medium 6.7

    A crafted NTFS image can cause an integer overflow in memmove, leading to a heap-based buffer overflow in the function …

  • Medium 5.5

    XMP Toolkit SDK Integer Overflow Vulnerability Could Result In Application Denial Of Service

    XMP Toolkit SDK version 2020.1 (and earlier) is affected by an Integer Overflow vulnerability potentially resulting in application-level denial of service in the context of the current user. Exploitation requires user interaction in that a victim must open a …

  • Medium 5.9

    Integer Overflow in Chunked Transfer-Encoding

    hyper is an HTTP library for Rust. In versions prior to 0.14.10, hyper's HTTP server and client code had a flaw that could trigger an integer overflow when decoding chunk sizes that are too big. This allows possible data loss, or if combined with an upstream …

  • Medium 6.5

    Integer overflow in pywin32

    An integer overflow exists in pywin32 prior to version b301 when adding an access control entry (ACE) to an access control list (ACL) that would cause the size to be greater than 65535 bytes. An attacker who successfully exploited this vulnerability could cra…

  • Medium 6.9

    Integer Overflow in memory allocating functions

    Integer Overflow in memory allocating functions. Zephyr versions >= 1.14.2, >= 2.4.0 contain Integer Overflow or Wraparound (CWE-190). For more information, see https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-94vp-8gc2-rm45

  • Medium 6.3

    Integer overflow in TFLite concatentation

    TensorFlow is an end-to-end open source platform for machine learning. The TFLite implementation of concatenation is vulnerable to an integer overflow issue(https://github.com/tensorflow/tensorflow/blob/7b7352a724b690b11bfaae2cd54bc3907daf6285/tensorflow/lite…

  • Medium 5.4

    Integer overflow on 32-bit systems

    Redis is an open-source, in-memory database that persists on disk. In affected versions of Redis an integer overflow bug in 32-bit Redis version 4.0 or newer could be exploited to corrupt the heap and potentially result with remote code execution. Redis 4.0 o…

  • Medium 5.9
    CVE-2021-23841 Public exploit

    Null pointer deref in X509_issuer_and_serial_hash()

    The OpenSSL public API function X509_issuer_and_serial_hash() attempts to create a unique hash value based on the issuer and serial number data contained within an X509 certificate. However it fails to correctly handle any errors that may occur while parsing …

  • Medium 5.7

    apt integer wraparound

    APT had several integer overflows and underflows while parsing .deb packages, aka GHSL-2020-168 GHSL-2020-169, in files apt-pkg/contrib/extracttar.cc, apt-pkg/deb/debfile.cc, and apt-pkg/contrib/arfile.cc. This issue affects: apt 1.2.32ubuntu0 versions prior …

  • Medium 6.5

    $mod can result in undefined behavior

    A user authorized to perform database queries may trigger denial of service by issuing specially crafted queries, which use the $mod operator to overflow negative values. This issue affects: MongoDB Inc. MongoDB Server v4.4 versions prior to 4.4.1; v4.2 versi…

  • Medium 5.5

    Integer overflow in HoRNDIS

    All versions of HoRNDIS are affected by an integer overflow in the RNDIS packet parsing routines. A malicious USB device can trigger disclosure of unrelated kernel memory to userspace applications on the host, or can cause the kernel to crash. Kernel memory d…

  • Medium 6.7

    An integer overflow leading to a heap-buffer overflow was found in The X Input Method (XIM) client was implemented in l…

  • Medium 5.7

    There is an issue with grub2 before version 2.06 while handling symlink on ext filesystems. A filesystem containing a s…

  • Medium 5.7

    There is an issue on grub2 before version 2.06 at function read_section_as_string(). It expects a font name to be at ma…

  • Medium 5.9

    Insecure Encryption

    Data is truncated wrong when its length is greater than 255 bytes.

  • Medium 6.8

    Remote Denial of Service in CoAP Option Parsing Due To Integer Overflow

    A remote adversary with the ability to send arbitrary CoAP packets to be parsed by Zephyr is able to cause a denial of service. This issue affects: zephyrproject-rtos zephyr version 2.2.0 and later versions.

  • Medium 6.0

    A vulnerability was found in DPDK versions 19.11 and above. A malicious container that has direct access to the vhost-u…

  • Medium 5.3

    Temporary files are not cleaned after OOM when parsing HTTP request data

    In PHP versions 7.2.x below 7.2.31, 7.3.x below 7.3.18 and 7.4.x below 7.4.6, when HTTP file uploads are allowed, supplying overly long filenames or field names could lead PHP engine to try to allocate oversized memory storage, hit the memory limit and stop p…

  • Medium 5.1

    A vulnerability was found in DPDK versions 18.05 and above. A missing check for an integer overflow in vhost_user_set_l…

  • Medium 5.1

    A memory corruption issue was found in DPDK versions 17.05 and above. This flaw is caused by an integer truncation on t…

  • Medium 5.1

    A vulnerability was found in DPDK versions 18.11 and above. The vhost-crypto library code is missing validations for us…

  • Medium 6.3

    Integer overflow in bson_ensure_space

    Kevin Backhouse discovered an integer overflow in bson_ensure_space, as used in whoopsie.

  • Medium 6.5

    Integer overflow in whoopsie results in out-of-bounds heap write

    An integer overflow in whoopsie before versions 0.2.52.5ubuntu0.1, 0.2.62ubuntu0.1, 0.2.64ubuntu0.1, 0.2.66, results in an out-of-bounds write to a heap allocated buffer when processing large crash dumps. This results in a crash or possible code-execution in …

  • Medium 6.7

    An integer overflow issue has been reported in the general_composite_rect() function in pixman prior to version 0.32.8.…

  • Medium 5.3

    A denial of service vulnerability was found in rsyslog in the imptcp module. An attacker could send a specially crafted…

  • Medium 6.1
    CVE-2016-6328 Public exploit

    A vulnerability was found in libexif. An integer overflow when parsing the MNOTE entry data of the input file. This can…

  • Medium 4.3

    Curl versions 7.33.0 through 7.61.1 are vulnerable to a buffer overrun in the SASL authentication code that may lead to…

  • Medium 6.5

    A flaw was found in the way dic_unserialize function of glusterfs does not handle negative key length values. An attack…

  • Medium 5.5

    An out-of-bounds heap read vulnerability was found in the jpc_pi_nextpcrl() function of jasper before 2.0.6 when proces…

  • Medium 6.5

    In libpng 1.6.34, a wrong calculation of row_factor in the png_check_chunk_length function (pngrutil.c) may trigger an …

  • Medium 4.8

    procps-ng before version 3.3.15 is vulnerable to an incorrect integer size in proc/alloc.* leading to truncation/intege…

  • Medium 5.3

    ghostscript before version 9.21 is vulnerable to a heap based buffer overflow that was found in the ghostscript jbig2_d…

  • Medium 5.5

    The get_next_block function in archival/libarchive/decompress_bunzip2.c in BusyBox 1.27.2 has an Integer Overflow that …

  • Medium 5.5

    Pillow Integer overflow in Map.c

    Pillow before 3.3.2 allows context-dependent attackers to obtain sensitive information by using the "crafted image file" approach, related to an "Integer Overflow" issue affecting the Image.core.map_buffer in map.c component.

  • Medium —

    Integer Overflow or Wraparound in JBCrypt

    Integer overflow in the crypt_raw method in the key-stretching implementation in jBCrypt before 0.4 makes it easier for remote attackers to determine cleartext values of password hashes via a brute-force attack against hashes associated with the maximum expon…

  • Medium —
    CVE-2014-0075 Public exploit EPSS 18%

    Integer Overflow or Wraparound in Apache Tomcat

    Integer overflow in the parseChunkHeader function in java/org/apache/coyote/http11/filters/ChunkedInputFilter.java in Apache Tomcat before 6.0.40, 7.x before 7.0.53, and 8.x before 8.0.4 allows remote attackers to cause a denial of service (resource consumpti…

  • Medium 6.5

    Multiple integer overflows in libpng before 1.5.14rc03 allow remote attackers to cause a denial of service (crash) via …

  • Medium 6.5

    Integer overflow in the png_set_unknown_chunks function in libpng/pngset.c in libpng before 1.5.14beta08 allows context…