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

Goal: 1000 CNY · Raised: 1359 CNY

100%

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

538 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, 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.
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 ID Title CVSS Severity Published
CVE-2024-20662 Windows Online Certificate Status Protocol (OCSP) Information Disclosure Vulnerability — Windows Server 2019 4.9 Medium 2024-01-09
CVE-2023-51428 Honor Magic Ui 安全漏洞 — Magic OS 4.6 Medium 2023-12-29
CVE-2023-51427 Honor Magic UI 安全漏洞 — Magic OS 4.6 Medium 2023-12-29
CVE-2023-51426 Honor Magic UI 安全漏洞 — Magic OS 4.6 Medium 2023-12-29
CVE-2023-41257 Foxit Reader 安全漏洞 — Foxit Reader 8.8 High 2023-11-27
CVE-2023-6045 Arkruntime has a type confusion vulnerability — OpenHarmony 5.9 Medium 2023-11-20
CVE-2023-46705 Arkruntime has a type confusion vulnerability — OpenHarmony 6.2 Medium 2023-11-20
CVE-2023-36017 Windows Scripting Engine Memory Corruption Vulnerability — Windows 10 Version 1809 8.8 High 2023-11-14
CVE-2023-38128 JustSystems Ichitaro 缓冲区错误漏洞 — Ichitaro 2023 7.8 High 2023-10-19
CVE-2023-44108 Huawei HarmonyOS 安全漏洞 — HarmonyOS 7.5 - 2023-10-11
CVE-2023-44094 Huawei HarmonyOS 安全漏洞 — HarmonyOS 7.5 - 2023-10-11
CVE-2023-36578 Microsoft Message Queuing (MSMQ) Remote Code Execution Vulnerability — Windows 10 Version 1809 7.3 High 2023-10-10
CVE-2023-36594 Windows Graphics Component Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High 2023-10-10
CVE-2023-38074 Siemens JT2GO 安全漏洞 — JT2Go 7.8 High 2023-09-12
CVE-2023-38073 Siemens JT2GO 安全漏洞 — JT2Go 7.8 High 2023-09-12
CVE-2023-4194 Kernel: tap: tap_open(): correctly initialize socket uid next fix of i_uid to current_fsuid — Red Hat Enterprise Linux 9 5.5 Medium 2023-08-07
CVE-2023-28729 Panasonic Control FPWIN Pro 安全漏洞 — Control FPWIN Pro 7.8 High 2023-07-21
CVE-2023-34967 Samba: type confusion in mdssvc rpc service for spotlight — Red Hat Enterprise Linux 8 5.3 Medium 2023-07-20
CVE-2023-32664 Foxit Reader 安全漏洞 — Foxit Reader 8.8 High 2023-07-19
CVE-2023-35297 Windows Pragmatic General Multicast (PGM) Remote Code Execution Vulnerability — Windows 10 Version 1809 8.1 High 2023-07-11
CVE-2023-35356 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High 2023-07-11
CVE-2023-37376 Siemens Tecnomatix Plant Simulation 安全漏洞 — Tecnomatix Plant Simulation V2201 7.8 High 2023-07-11
CVE-2023-2234 BT HCI host union variant confusion — Zephyr 6.8 Medium 2023-07-10
CVE-2022-48511 Huawei HarmonyOS 资源管理错误漏洞 — HarmonyOS 7.5 - 2023-07-06
CVE-2023-3022 Linux kernel 安全漏洞 — Linux Kernel (IPv6) 5.5 - 2023-06-19
CVE-2023-24944 Windows Bluetooth Driver Information Disclosure Vulnerability — Windows 10 Version 1809 6.5 Medium 2023-05-09
CVE-2023-28243 Microsoft PostScript and PCL6 Class Printer Driver Remote Code Execution Vulnerability — Windows 10 Version 1809 8.8 High 2023-04-11
CVE-2023-24929 Microsoft PostScript and PCL6 Class Printer Driver Remote Code Execution Vulnerability — Windows 10 Version 1809 8.8 High 2023-04-11
CVE-2023-24885 Microsoft PostScript and PCL6 Class Printer Driver Remote Code Execution Vulnerability — Windows 10 Version 1809 8.8 High 2023-04-11
CVE-2023-24927 Microsoft PostScript and PCL6 Class Printer Driver Remote Code Execution Vulnerability — Windows 10 Version 1809 8.8 High 2023-04-11

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