CWEweakness

CWE-704 Incorrect Type Conversion or Cast

Official page ↗
Abstraction
Class
Structure
Simple
Status
Incomplete
Languages
C, C++, Memory-Unsafe, Not Language-Specific
CWE version
5.0

Description

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

Common consequences

• Other: Other

Detection methods

• Fuzzing: Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.

Observed examples

• 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)

Related

Observed example · CVE (2)

  • CVE-2022-3979 A vulnerability was found in NagVis up to 1.9.33 and classified as problematic. vulnerability
  • CVE-2021-43537 An incorrect type conversion of sizes from 64bit to 32bit integers allowed an attacker to corrupt memory leading to a potentially… vulnerability

Child of · CWE (1)

  • CWE-1474 Non-Equivalent Data Transformation weakness

Referenced by CVE · weakness (290)

  • CVE-2026-110816 ### Summary `qs.stringify` with `arrayFormat: 'comma'` throws `TypeError: Cannot convert object to primitive value` when an array element… vulnerability
  • CVE-2026-104634 Incorrect Type Conversion or Cast vulnerability in BeamMCP.Server in ScriptKittyOS beam_mcp allows an MCP client's JSON true, false and… vulnerability
  • CVE-2026-105754 vLLM is an inference and serving engine for large language models. vulnerability
  • CVE-2026-104420 Zebra before 6.3.0 contains a protection mechanism failure that allows unauthenticated peers to evade misbehavior scoring by supplying… vulnerability
  • CVE-2026-20249 A vulnerability in the certification authentication feature of Internet Key Exchange version 2 (IKEv2) for Cisco Secure Firewall… vulnerability
  • CVE-2026-86348 Mattermost versions <=11.9 11.0.9 11.4.8 11.7.7 10.22.11.0 fail to recover from handler panics, which allows an authenticated user to crash… vulnerability
  • CVE-2026-87546 Incorrect type conversion or cast in Safebrowsing in Google Chrome on on Mac prior to 153.0.8010.36 allowed a remote attacker to bypass… vulnerability
  • CVE-2026-28609 In read of MatroskaExtractor.cpp, there is a possible out-of-bounds write due to improper casting. vulnerability
  • CVE-2026-58822 In multiple functions of ftsmooth.c, there is a possible memory safety issue due to improper casting. vulnerability
  • CVE-2026-69585 Incorrect type conversion or cast in Microsoft Windows Search Component allows an authorized attacker to elevate privileges locally. vulnerability
  • CVE-2026-50278 iccDEV provides a set of libraries and tools for working with ICC color management profiles. vulnerability
  • CVE-2026-10080 Mattermost versions 11.7.x <= 11.7.6, 10.11.x <= 10.11.21, 11.8.x <= 11.8.3 fails to validate WebSocket command field types which allows an… vulnerability
  • CVE-2026-15826 The User Profile Builder plugin for WordPress is vulnerable to Authentication Bypass via Type Confusion in versions up to, and including,… vulnerability
  • CVE-2026-53798 rsync before 3.5.0 contains a privilege confusion vulnerability in the name-converter subprocess uid/gid mapping that allows local… vulnerability
  • CVE-2026-18675 The dataplane token validator in kuma-cp performs an unchecked Go type assertion on the JWT kid header. vulnerability
  • CVE-2026-73429 Russh is a Rust SSH client & server library. vulnerability
  • CVE-2026-6726 An information leakage vulnerability was reported in the TCG TPM 2.0 reference code that could allow a local attacker with elevated… vulnerability
  • CVE-2025-51678 An issue was discovered in RISC-V PicoRV32 commit 87c89a. vulnerability
  • CVE-2026-50337 Incorrect type conversion or cast in Windows Notification allows an authorized attacker to elevate privileges locally. vulnerability
  • CVE-2026-59871 node-tar is a tar archive manipulation library for Node.js. vulnerability
  • CVE-2026-55076 Coder allows organizations to provision remote development environments via Terraform. vulnerability
  • CVE-2026-48140 There is an unchecked enum cast vulnerability in NI grpc-device BeginSidebandStream that may allow an attacker to trigger invalid enum… vulnerability
  • CVE-2026-46690 unbounded_spsc is an "unbounded" extension of bounded_spsc_queue. vulnerability
  • CVE-2026-45685 OpenTelemetry eBPF Instrumentation provides eBPF instrumentation based on the OpenTelemetry standard. vulnerability
  • CVE-2026-44324 free5GC is an open-source implementation of the 5G core network. vulnerability
  • CVE-2026-46597 An incorrectly placed cast from bytes to int allowed for server-side panic in the AES-GCM packet decoder for well-crafted inputs. vulnerability
  • CVE-2023-7345 Ledger Live with vulnerable versions of ledgerhq/hw-app-eth prior to 6.34.7 contains an integer parsing vulnerability that allows attackers… vulnerability
  • CVE-2026-44223 vLLM is an inference and serving engine for large language models (LLMs). vulnerability
  • CVE-2026-42576 apko allows users to build and publish OCI container images built from apk packages. vulnerability
  • CVE-2026-40613 Coturn is a free open source implementation of TURN and STUN Server. vulnerability
Show all 290 ›

Referenced by CWE · child of (4)

  • CWE-1389 Incorrect Parsing of Numbers with Different Radices weakness
  • CWE-588 Attempt to Access Child of a Non-structure Pointer weakness
  • CWE-681 Incorrect Conversion between Numeric Types weakness
  • CWE-843 Access of Resource Using Incompatible Type weakness

Referenced by CWE · has member (2)

  • CWE-1003 Weaknesses for Simplified Mapping of Published Vulnerabilities view
  • CWE-1340 CISQ Data Protection Measures view