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

3 results · Clear filters · Feed

  • 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…

  • 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…