CWEweakness
CWE-1285 Improper Validation of Specified Index, Position, or Offset in Input
- Abstraction
- Base
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product receives input that is expected to specify an index, position, or offset into an indexable resource such as a buffer or file, but it does not validate or incorrectly validates that the specified index/position/offset has the required properties.
Extended description
Often, indexable resources such as memory buffers or files can be accessed using a specific position, index, or offset, such as an index for an array or a position for a file. When untrusted input is not properly validated before it is used as an index, attackers could access (or attempt to access) unauthorized portions of these resources. This could be used to cause buffer overflows, excessive resource allocation, or trigger unexpected failures.
Common consequences
• Other: Varies by Context
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-2005-0369: large ID in packet used as array index
• CVE-2001-1009: negative array index as argument to POP LIST command
Related
Observed example · CVE (2)
- CVE-2005-0369 Armagetron 0.2.6.0 and earlier and Armagetron Advanced 0.2.7.0 earlier allows remote attackers to cause a denial of service (application… vulnerability
- CVE-2001-1009 Fetchmail (aka fetchmail-ssl) before 5.8.17 allows a remote malicious (1) IMAP server or (2) POP/POP3 server to overwrite arbitrary memory… vulnerability
Child of · CWE (1)
- CWE-20 Improper Input Validation weakness
Referenced by CVE · weakness (67)
- CVE-2026-89410 In Z-Wave SDK 8.1.1 and earlier, a malformed NCP SPI command can trigger out-of-bounds reads that leak sensitive information. vulnerability
- CVE-2026-96582 A HID report descriptor is a sequence of items, each declaring in its header how many data bytes follow. vulnerability
- CVE-2026-111555 A flaw was found in luksmeta. vulnerability
- CVE-2026-110736 Godot Engine through 4.7.2 has an out-of-bounds read in the optimized translation loader (core/string/optimized_translation.cpp,… vulnerability
- CVE-2026-107821 MariaDB server is a community developed fork of MySQL server. vulnerability
- CVE-2026-20524 In apu, there is a possible memory corruption due to improper input validation. vulnerability
- CVE-2026-31912 libpcap BPF interpreter detects neither reaching the end of the filter program buffer due to lack of a return instruction nor executing a… vulnerability
- CVE-2026-53530 RaTeX is a KaTeX-compatible math rendering engine written in Rust. vulnerability
- CVE-2026-14479 A maliciously crafted input, when processed by the Autodesk Installer IPC frame parser, may trigger improper validation of an… vulnerability
- CVE-2026-18485 There is a local privilege escalation vulnerability recently discovered in the NI-PAL kernel driver. vulnerability
- CVE-2026-12681 Improper Validation of Specified Index, Position, or Offset in Input vulnerability in Google go-attestation. vulnerability
- CVE-2026-8036 Improper input validation in NI-PAL may allow a local authenticated user to access arbitrary system memory, potentially leading to… vulnerability
- CVE-2026-45352 cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. vulnerability
- CVE-2026-9100 The MongoDB C Driver's legacy GridFS API accepts malformed file metadata from the database without adequate validation. vulnerability
- CVE-2026-44004 vm2 is an open source vm/sandbox for Node.js. vulnerability
- CVE-2026-43868 Memory Allocation with Excessive Size Value vulnerability in Apache Thrift. vulnerability
- CVE-2026-40886 Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. vulnerability
- CVE-2026-33557 A possible security vulnerability has been identified in Apache Kafka. vulnerability
- CVE-2018-25232 Softros LAN Messenger 9.2 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an… vulnerability
- CVE-2026-32285 The Delete function fails to properly validate offsets when processing malformed JSON input. vulnerability
- CVE-2026-32286 The DataRow.Decode function fails to properly validate field lengths. vulnerability
- CVE-2019-25622 Paint Studio 2.17 contains a denial of service vulnerability that allows local attackers to crash the application by providing malformed… vulnerability
- CVE-2019-25625 Blob Studio 2.17 contains a denial of service vulnerability that allows local attackers to crash the application by providing malformed… vulnerability
- CVE-2019-25593 jetCast Server 2.0 contains a denial of service vulnerability that allows local attackers to crash the application by supplying an… vulnerability
- CVE-2025-2399 Improper Validation of Specified Index, Position, or Offset in Input vulnerability in Mitsubishi Electric CNC M800V Series M800VW and… vulnerability
- CVE-2026-20440 In MAE, there is a possible out of bounds write due to a missing bounds check. vulnerability
- CVE-2026-2006 Missing validation of multibyte character length in PostgreSQL text manipulation allows a database user to issue crafted queries that… vulnerability
- CVE-2026-20413 In imgsys, there is a possible out of bounds write due to a missing bounds check. vulnerability
- CVE-2025-20796 In imgsys, there is a possible out of bounds write due to improper input validation. vulnerability
- CVE-2025-67268 gpsd before commit dc966aa contains a heap-based out-of-bounds write vulnerability in the drivers/driver_nmea2000.c file. vulnerability