Weakness (CWE)
CWE-129: Improper Validation of Array Index
The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.
How to prevent it (8 mitigations)
-
Architecture and Design
Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).
-
Architecture and Design
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Even though client-side checks provide minimal benefits with respect to server-side security, they are still useful. First, they can support intrusion detection. If the server receives input that should have been rejected by the client, then it may be an indication of an attack. Second, client-side error-checking can provide helpful feedback to the user about the expectations for valid input. Third, there may be a reduction in server-side processing time for accidental input errors, although this is typically a small savings.
-
Requirements
Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
For example, Ada allows the programmer to constrain the values of a variable and languages such as Java and Ruby will allow the programmer to handle exceptions when an out-of-bounds index is accessed.
-
Operation, Build and Compilation
Run or compile the software using features or extensions that randomly arrange the positions of a program's executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.
Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as "rebasing" (for Windows) and "prelinking" (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.
For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].
-
Operation
Use a CPU and operating system that offers Data Execution Protection (using hardware NX or XD bits) or the equivalent techniques that simulate this feature in software, such as PaX [REF-60] [REF-61]. These techniques ensure that any instruction executed is exclusively at a memory address that is part of the code segment.
For more information on these techniques see D3-PSEP (Process Segment Execution Prevention) from D3FEND [REF-1336].
-
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.
When accessing a user-controlled array index, use a stringent range of values that are within the target array. Make sure that you do not allow negative values to be used. That is, verify the minimum as well as the maximum of the range of acceptable values.
-
Implementation
Be especially careful to validate all input when invoking code that crosses language boundaries, such as from an interpreted language to native code. This could create an unexpected interaction between the language boundaries. Ensure that you are not violating any of the expectations of the language with which you are interfacing. For example, even though Java may not be susceptible to buffer overflows, providing a large argument in a call to native code might trigger an overflow.
-
Architecture and Design, Operation
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Source: MITRE CWE-129
402 results · Feed
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN HAL while parsing WMI command parameters.
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN HAL while handling command through WMI interfaces.
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN HAL while handling command streams through WMI interfaces.
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN handler while processing PhyID in Tx status handler.
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN HAL while processing command parameters from untrusted WMI payload.
-
High 7.8
Improper Validation of Array Index in WLAN HAL
Memory corruption in WLAN HAL while processing Tx/Rx commands from QDART.
-
Medium 6.7
Improper Validation of Array Index in Linux
Memory Corruption due to improper validation of array index in Linux while updating adn record.
-
High 8.4
Improper Validation of Array Index in Audio
Memory corruption due to improper validation of array index in Audio.
-
High 8.4
Improper validation of array index in WLAN HAL
Memory corruption due to improper validation of array index in WLAN HAL when received lm_itemNum is out of range.
-
Low —CVE-2023-36308 Public exploit
Crash when processing crafted TIFF files
disintegration Imaging 1.6.2 allows attackers to cause a panic (because of an integer index out of range during a Grayscale call) via a crafted TIFF file to the scan function of scanner.go. NOTE: it is unclear whether there are common use cases in which this …
-
Medium 5.5
Index out of bounds leading to crash
ZPLGFA 1.1.1 allows attackers to cause a panic (because of an integer index out of range during a ConvertToGraphicField call) via an image of zero width. NOTE: it is unclear whether there are common use cases in which this panic could have any security conseq…
-
High 8.8CVE-2022-48503 Exploited
The issue was addressed with improved bounds checks. This issue is fixed in tvOS 15.6, watchOS 8.7, iOS 15.6 and iPadOS…
KEV Oct 20, 2025 -
Medium 6.7
Improper Validation of Array Index in GPS HLOS Driver
Memory Corruption in GPS HLOS Driver when injectFdclData receives data with invalid data length.
-
Medium 5.9
Duktape 2.6 bug crashes JavaScript putting too many values in valstack.
Duktape is an 3rd-party embeddable JavaScript engine, with a focus on portability and compact footprint. When adding too many values in valstack JavaScript will crash. This issue occurs due to bug in Duktape 2.6 which is an 3rd-party solution that we use.
-
High 7.0
A CWE-129: Improper Validation of Array Index vulnerability exists that could cause local denial-of-service, and potent…
-
High 7.8
Array Index UnderFlow in Calc Formula Parsing
Improper Validation of Array Index vulnerability in the spreadsheet component of The Document Foundation LibreOffice allows an attacker to craft a spreadsheet document that will cause an array index underflow when loaded. In the affected versions of LibreOffi…
-
Medium 6.7
Improper validation of array index in computer vision.
Memory corruption due to improper validation of array index in computer vision while testing EVA kernel without sending any frames.
-
Critical 9.8
A CWE-129: Improper validation of an array index vulnerability exists where a specially crafted Ethernet request could …
-
High 8.2CVE-2023-2008 Public exploit
Kernel: udmabuf: improper validation of array index leading to local privilege escalation
A flaw was found in the Linux kernel's udmabuf device driver, within a fault handler. This issue occurs due to the lack of proper validation of user-supplied data, which can result in memory access past the end of an array. This may allow an attacker to escal…
-
Critical 9.8
Certain Lexmark devices through 2023-02-19 have Improper Validation of an Array Index.
-
Medium 6.8
Improper validation of array index in User Identity Module
Memory corruption due to improper validation of array index in User Identity Module when APN TLV length is greater than command length.
-
Medium 6.8
Improper validation of array index in Modem
Memory corruption occurs in Modem due to improper validation of array index when malformed APDU is sent from card.
-
Medium 6.5
ADMesh improper array index validation
An improper array index validation vulnerability exists in the stl_fix_normal_directions functionality of ADMesh Master Commit 767a105 and v0.98.4. A specially-crafted stl file can lead to a heap buffer overflow. An attacker can provide a malicious file to tr…
-
High 8.6
Cisco IOS and IOS XE Software IPv6 DHCP (DHCPv6) Relay and Server Denial of Service Vulnerability
A vulnerability in the IPv6 DHCP version 6 (DHCPv6) relay and server features of Cisco IOS and IOS XE Software could allow an unauthenticated, remote attacker to trigger a denial of service (DoS) condition. This vulnerability is due to insufficient validation…
-
High 7.3
Improper Validation of Array Index in Bluetooth HOST
Memory corruption in Bluetooth HOST while processing the AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT AVRCP response.
-
Critical 9.8
Improper validation of array index in Multi-mode call processor
Memory corruption due to improper validation of array index in Multi-mode call processor.
-
Medium 6.7
In usb, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of p…
-
Critical 9.8CVE-2023-0755 EPSS 12%
The affected products are vulnerable to an improper validation of array index, which could allow an attacker to crash t…
-
Medium 4.0
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 5.5
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 4.0
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 5.5
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 5.5
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 5.5
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
Medium 5.5
In engineermode services, there is a missing permission check. This could lead to local denial of service in engineermo…
-
High 7.5
Junos OS: SRX 5000 Series: Upon processing of a specific SIP packet an FPC can crash
An Improper Validation of Array Index vulnerability in the SIP ALG of Juniper Networks Junos OS on SRX 5000 Series allows a network-based, unauthenticated attacker to cause a Denial of Service (DoS). When an attacker sends an SIP packets with a malformed SDP …
-
High 7.5
Junos OS and Junos OS Evolved: PTX10008, PTX10016: When a specific SNMP MIB is queried the FPC will crash
An Improper Validation of Array Index vulnerability in the Advanced Forwarding Toolkit Manager daemon (aftmand) of Juniper Networks Junos OS and Junos OS Evolved allows an unauthenticated, network-based attacker to cause a Denial of Service (DoS). On the PTX1…
-
High 8.4
Improper validation of array index in Android Core
Memory corruption in android core due to improper validation of array index while returning feature ids after license authentication.
-
Medium 4.3
If array shift operations are not used, the Garbage Collector may have become confused about valid objects. This vulner…
-
High 7.8
Altair HyperView Player versions 2021.1.0.27 and prior are vulnerable to improper validation of array index vulnerabili…