CWE-704 · Słabość
Incorrect Type Conversion or Cast
- Abstrakcja
- Klasa
- Status
- Niekompletny
- Dodano
- 1 lipca 2008
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The product does not correctly convert an object, resource, or structure from one type to a different type.
Skutki
Other
Other
Przykłady podatności
- 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)
Słabość nadrzędna
Słabości podrzędne
Kiedy powstaje
- Implementation
Dotyczy
C, C++, Not Language-Specific, Memory-Unsafe, Not Technology-Specific
Źródła
- Automated Source Code Reliability Measure (ASCRM) — Object Management Group (OMG), ASCRM-CWE-704, 2016
Wpis z katalogu CWE 4.20.