Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-843 (使用不兼容类型访问资源(类型混淆)) — Vulnerability Class 348

348 vulnerabilities classified as CWE-843 (使用不兼容类型访问资源(类型混淆)). AI Chinese analysis included.

CWE-843, Type Confusion, is a critical memory safety weakness where a resource is initialized with one data type but subsequently accessed using an incompatible type. This discrepancy often triggers logical errors or undefined behavior, particularly in memory-unsafe languages like C and C++, where the program misinterprets the underlying bit patterns. Attackers typically exploit this vulnerability by crafting malicious inputs that force the application to treat a pointer or object as a different type, potentially leading to arbitrary code execution, data corruption, or denial of service. To mitigate this risk, developers must enforce strict type checking and validation at runtime. Utilizing memory-safe programming languages, implementing comprehensive unit tests for type assertions, and employing static analysis tools can effectively detect these mismatches before deployment, ensuring that resources are always accessed according to their intended definitions.

MITRE CWE Description
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. When the product accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access. While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways. This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.
Common Consequences (1)
Availability, Integrity, ConfidentialityRead 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.
Examples (2)
The following code uses a union to support the representation of different types of messages. It formats messages differently, depending on their type.
#define NAME_TYPE 1 #define ID_TYPE 2 struct MessageBuffer { int msgType; union { char *name; int nameID; }; }; int main (int argc, char **argv) { struct MessageBuffer buf; char *defaultMessage = "Hello World"; buf.msgType = NAME_TYPE; buf.name = defaultMessage; printf("Pointer of buf.name is %p\n", buf.name); /* This particular value for nameID is used to make the code architecture-independent. If coming from untrusted input, it could be any value. */ buf.nameID = (int)(defaultMessage + 1); printf("Pointer of buf.name is now %p\n", buf.name); if (buf.msgType == NAME_TYPE) { printf("Message: %
Bad · C
The following PHP code accepts a value, adds 5, and prints the sum.
$value = $_GET['value']; $sum = $value + 5; echo "value parameter is '$value'<p>"; echo "SUM is $sum";
Bad · PHP
CVE IDTitleCVSSSeverityPublished
CVE-2024-10231 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-10-22
CVE-2024-43596 Microsoft Edge (Chromium-based) Remote Code Execution Vulnerability — Microsoft Edge (Chromium-based) 6.5 Medium2024-10-17
CVE-2024-9859 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-10-11
CVE-2024-9603 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-10-08
CVE-2024-9602 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-10-08
CVE-2024-7824 Type-confusion vulnerability that can cause the WRSA.exe service to crash and generate a crash dump — SecureAnywhere - Web Shield 9.8 -2024-10-03
CVE-2024-7825 Type confusion that can cause the WRSA.exe service to crash and generate a crash dump — SecureAnywhere - Web Shield 9.8 -2024-10-03
CVE-2024-9122 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-09-24
CVE-2024-43489 Microsoft Edge (Chromium-based) Remote Code Execution Vulnerability — Microsoft Edge (Chromium-based) 6.5 Medium2024-09-19
CVE-2024-8904 Google Chrome 安全漏洞 — Chrome 8.8 -2024-09-17
CVE-2024-45112 Acrobat Reader | Access of Resource Using Incompatible Type ('Type Confusion') (CWE-843) — Acrobat Reader 7.8 High2024-09-13
CVE-2024-8638 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-09-11
CVE-2024-6119 Possible denial of service in X.509 name checks — OpenSSL 7.5AIHighAI2024-09-03
CVE-2024-8194 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-08-28
CVE-2024-38207 Microsoft Edge (HTML-based) Memory Corruption Vulnerability — Microsoft Edge (Chromium-based) 6.3 Medium2024-08-23
CVE-2024-38209 Microsoft Edge (Chromium-based) Remote Code Execution Vulnerability — Microsoft Edge (Chromium-based) 7.8 High2024-08-22
CVE-2024-7971 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-08-21
CVE-2024-7969 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-08-21
CVE-2024-38178 Scripting Engine Memory Corruption Vulnerability — Windows 11 Version 24H2 7.5 High2024-08-13
CVE-2024-38219 Microsoft Edge (Chromium-based) Remote Code Execution Vulnerability — Microsoft Edge (Chromium-based) 6.5 Medium2024-08-08
CVE-2024-38218 Microsoft Edge (HTML-based) Memory Corruption Vulnerability — Microsoft Edge (Chromium-based) 8.4 High2024-08-08
CVE-2024-37987 Secure Boot Security Feature Bypass Vulnerability — Windows 10 Version 1809 8.0 High2024-07-09
CVE-2024-36278 Arkcompiler Ets Runtime has a type confusion vulnerability — OpenHarmony 3.3 Low2024-07-02
CVE-2024-31071 Arkcompiler Ets Runtime has a type confusion vulnerability — OpenHarmony 3.3 Low2024-07-02
CVE-2024-20078 MediaTek 芯片 安全漏洞 — MT6768, MT6779, MT8321, MT8385, MT8755, MT8765, MT8766, MT8768, MT8771, MT8775, MT8781, MT8786, MT8788, MT8789, MT8791T, MT8792, MT8795T, MT8796, MT8797, MT8798 6.7AIMediumAI2024-07-01
CVE-2024-6100 Google Chrome 安全漏洞 — Chrome 8.8AIHighAI2024-06-19
CVE-2024-5597 Fuji Electric Monitouch V-SFT Type Confusion — Monitouch V-SFT 7.8 High2024-06-10
CVE-2024-5271 Fuji Electric Monitouch V-SFT Access of Resource Using Incompatible Type ('Type Confusion') — Monitouch V-SFT 7.8 High2024-05-30
CVE-2024-30034 Windows Cloud Files Mini Filter Driver Information Disclosure Vulnerability — Windows 10 Version 1809 5.5 Medium2024-05-14
CVE-2024-32063 Siemens Parasolid 安全漏洞 — Simcenter Femap 7.8 High2024-05-14

Vulnerabilities classified as CWE-843 (使用不兼容类型访问资源(类型混淆)) represent 348 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.