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

Unexpected Sign Extension

The product performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type.

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

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

What it is

The product performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type.

Impact on systems

ScopeImpact
Integrity, Confidentiality, Availability, Other Read Memory, Modify Memory, Other
When an unexpected sign extension occurs in code that operates directly on memory buffers, such as a size value or a memory index, then it could cause the program to write or read outside the boundaries of the intended buffer. If the numeric value is associated with an application-level resource, such as a quantity or price for a product in an e-commerce site, then the sign extension could produce a value that is much higher (or lower) than the application's allowable range. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.

How to prevent it

Implementation Avoid using signed variables if you don't need to represent negative values. When negative values are needed, perform validation after you save those values to larger data types, or before passing them to functions that are expecting unsigned values.

Source: MITRE CWE catalog · Official entry on the MITRE website

CWE-194 CVEs published per year

2026: year in progress, updated every hour

Show the data as a table
YearCVE
20211
20221
20251
20262

All CWE-194 CVEs

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