CWE-194: Unexpected Sign Extension
6 CVEs have CWE-194 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 2.019%.
The product performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type.
Child of CWE-681: Incorrect Conversion between Numeric Types
Mitigations
- 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.
Observed examples
- CVE-2018-10887: Chain: unexpected sign extension (CWE-194) leads to integer overflow (CWE-190), causing an out-of-bounds read (CWE-125)
- CVE-1999-0234: Sign extension error produces -1 value that is treated as a command separator, enabling OS command injection.
- CVE-2003-0161: Product uses char type for input character. When char is implemented as a signed type, ASCII value 0xFF (255), a sign extension produces a -1 value that is treated as a program-specific separator value, effectively disabling a length check and leading to a buffer overflow. This is also a multiple interpretation error.
- CVE-2007-4988: Chain: signed short width value in image processor is sign extended during conversion to unsigned int, which leads to integer overflow and heap-based buffer overflow.
- CVE-2006-1834: Chain: signedness error allows bypass of a length check; later sign extension makes exploitation easier.
- CVE-2005-2753: Sign extension when manipulating Pascal-style strings leads to integer overflow and improper memory copy.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-194'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-194'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).