CWEweakness

CWE-241 Improper Handling of Unexpected Data Type

Official page ↗
Abstraction
Base
Structure
Simple
Status
Draft
Languages
Not Language-Specific
CWE version
5.0

Description

The product does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).

Common consequences

• Integrity, Other: Varies by Context, Unexpected State

Potential mitigations

• [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. • [Implementation] Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

Observed examples

• CVE-1999-1156: FTP server crash via PORT command with non-numeric character. • CVE-2004-0270: Anti-virus product has an assertion error when the line length is non-numeric.

Related

Attack pattern · CAPEC (1)

  • CAPEC-48 Passing Local Filenames to Functions That Expect a URL attack pattern

Observed example · CVE (2)

  • CVE-2004-0270 libclamav in Clam AntiVirus 0.65 allows remote attackers to cause a denial of service (crash) via a uuencoded e-mail message with an… vulnerability
  • CVE-1999-1156 BisonWare FTP Server 4.1 and earlier allows remote attackers to cause a denial of service via a malformed PORT command that contains a… vulnerability

Child of · CWE (1)

  • CWE-228 Improper Handling of Syntactically Invalid Structure weakness

Referenced by CAPEC · weakness (1)

  • CAPEC-48 Passing Local Filenames to Functions That Expect a URL attack pattern

Referenced by CVE · weakness (35)

  • CVE-2026-14916 A JWT signature verification vulnerability affects Kong components that perform JWT validation for MCP OAuth2 or DataKit integrations… vulnerability
  • CVE-2026-73785 A potential security vulnerability in HPE IceWall Federation Agent and Proxy could allow a remote unauthenticated attacker to cause a… vulnerability
  • CVE-2026-47110 Tiptap for PHP before version 2.1.1 contains an input validation vulnerability that allows authenticated attackers to cause a denial of… vulnerability
  • CVE-2025-63548 An issue in Eprosima Micro-XREC-DDS Agent v.3.0.1 allows a remote attacker to cause a denial of service via a packet specially crafted to… vulnerability
  • CVE-2025-66550 Nextcloud Calendar is a calendar app for Nextcloud. vulnerability
  • CVE-2024-21927 Improper input validation in Satellite Management Controller (SMC) may allow an attacker with privileges to use certain special characters… vulnerability
  • CVE-2024-21935 Improper input validation in Satellite Management Controller (SMC) may allow an attacker with privileges to manipulate Redfish® API… vulnerability
  • CVE-2025-7339 on-headers is a node.js middleware for listening to when a response writes headers. vulnerability
  • CVE-2025-2268 The HP LaserJet MFP M232-M237 Printer Series may be vulnerable to a denial of service attack when a specially crafted request message is… vulnerability
  • CVE-2025-1004 Certain HP LaserJet Pro printers may potentially experience a denial of service when a user sends a raw JPEG file to the printer via IPP… vulnerability
  • CVE-2024-9423 Certain HP LaserJet printers may potentially experience a denial of service when a user sends a raw JPEG file to the printer. vulnerability
  • CVE-2024-21523 All versions of the package images are vulnerable to Denial of Service (DoS) due to providing unexpected input types to several different… vulnerability
  • CVE-2024-21526 All versions of the package speaker are vulnerable to Denial of Service (DoS) when providing unexpected input types to the channels… vulnerability
  • CVE-2024-37316 Nextcloud Calendar is a calendar app for Nextcloud. vulnerability
  • CVE-2024-25966 Dell PowerScale OneFS versions 8.2.x through 9.7.0.2 contains an improper handling of unexpected data type vulnerability. vulnerability
  • CVE-2024-32268 An issue in Tuya Smart camera U6N v.3.2.5 allows a remote attacker to cause a denial of service via a crafted packet to the network… vulnerability
  • CVE-2024-0151 Insufficient argument checking in Secure state Entry functions in software using Cortex-M Security Extensions (CMSE), that has been… vulnerability
  • CVE-2023-30591 Denial-of-service in NodeBB <= v2.8.10 allows unauthenticated attackers to trigger a crash, when invoking `eventName.startsWith()` or… vulnerability
  • CVE-2023-5215 A flaw was found in libnbd. vulnerability
  • CVE-2023-28961 An Improper Handling of Unexpected Data Type vulnerability in IPv6 firewall filter processing of Juniper Networks Junos OS on the ACX… vulnerability
  • CVE-2022-22219 Due to the Improper Handling of an Unexpected Data Type in the processing of EVPN routes on Juniper Networks Junos OS and Junos OS Evolved,… vulnerability
  • CVE-2022-39064 An attacker sending a single malformed IEEE 802.15.4 (Zigbee) frame makes the TRÅDFRI bulb blink, and if they replay (i.e. vulnerability
  • CVE-2022-39065 A single malformed IEEE 802.15.4 (Zigbee) frame makes the TRÅDFRI gateway unresponsive, such that connected lighting cannot be controlled… vulnerability
  • CVE-2022-3029 In NLnet Labs Routinator 0.9.0 up to and including 0.11.2, due to a mistake in error handling, data in RRDP snapshot and delta files that… vulnerability
  • CVE-2022-1642 A program using swift-corelibs-foundation is vulnerable to a denial of service attack caused by a potentially malicious source producing a… vulnerability
  • CVE-2022-29181 Nokogiri is an open source XML and HTML library for Ruby. vulnerability
  • CVE-2022-20730 A vulnerability in the Security Intelligence feed feature of Cisco Firepower Threat Defense (FTD) Software could allow an unauthenticated,… vulnerability
  • CVE-2022-22193 An Improper Handling of Unexpected Data Type vulnerability in the Routing Protocol Daemon (rpd) of Juniper Networks Junos OS and Junos OS… vulnerability
  • CVE-2022-24668 A program using swift-nio-http2 is vulnerable to a denial of service attack caused by a network peer sending ALTSVC or ORIGIN frames. vulnerability
  • CVE-2021-40116 Multiple Cisco products are affected by a vulnerability in Snort rules that could allow an unauthenticated, remote attacker to cause a… vulnerability
Show all 35 ›