Skip to content
OpenAdvisories

Weakness (CWE)

CWE-129: Improper Validation of Array Index

Variant Draft

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)
  1. 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).

  2. 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.

  3. 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.

  4. 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].

  5. 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].

  6. 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.

  7. 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.

  8. 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 8.8

    PostgreSQL missing validation of multibyte character length executes arbitrary code

    Missing validation of multibyte character length in PostgreSQL text manipulation allows a database user to issue crafted queries that achieve a buffer overrun. That suffices to execute arbitrary code as the operating system user running the database. Versions…

  • High 7.8

    iccDEV vulnerable to OOB in CIccXform3DLut::Apply()

    iccDEV provides a set of libraries and tools that allow for the interaction, manipulation, and application of ICC color management profiles. Prior to version 2.3.1.3, there is a vulnerability IccCmm.cpp:5793 when reading through index during ICC profile proce…

  • Medium 5.9

    cert-manager-controller DoS via Specially Crafted DNS Response

    cert-manager adds certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of obtaining, renewing and using those certificates. In versions from 1.18.0 to before 1.18.5 and from 1.19.0 to before 1.19.3, the cer…

  • Medium 4.6

    alsa-lib 1.2.15.2 Topology Decoder Heap-based Buffer Overflow

    alsa-lib versions 1.2.2 up to and including 1.2.15.2, prior to commit 5f7fe33, contain a heap-based buffer overflow in the topology mixer control decoder. The tplg_decode_control_mixer1() function reads the num_channels field from untrusted .tplg data and use…

  • Medium 5.6

    FreeRDP has a heap-buffer-overflow in urb_select_configuration

    FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.20.1, the URBDRC client does not perform bounds checking on server‑supplied MSUSB_INTERFACE_DESCRIPTOR values and uses them as indices in libusb_udev_complete_msconfig_setup, causing …

  • Medium 6.5

    Improper Validation of Array Index in Packetbeat Leading to Overflow Buffers

    Improper Validation of Array Index (CWE-129) in Packetbeat’s MongoDB protocol parser can allow an attacker to cause Overflow Buffers (CAPEC-100) through specially crafted network traffic. This requires an attacker to send a malformed payload to a monitored ne…

  • Medium 6.5

    Improper Input Validation in Metricbeat Leading to Denial of Service

    Improper Validation of Array Index (CWE-129) exists in Metricbeat can allow an attacker to cause a Denial of Service through Input Data Manipulation (CAPEC-153) via specially crafted, malformed payloads sent to the Graphite server metricset or Zookeeper serve…

  • High 7.8

    Improper Validation of Array Index in Automotive Linux OS

    Memory corruption when accessing resources in kernel driver.

  • High 8.8

    FontForge SFD File Parsing Improper Validation of Array Index Remote Code Execution Vulnerability

    FontForge SFD File Parsing Improper Validation of Array Index Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of FontForge. User interaction is required to exploit this vulner…

  • High 8.8

    FontForge SFD File Parsing Improper Validation of Array Index Remote Code Execution Vulnerability

    FontForge SFD File Parsing Improper Validation of Array Index Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of FontForge. User interaction is required to exploit this vulner…

  • High 7.5

    The free5GC UPF suffers from a lack of bounds checking on the SEID when processing PFCP Session Deletion Requests. An u…

  • High 8.0

    Taiko Alethia Pacaya inbox verification pointer corruption

    Taiko Alethia is an Ethereum-equivalent, permissionless, based rollup designed to scale Ethereum without compromising its fundamental properties. In 2.3.1 and earlier, TaikoInbox._verifyBatches (packages/protocol/contracts/layer1/based/TaikoInbox.sol:627-678)…

  • Medium 6.0

    OpenPrinting CUPS vulnerable to stack based out-of-bound write

    OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. Prior to version 2.4.15, a user in the lpadmin group can use the cups web ui to change the config and insert a malicious line. Then the cupsd process which ru…

  • High 8.8

    ALC WebCTRL Carrier i-Vu and Gen5 Controllers Array Index out-of-range

    A weakness in Automated Logic and Carrier i-Vu Gen5 router on driver version drv_gen5_106-01-2380, allows malformed packets to be sent through BACnet MS/TP network causing the devices to enter a fault state. This fault state requires a manual power cycle to r…

  • Medium 4.3

    Array index error in tls_verify_call_back() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to caus…

  • High 8.3

    vLLM vulnerable to DoS with incorrect shape of multimodal embedding inputs

    vLLM is an inference and serving engine for large language models (LLMs). From version 0.5.5 to before 0.11.1, users can crash the vLLM engine serving multimodal models by passing multimodal embedding inputs with correct ndim but incorrect shape (e.g. hidden …

  • Medium 4.3

    Rsync: Out of bounds array access via negative index

    A malicious client acting as the receiver of an rsync file transfer can trigger an out of bounds read of a heap based buffer, via a negative array index. The malicious rsync client requires at least read access to the remote rsync module in order to trigger t…

  • High 7.8

    Improper Validation of Array Index in Automotive Software platform based on QNX

    Memory corruption when triggering a subsystem crash with an out-of-range identifier.

  • High 7.8

    Improper Validation of Array Index in Audio

    Memory corruption while processing audio streaming operations.

  • Critical 9.8

    Improper Validation of Array Index in Multi-Mode Call Processor

    Memory corruption while selecting the PLMN from SOR failed list.

  • Low 3.3

    NVIDIA CUDA Toolkit for all platforms contains a vulnerability in nvdisasm where a user may cause an out-of-bounds writ…

  • High 7.8

    ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer

    In the Linux kernel, the following vulnerability has been resolved: ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer ACPICA commit 90310989a0790032f5a0140741ff09b545af4bc5 According to the ACPI specification 19.6.134, no argument is required to be passed for …

  • High 7.8

    net/mlx5: Collect command failures data only for known commands

    In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Collect command failures data only for known commands DEVX can issue a general command, which is not used by mlx5 driver. In case such command is failed, mlx5 is trying to collect t…

  • Medium 4.4

    Improper validation of an array index in the AND power Management Firmware could allow a privileged attacker to corrupt…

  • Low 3.3

    Improper validation of an array index in the AMD graphics driver software could allow an attacker to pass malformed arg…

  • Critical 9.8
    CVE-2025-57052 Public exploit

    cJSON 1.5.0 through 1.7.18 allows out-of-bounds access via the decode_array_index_from_pointer function in cJSON_Utils.…

  • High 7.8

    Improper Validation of Array Index in Bluetooth HOST

    Memory corruption while processing IOCTL command with larger buffer in Bluetooth Host.

  • High 7.8

    Improper Validation of Array Index in DSP Service

    Memory corruption while processing DDI call with invalid buffer.

  • Medium 4.2

    Improper array index verification vulnerability in the audio codec module. Impact: Successful exploitation of this vuln…

  • Medium 5.0

    Out-of-bounds array access issue due to insufficient data verification in the location service module. Impact: Successf…

  • Medium 5.4

    Out-of-bounds access vulnerability in the audio codec module. Impact: Successful exploitation of this vulnerability may…

  • High 7.1

    NVIDIA Display Driver for Windows and Linux contains a vulnerability where an attacker might cause an improper index va…

  • Medium 5.3

    Improper Validation of Array Index in Automotive Autonomy

    Memory corruption while operating the mailbox in Automotive.

  • Medium 6.8

    Apache Guacamole: Improper input validation of console codes

    The terminal emulator of Apache Guacamole 1.5.5 and older does not properly validate console codes received from servers via text-based protocols like SSH. If a malicious user has access to a text-based connection, a specially-crafted sequence of console code…

  • High 8.0

    RT-Thread lwp_syscall.c sys_thread_sigprocmask array index

    A vulnerability, which was classified as critical, has been found in RT-Thread 5.1.0. This issue affects the function sys_thread_sigprocmask of the file rt-thread/components/lwp/lwp_syscall.c. The manipulation of the argument how leads to improper validation …

  • High 8.0

    RT-Thread lwp_syscall.c sys_sigprocmask array index

    A vulnerability classified as critical has been found in RT-Thread 5.1.0. This affects the function sys_sigprocmask of the file rt-thread/components/lwp/lwp_syscall.c. The manipulation of the argument how leads to improper validation of array index.

  • High 7.7

    Fiber panics when fiber.Ctx.BodyParser parses invalid range index

    Fiber is an Express-inspired web framework written in Go. Starting in version 2.52.6 and prior to version 2.52.7, `fiber.Ctx.BodyParser` can map flat data to nested slices using `key[idx]value` syntax, but when idx is negative, it causes a panic instead of re…

  • High 7.5

    Improper Validation of Array Index in ollama/ollama

    A vulnerability in the Ollama server version 0.5.11 allows a malicious user to cause a Denial of Service (DoS) attack by customizing the manifest content and spoofing a service. This is due to improper validation of array index access when downloading a model…

  • High 7.8

    Improper Validation of Array Index in Camera Driver

    Memory corruption while acquire and update IOCTLs during IFE output resource ID validation.

  • High 7.8

    Improper Validation of Array Index in Camera Driver

    Memory corruption while prociesing command buffer buffer in OPE module.