Skip to content
OpenAdvisories

Weakness (CWE)

CWE-196: Unsigned to Signed Conversion Error

Variant Draft

The product uses an unsigned primitive and performs a cast to a signed primitive, which can produce an unexpected value if the value of the unsigned primitive can not be represented using a signed primitive.

How to prevent it (3 mitigations)
  1. Requirements

    Choose a language which is not subject to these casting flaws.

  2. Architecture and Design

    Design object accessor functions to implicitly check values for valid sizes. Ensure that all functions which will be used as a size are checked previous to use as a size. If the language permits, throw exceptions rather than using in-band errors.

  3. Implementation

    Error check the return values of all functions. Be aware of implicit casts made, and use unsigned variables for sizes if at all possible.

Source: MITRE CWE-196

10 results · Feed

  • Medium 5.3

    libaec through 1.1.7 Out-of-Bounds Read via m_se_decode() Second Extension Decoder

    libaec through 1.1.7 contains an out-of-bounds read vulnerability in m_se_decode() in src/decode.c that allows attackers to bypass a signed bounds check via an overlong fundamental sequence. Attackers can supply a crafted CCSDS 121.0/SZIP stream with 2^31 or …

  • Medium 5.9

    ImageMagick: Infinite Loop in PSD decoder on 32-bit builds

    ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to 7.1.2-32 and 6.9.13-57, a crafted PSD file can trigger an integer-conversion error in the PSD decoder on 32-bit builds, causing an infinite loop and denial…

  • Critical 9.1

    Imager versions before 1.036 for Perl exit the process reading a TGA with a colour map length of 32768 or more in tga_palette_read

    Imager versions before 1.036 for Perl exit the process reading a TGA with a colour map length of 32768 or more in tga_palette_read. The reader unpacks the two-byte colour map length into a signed short, so a length of 32768 or more becomes negative. tga_palet…

  • Medium 6.3

    Unsigned to Signed Conversion Error (CWE-196) vulnerability exists in TTSSH2 plugin of Tera Term provided by TeraTerm P…

  • Critical 9.8

    Imager versions before 1.033 for Perl treat unsigned EXIF IFD entry counts as signed

    Imager versions before 1.033 for Perl treat unsigned EXIF IFD entry counts as signed. Imager mishandled large EXIF IFD entry count values, treating them as negative numbers. This could lead to an attempt to allocate a block nearly the size of the address spac…

  • High 7.2

    RAUC: Improper Signing of Plain Bundles Exceeding 2 GiB

    RAUC controls the update process on embedded Linux systems. Prior to version 1.15.2, RAUC bundles using the 'plain' format exceeding a payload size of 2 GiB cause an integer overflow which results in a signature which covers only the first few bytes of the pa…

  • Medium 6.7
  • Critical 9.1

    Incorrect Conversion between Numeric Types in Besu Ethereum Client

    Besu is a Java-based Ethereum client. In versions newer than 22.1.3 and prior to 22.7.1, Besu is subject to an Incorrect Conversion between Numeric Types. An error in 32 bit signed and unsigned types in the calculation of available gas in the CALL operations …

  • High 8.8

    An exploitable signed conversion vulnerability exists in the TextMaker document parsing functionality of SoftMaker Offi…

  • High 7.5

    OOB Read in urldecode()

    In PHP versions 7.2.x below 7.2.30, 7.3.x below 7.3.17 and 7.4.x below 7.4.5, if PHP is compiled with EBCDIC support (uncommon), urldecode() function can be made to access locations past the allocated memory, due to erroneously using signed numbers as array i…