498
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP1 Glitch in computation
CERT C Secure Coding INT31-C CWE More Specific Ensure that integer conversions do not
result in lost or misinterpreted data
References
[REF-62]Mark Dowd, John McDonald and Justin Schuh. "The Art of Software Security
Assessment". 1st Edition. 2006. Addison Wesley.
[REF-18]Secure Software, Inc.. "The CLASP Application Security Process". 2005. < https://
cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf >.
CWE-196: Unsigned to Signed Conversion Error
Weakness ID : 196
Structure : Simple
Abstraction : Variant
Description
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.
Extended Description
Although less frequent an issue than signed-to-unsigned conversion, unsigned-to-signed
conversion can be the perfect 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.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 681 Incorrect Conversion between Numeric Types 1495
CanAlsoBe 120 Buffer Copy without Checking Size of Input ('Classic Buffer
Overflow')