CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.
常见后果
影响范围: 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.
观察示例
参考: CVE-2010-4577
Type confusion in CSS sequence leads to out-of-bounds read.
参考: CVE-2011-0611
Size inconsistency allows code execution, first discovered when it was actively exploited in-the-wild.
参考: CVE-2010-0258
Improperly-parsed file containing records of different types leads to code execution when a memory location is interpreted as a different object than intended.
引入模式
| 阶段 | 说明 |
|---|---|
| Implementation | - |
适用平台
编程语言
分类映射
| 分类名称 | 条目ID | 条目名称 | 映射适配度 |
|---|---|---|---|
| CERT C Secure Coding | EXP39-C | Do not access a variable through a pointer of an incompatible type | Exact |