CWE-194: Unexpected Sign Extension

low-risk

The product performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.

Abstraction: Variant

Common Consequences

Integrity Read Memory

Detection Methods

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Real-World Examples (5)

CVE CVSS EPSS KEV
CVE-2022-32138 8.8 1.1%
CVE-2021-38434 7.8 0.3%
CVE-2018-10887 8.1 0.3%
CVE-2020-13544 7.8 0.2%
CVE-2025-13632 5.4 0.0%
0
/ 100
low-risk
Active Threat 0/50 · Minimal
Exploit Availability 0/50 · Minimal