CWE-195: Signed to Unsigned Conversion Error

ID CWE-195
Abstraction Variant
Structure Simple
Status Draft
Number of CVEs 9
The product uses a signed primitive and performs a cast to an unsigned primitive, which can produce an unexpected value if the value of the signed primitive can not be represented using an unsigned primitive.

It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.

Often, functions will return negative values to indicate a failure. When the result of a function is to be used as a size parameter, using these negative return values can have unexpected results. For example, if negative size values are passed to the standard memory copy or allocation functions they will be implicitly cast to a large unsigned value. This may lead to an exploitable buffer overflow or underflow condition.

Modes of Introduction

Phase Note
Implementation

Applicable Platforms

Type Class Name Prevalence
Language C
Language C++

Relationships

View Weakness
# ID View Status # ID Name Abstraction Structure Status
CWE-1000 Research Concepts Draft CWE-681 Incorrect Conversion between Numeric Types Base Simple Draft
CWE-1305 CISQ Quality Measures (2020) Incomplete CWE-681 Incorrect Conversion between Numeric Types Base Simple Draft
CWE-1340 CISQ Data Protection Measures Incomplete CWE-681 Incorrect Conversion between Numeric Types Base Simple Draft
CWE-1000 Research Concepts Draft CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer Class Simple Stable

CVEs Published

CVSS Severity

CVSS Severity - By Year

CVSS Base Score

# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories Exploits PoC Pubblication Date Modification Date
# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories PoC Pubblication Date Modification Date
Loading...
Loading...