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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-704 (不正确的类型转换) — Vulnerability Class 53

53 vulnerabilities classified as CWE-704 (不正确的类型转换). AI Chinese analysis included.

CWE-704 represents a critical software weakness where an application fails to properly convert or cast data between different types, leading to unpredictable behavior or security vulnerabilities. This flaw is typically exploited by attackers who manipulate input data to trigger unintended type conversions, potentially causing buffer overflows, logic errors, or privilege escalation. For instance, forcing a string to be interpreted as an integer might bypass validation checks or corrupt memory structures. To mitigate this risk, developers must implement rigorous input validation and explicitly define type boundaries during conversion processes. Utilizing strongly typed languages and avoiding implicit casts can significantly reduce exposure. Additionally, employing static analysis tools to detect unsafe type operations and conducting thorough code reviews ensures that all conversions are handled safely, preserving data integrity and preventing exploitation of these logical flaws.

MITRE CWE Description
The product does not correctly convert an object, resource, or structure from one type to a different type.
Common Consequences (1)
OtherOther
Examples (2)
In this example, depending on the return value of accecssmainframe(), the variable amount can hold a negative value when it is returned. Because the function is declared to return an unsigned value, amount will be implicitly cast to an unsigned number.
unsigned int readdata () { int amount = 0; ... amount = accessmainframe(); ... return amount; }
Bad · C
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
CVE IDTitleCVSSSeverityPublished
CVE-2023-21638 Incorrect Type Conversion or Cast in Video — Snapdragon 6.7 Medium2023-07-04
CVE-2022-33240 Incorrect type conversion or cast in Audio — Snapdragon 6.7 Medium2023-06-06
CVE-2023-21665 Incorrect Type Conversion or Cast in Graphics — Snapdragon 8.4 High2023-05-02
CVE-2022-33301 Incorrect type conversion or cast in Audio — Snapdragon 6.7 Medium2023-04-04
CVE-2022-40531 Incorrect type conversion in WLAN — Snapdragon 8.4 High2023-03-07
CVE-2022-41911 Invalid char to bool conversion when printing a tensor in Tensorflow — tensorflow 4.8 Medium2022-11-18
CVE-2022-41890 `CHECK` fail in `BCast` overflow in Tensorflow — tensorflow 4.8 Medium2022-11-18
CVE-2022-3979 NagVis CoreLogonMultisite.php checkAuthCookie type conversion — NagVis 5.6 Medium2022-11-13
CVE-2022-41668 Schneider Electric EcoStruxure Operator Terminal Expert 代码问题漏洞 — EcoStruxure Operator Terminal Expert 7.0 High2022-11-04
CVE-2021-3578 Sourceforge mbsync 代码问题漏洞 — isync 7.8 -2022-02-16
CVE-2021-39173 Forced reinstall — Cachet 8.8 High2021-08-27
CVE-2020-16103 Gallagher Group Command Centre 代码问题漏洞 — Command Centre 8.8 High2020-12-14
CVE-2020-6151 Accusoft ImageGear 代码问题漏洞 — Accusoft 8.8 -2020-09-01
CVE-2019-12693 Cisco Adaptive Security Appliance Software Secure Copy Denial of Service Vulnerability — Cisco Adaptive Security Appliance (ASA) Software 4.9 -2019-10-02
CVE-2018-17913 Omron CX-Supervisor 安全漏洞 — CX-Supervisor 7.3 -2018-11-05
CVE-2018-9943 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9942 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9941 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9940 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9939 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9938 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9937 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17
CVE-2018-9936 Foxit Reader 安全漏洞 — Foxit Reader 8.8 -2018-05-17

Vulnerabilities classified as CWE-704 (不正确的类型转换) represent 53 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.