CWEweakness

CWE-1284 Improper Validation of Specified Quantity in Input

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

Description

The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.

Common consequences

• Other, Integrity, Availability: Varies by Context, DoS: Resource Consumption (CPU), Modify Memory, Read Memory — When the quantity is not properly validated, then attackers can specify malicious quantities to cause excessive resource allocation, trigger unexpected failures, enable buffer overflows, etc.

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.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2025-4037: ATM simulator does not check for negative values with deposits or withdrawals, allowing attackers to increase their balance • CVE-2025-46687: Chain: Javascript engine code does not perform a length check (CWE-1284) leading to integer overflow (CWE-190) causing allocation of smaller buffer than expected (CWE-131) resulting in a heap-based buffer overflow (CWE-122) • CVE-2019-19911: Chain: Python library does not limit the resources used to process images that specify a very large number of bands (CWE-1284), leading to excessive memory consumption (CWE-789) or an integer overflow (CWE-190). • CVE-2008-1440: lack of validation of length field leads to infinite loop • CVE-2008-2374: lack of validation of string length fields allows memory consumption or buffer over-read

Related

Observed example · CVE (5)

  • CVE-2025-4037 A vulnerability was found in code-projects ATM Banking 1.0. vulnerability
  • CVE-2025-46687 quickjs-ng through 0.9.0 has a missing length check in JS_ReadString for a string, leading to a heap-based buffer overflow. vulnerability
  • CVE-2019-19911 There is a DoS vulnerability in Pillow before 6.2.2 caused by FpxImagePlugin.py calling the range function on an unvalidated 32-bit integer… vulnerability
  • CVE-2008-2374 src/sdp.c in bluez-libs 3.30 in BlueZ, and other bluez-libs before 3.34 and bluez-utils before 3.34 versions, does not validate string… vulnerability
  • CVE-2008-1440 Microsoft Windows XP SP2 and SP3, and Server 2003 SP1 and SP2, does not properly validate the option length field in Pragmatic General… vulnerability

Can precede · CWE (1)

  • CWE-789 Memory Allocation with Excessive Size Value weakness

Child of · CWE (1)

  • CWE-20 Improper Input Validation weakness

Referenced by CVE · weakness (467)

  • CVE-2026-114349 When a broker decodes a compressed record batch, the per-record decoder reads a declared body size from the decompressed stream and… vulnerability
  • CVE-2026-103594 A stack-based buffer overflow vulnerability in Fireware OS's WireGuard configuration processing allows a remote attacker that has… vulnerability
  • CVE-2026-115906 zip is a zip library for Rust that supports reading and writing simple ZIP files. vulnerability
  • CVE-2026-116581 Seroval facilitates JavaScript value stringification, including complex structures beyond JSON.stringify capabilities. vulnerability
  • CVE-2026-115382 Wasmtime 46.0.0 before 48.0.4 and 49.0.0 before 49.0.2 contains a denial-of-service vulnerability in its wasi:http implementation that… vulnerability
  • CVE-2026-91041 Mounting an attacker-controlled FAT image with fault tolerance enabled causes an out-of-bounds heap write during log replay. vulnerability
  • CVE-2026-93475 The X.509 parser in NetX Secure accepts an RSA public key of any size, but every signature-verification path decrypts into fixed-size… vulnerability
  • CVE-2026-94024 The Module Manager's object lookup validated one byte of a memory-protected module's search name and then walked as much of it as the… vulnerability
  • CVE-2026-111828 Improper Validation of Specified Quantity in Input vulnerability in Mamunur Rashid Classified Listing classified-listing allows Accessing… vulnerability
  • CVE-2026-112112 An IPv6 FlowSpec validation bypass in the CZ.NIC BIRD Internet Routing Daemon allows an established BGP peer to inject FlowSpec rules… vulnerability
  • CVE-2026-103350 Improper Validation of Specified Quantity in Input vulnerability in Magepeople inc. vulnerability
  • CVE-2026-101952 An Improper Validation of Consistency within Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-101974 An Improper Validation of Specified Quantity in Input vulnerability in rpd of Juniper Networks Junos OS and Junos OS Evolved allows an… vulnerability
  • CVE-2026-101985 A Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS… vulnerability
  • CVE-2026-101995 An Improper Validation of Specified Quantity in Input vulnerability in the l2ald of Juniper Networks Junos OS and Junos OS Evolved allows… vulnerability
  • CVE-2026-102016 An Improper Validation of Specified Quantity in Input vulnerability in the rpd process of Juniper Networks Junos OS and Junos OS Evolved… vulnerability
  • CVE-2026-102019 An Improper Validation of Specified Quantity in Input vulnerability in the rpd process of Juniper Networks Junos OS and Junos Evolved… vulnerability
  • CVE-2026-102033 An Improper Validation of Specified Quantity in Input vulnerability in l2ald of Juniper Networks Junos OS and Junos OS Evolved allows an… vulnerability
  • CVE-2026-102065 An Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-102066 A Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-102067 An Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-102183 An Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-102184 An Improper Validation of Specified Quantity in Input vulnerability in the routing protocol daemon (rpd) of Juniper Networks Junos OS and… vulnerability
  • CVE-2026-106605 Improper Validation of Specified Quantity in Input vulnerability in WP Desk Flexible Quantity – Measurement Price Calculator for… vulnerability
  • CVE-2026-107429 Improper Validation of Specified Quantity in Input vulnerability in VideoWhisper.com Paid Videochat Turnkey Site ppv-live-webcams allows… vulnerability
  • CVE-2026-109380 modern-tar 0.3.5 through 0.8.5 contains a memory exhaustion vulnerability that allows attackers to produce negative entry sizes via… vulnerability
  • CVE-2026-103501 Heap buffer overflow in the HLL sketch deserialization of Apache DataSketches C++ (repo: datasketches-cpp). vulnerability
  • CVE-2026-107434 Subscriber Bypass Vulnerability in MicroPayments <= 3.2.9 versions. vulnerability
  • CVE-2026-107565 A flaw was found in luksmeta. vulnerability
  • CVE-2026-103351 Improper Validation of Specified Quantity in Input vulnerability in Magepeople inc. vulnerability
Show all 467 ›

Referenced by CWE · child of (2)

  • CWE-606 Unchecked Input for Loop Condition weakness
  • CWE-839 Numeric Range Comparison Without Minimum Check weakness