499
Medium
Common Consequences
Scope Impact Likelihood
Availability DoS: Crash, Exit, or Restart
Incorrect sign conversions generally lead to undefined
behavior, and therefore crashes.
Integrity Modify Memory
If a poor cast lead to a buffer overflow or similar condition,
data integrity may be affected.
Integrity
Confidentiality
Availability
Access Control
Execute Unauthorized Code or Commands
Bypass Protection Mechanism
Improper signed-to-unsigned conversions without proper
checking can sometimes trigger buffer overflows which can
be used to execute arbitrary code. This is usually outside
the scope of a program's implicit security policy.
Potential Mitigations
Phase: Requirements
Choose a language which is not subject to these casting flaws.
Phase: Architecture and Design
Design object accessor functions to implicitly check values for valid sizes. Ensure that all
functions which will be used as a size are checked previous to use as a size. If the language
permits, throw exceptions rather than using in-band errors.
Phase: Implementation
Error check the return values of all functions. Be aware of implicit casts made, and use unsigned
variables for sizes if at all possible.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 998 SFP Secondary Cluster: Glitch in Computation 888 2419
MemberOf 1416 Comprehensive Categorization: Resource Lifecycle
Management
1400 2545
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
CLASP Unsigned to signed conversion error
Software Fault Patterns SFP1 Glitch in computation
Related Attack Patterns
CAPEC-ID Attack Pattern Name
92 Forced Integer Overflow
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 Version 4.14
CWE-197: Numeric Truncation Error
CWE-197: Numeric Truncation Error