CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input
low-riskThe 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.
Common Consequences
Detection Methods
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.)
Real-World Examples (10)
| CVE | CVSS | EPSS | KEV |
|---|---|---|---|
| CVE-2025-3357 | 9.8 | 0.9% | — |
| CVE-2022-21821 | 7.8 | 0.5% | — |
| CVE-2022-22201 | 7.5 | 0.4% | — |
| CVE-2022-22223 | 6.5 | 0.4% | — |
| CVE-2024-23612 | 7.8 | 0.4% | — |
| CVE-2024-23609 | 7.8 | 0.4% | — |
| CVE-2020-25241 | 7.5 | 0.4% | — |
| CVE-2023-46724 | 8.6 | 0.4% | — |
| CVE-2022-36363 | 5.3 | 0.3% | — |
| CVE-2024-51564 | 7.5 | 0.1% | — |