293
Relevant to the view "Weaknesses for Simplified Mapping of Published
Vulnerabilities" (CWE-1003)
Nature Type ID Name Page
ChildOf 704 Incorrect Type Conversion or Cast 1538
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 136 Type Errors 2310
Applicable Platforms
Language : C (Prevalence = Undetermined)
Language : C++ (Prevalence = Undetermined)
Alternate Terms
Object Type Confusion :
Common Consequences
Scope Impact Likelihood
Availability
Integrity
Confidentiality
Read Memory
Modify Memory
Execute Unauthorized Code or Commands
DoS: Crash, Exit, or Restart
When a memory buffer is accessed using the wrong type,
it could read or write memory out of the bounds of the
buffer, if the allocated buffer is smaller than the type that
the code is attempting to access, leading to a crash and
possibly code execution.
Demonstrative Examples
Example 1:
The following code uses a union to support the representation of different types of messages. It
formats messages differently, depending on their type.
CWE Version 4.14
CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')