1. CVE archive
  2. Vulnerability types
  3. CWE-196
CWE-196 · #492 most frequent type in the archive

Unsigned to Signed Conversion Error

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.

Part of: CWE-681 · Incorrect Conversion between Numeric Types

6CVEs of this type in the archive
2critical (CVSS ≥ 9)
1high severity (7–8.9)
Nov 2, 2026latest published

What it is

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.

Impact on systems

ScopeImpact
Availability DoS: Crash, Exit, or Restart
Incorrect sign conversions generally lead to undefined behavior, and therefore crashes.
Integrity Modify Memory
If a poor cast leads to a buffer overflow or similar condition, data integrity may be affected. This can be a precursor to dangerous buffer underwrite conditions that allow attackers to move down the stack where they otherwise might not have access in a normal buffer overflow condition. Buffer underwrites occur frequently when large unsigned values are cast to signed values, and then used as indexes into a buffer or for pointer arithmetic.
Integrity, Confidentiality, Availability, Access Control Execute Unauthorized Code or Commands, Bypass Protection Mechanism
Improper signed-to-unsigned conversions without proper checking can sometimes trigger buffer overflows which can be used to execute arbitrary code. This is usually outside the scope of a program's implicit security policy.

How to prevent it

Requirements Choose a language which is not subject to these casting flaws.
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.
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 catalog · Official entry on the MITRE website

All CWE-196 CVEs

6 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.