CWE Database
/

CWE-704

Back to CWE list

CWE-704

Incorrect Type Conversion or Cast

Class
Incomplete

Description

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

Common Consequences

Scope

Other

Impact

Other

CVE-2021-43537

Chain: in a web browser, an unsigned 64-bit integer is forcibly cast to a 32-bit integer (CWE-681) and potentially leading to an integer overflow (CWE-190). If an integer overflow occurs, this can cause heap memory corruption (CWE-122)

CVE-2022-3979

Chain: data visualization program written in PHP uses the "!=" operator instead of the type-strict "!==" operator (CWE-480) when validating hash values, potentially leading to an incorrect type conversion (CWE-704)

Applicable Platforms

C
C++
Not Language-Specific
Memory-Unsafe

Security Training

Train your team to recognize and prevent security threats with our comprehensive security awareness program.

Start Training

Vulnerability Scanning

Discover vulnerabilities in your applications and infrastructure before attackers do.

Scan Now