CWE-704: Incorrect Type Conversion or Cast

ClassIncomplete

The product does not correctly convert an object, resource, or structure from one type to a different type.

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple

Applicable To

Languages
CC++Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-704: Incorrect Type Conversion or Cast?+

CWE-704: Incorrect Type Conversion or Cast is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product does not correctly convert an object, resource, or structure from one type to a different type.

What are the security consequences of Incorrect Type Conversion or Cast?+

If exploited, CWE-704 (Incorrect Type Conversion or Cast) it can compromise Other, leading to outcomes such as Other.

Which programming languages are affected by Incorrect Type Conversion or Cast?+

CWE-704 commonly affects C, C++ and Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Incorrect Type Conversion or Cast?+

MITRE documents real CVEs mapped to CWE-704, including CVE-2021-43537 and CVE-2022-3979. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-704 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More

CWE-704: Incorrect Type Conversion or Cast | CWE Lookup | InventiveHQ