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.9

    Integer overflow in simdjson

    An integer overflow vulnerability in the simdjson document-builder API allows incorrect buffer size calculations in "string_builder::escape_and_append()" when processing very large input strings on platforms with limited "size_t" width (e.g., 32-bit builds). …

  • Medium 6.5

    Netty: HTTP Request Smuggling due to incorrect chunk size parsing

    Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final and 4.1.133.Final, Netty's chunk size parser silently overflows int, enabling request smuggling attacks. This vulnerability is fixed in 4.2.13.Final and 4.1.133.Final.

  • Medium 6.2

    CAI Content Credentials | Integer Overflow or Wraparound (CWE-190)

    CAI Content Credentials versions c2pa-web@0.7.0, c2pa-v0.78.2 and earlier are affected by an Integer Overflow or Wraparound vulnerability that could result in an application denial-of-service. An attacker could exploit this vulnerability to crash the applicat…

  • Medium 6.2

    CAI Content Credentials | Integer Overflow or Wraparound (CWE-190)

    CAI Content Credentials versions c2pa-web@0.7.0, c2pa-v0.78.2 and earlier are affected by an Integer Overflow or Wraparound vulnerability that could result in an application denial-of-service. An attacker could exploit this vulnerability to crash the applicat…

  • Medium 6.2

    jq: Wild stack write via signed-integer overflow in decNumber D2U() macro

    jq is a command-line JSON processor. In 1.8.1 and earlier, when decNumberFromString is given a number literal of INT_MAX-1 (2147483646) digits, the D2U() macro overflows during signed-int arithmetic. The wrapped negative value bypasses the heap-allocation siz…

  • Medium 6.4

    jq: Signed-int overflow in `stack_reallocate` (jq VM stack)

    jq is a command-line JSON processor. In 1.8.1 and earlier, the jq bytecode VM's data stack tracks its allocation size in a signed int. When the stack grows beyond ≈1 GiB (via deeply nested generator forks), the doubling arithmetic overflows. The wrapped value…

  • Medium 6.3

    Signed integer overflow in metaphone()

    In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, the metaphone() function in ext/standard/metaphone.c uses a signed int variable to track the current position within the input string. If a string longer th…

  • Medium 5.1

    Pillow: Integer overflow when processing fonts

    Pillow is a Python imaging library. Prior to version 12.2.0, if a font advances for each glyph by an exceeding large amount, when Pillow keeps track of the current position, it may lead to an integer overflow. This issue has been patched in version 12.2.0.

  • Medium 6.6

    Vim: Heap Buffer Overflow in spell file loading

    Vim is an open source, command line text editor. Prior to version 9.2.0450, a heap buffer overflow exists in read_compound() in src/spellfile.c when loading a crafted spell file (.spl) with UTF-8 encoding active. An attacker-controlled length field in the spe…

  • Medium 6.2

    Grid: Integer Overflow in Grid::expand_rows Leads to Safe-API Undefined Behavior

    Grid is a data structure grid for rust. From version 0.17.0 to before version 1.0.1, an integer overflow in Grid::expand_rows() can corrupt the relationship between the grid’s logical dimensions and its backing storage. After the internal invariant is broken,…

  • Medium 6.3

    OpenEXR: Shift exponent overflow in `readVariableLengthInteger()` (`ImfIDManifest.cpp`)

    OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. From versions 3.0.0 to before 3.2.9, 3.3.0 to before 3.3.11, and 3.4.0 to before 3.4.11, readVariableLengthInteger…

  • Medium —

    imageproc: integer overflow in kernel size check leads to out-of-bounds read

    A bounds verification of a slice storage of a 2-dimensional matrix's coefficients (a kernel) would compare the total size against the product of individual dimensions. This would erroneously cast *after* the multiplication and consequently fail to detect poss…

  • Medium —

    imageproc: Out-of-bounds read via NaN coordinates in bilinear/bicubic sampling

    A bounds check was performed in floating points before a cast to the index passed to an unchecked access function. This checked considered `NaN` cases improperly, causing them to succeed the check instead of failing it. The floating point coordinate is under …

  • Medium —

    imageproc has fragile bounds check when sampling from image

    A read of pixels was coded as modifying coordinates to lie within the image bounds. It would calculate a coordinate by adding a constant to an input and taking the minimum of the resulting coordinate and 'dimension - 1'. This would not protect against malicio…

  • Medium —

    kanidmd_lib: Image upload validators run before authorization; PNG validator panics on malformed input

    ### Summary The `POST /v1/domain/_image` and `POST /v1/oauth2/{rs_name}/_image` handlers call `validate_image()` on the uploaded body **before** the ACL check that restricts image upload to admins. Any bug in an image validator is therefore reachable by an un…

  • Medium 6.1

    CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm)

    CImg Library is a C++ library for image processing. Prior to commit 4ca26bc, there is an integer overflow vulnerability in the W*H*D size computation inside _load_pnm() that can bypass the memory allocation guard. A crafted PNM/PGM/PPM file with large dimensi…

  • Medium 6.5

    FRRouting < 10.5.3 Integer Overflow in OSPF TLV Parser Functions

    FRRouting before 10.5.3 contains an integer overflow vulnerability in seven OSPF Traffic Engineering and Segment Routing TLV parser functions where a uint16_t accumulator variable truncates uint32_t values returned by the TLV_SIZE() macro, causing the loop te…

  • Medium 4.0

    Little CMS (lcms2) 2.16 through 2.18 before 2.19 has an integer overflow in ParseCube in cmscgats.c.

  • Medium 5.3

    go-ntlmssp NTLM challenges can panic on malformed payloads

    go-ntlmssp is a Go package that provides NTLM/Negotiate authentication over HTTP. Prior to version 0.1.1, a malicious NTLM challenge message can causes an slice out of bounds panic, which can crash any Go process using `ntlmssp.Negotiator` as an HTTP transpor…

  • Medium 6.5

    Insufficient validation of HTTPS and SVCB records

    An operator allowed to use the REST API can cause the Authoritative server to produce invalid HTTPS or SVCB record data, which can in turn cause LMDB database corruption, if using the LMDB backend.

  • Medium 6.6

    Integer overflow in constant tensor data size calculation in Samsung Open Source ONE could cause incorrect buffer sizin…

  • Medium 6.6

    Integer overflow in tensor copy size calculation in Samsung Open Source ONE could lead to out of bounds access during l…

  • Medium 6.1

    Integer overflow in scratch buffer initialization size calculation in Samsung Open Source ONE cause incorrect memory in…

  • Medium 6.6

    Integer overflow in memory copy size calculation in Samsung Open Source ONE could lead to invalid memory operations wit…

  • Medium 6.6

    Integer overflow in output tensor copy size calculation in Samsung Open Source ONE could cause incorrect copy length an…

  • Medium 6.6

    Integer overflow in buffer size calculation could result in out of bounds memory access when handling large tensors in …

  • Medium 5.3

    Potential Integer overflow in tensor allocation size calculation could lead to insufficient memory allocation for large…

  • Medium 5.3

    Incorrect boundary conditions, integer overflow in the Audio/Video: Playback component

    Incorrect boundary conditions, integer overflow in the Audio/Video: Playback component. This vulnerability was fixed in Firefox 150 and Thunderbird 150.

  • Medium 5.3

    OpenEXR has HTJ2K Signed Integer Overflow in ht_undo_impl()

    OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. Versions 3.4.0 through 3.4.9 have a signed integer overflow vulnerability in OpenEXR's HTJ2K (High-Throughput JPEG…

  • Medium 6.0

    Firebird server hangs when using specific clumplet on batch creation

    Firebird is an open-source relational database management system. In versions prior to 5.0.4, 4.0.7 and 3.0.14, the ClumpletReader::getClumpletSize() function can overflow the totalLength value when parsing a Wide type clumplet, causing an infinite loop. An a…

  • Medium 4.9

    FFmpeg before 8.1 has an integer overflow and resultant out-of-bounds write via CENC (Common Encryption) subsample data…

  • Medium 6.5

    Ffmpeg: ffmpeg: denial of service and potential arbitrary code execution via signed integer overflow in dvd subtitle parser

    A flaw was found in FFmpeg. A remote attacker could exploit this vulnerability by providing a specially crafted MPEG-PS/VOB media file containing a malicious DVD subtitle stream. This vulnerability is caused by a signed integer overflow in the DVD subtitle pa…

  • Medium 5.5

    Gimp: gimp: heap buffer overflow due to integer overflow in fits image loader

    A flaw was found in GIMP. A remote attacker could exploit an integer overflow vulnerability in the FITS image loader by providing a specially crafted FITS file. This integer overflow leads to a zero-byte memory allocation, which is then subjected to a heap bu…

  • Medium 4.4

    A integer overflow or wraparound vulnerability in Fortinet FortiWeb 8.0.0 through 8.0.3, FortiWeb 7.6.0 through 7.6.6, …

  • Medium 5.1

    ImageMagick: Integer overflow in despeckle operation causes heap buffer overflow on 32-bit builds

    ImageMagick is free and open-source software used for editing and manipulating digital images. In versions below both 7.1.2-19 and 6.9.13-44, an integer overflow in the despeckle operation causes a heap buffer overflow on 32-bit builds that will result in an …

  • Medium 5.9

    ImageMagick has a Heap overflow caused by integer overflow/wraparound in viff encoder on 32-bit builds

    ImageMagick is free and open-source software used for editing and manipulating digital images. In versions below both 7.1.2-19 and 6.9.13-44, the viff encoder contains an integer truncation/wraparound issue on 32-bit builds that could trigger an out of bounds…

  • Medium 5.1

    Integer overflow or wraparound vulnerability in Samsung Open Source Escargot allows undefined behavior.This issue affec…

  • Medium 4.0

    In libexif through 0.6.25, an unsigned 32bit integer overflow in Nikon MakerNote handling could be used by local attack…

  • Medium 5.5

    osslsigncode has an Integer Underflow in PE Page Hash Calculation Can Cause Out-of-Bounds Read

    osslsigncode is a tool that implements Authenticode signing and timestamping. Prior to 2.13, an integer underflow vulnerability exists in osslsigncode version 2.12 and earlier in the PE page-hash computation code (pe_page_hash_calc()). When page hash processi…

  • Medium 4.3

    In sec boot, there is a possible out of bounds write due to an integer overflow. This could lead to local denial of ser…