# CVE-2024-24563: Vyper array negative index vulnerability

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.24% (percentile 69, 2026-11-26)
- **CWE:** CWE-129
- **Aliases:** GHSA-52xq-j7v9-v4v2, PYSEC-2024-150
- **Published:** 2024-02-07T17:10:08.385Z
- **Modified:** 2026-09-10T03:50:09.790Z

## Who should check

- Projects that depend on PyPI package vyper (\< 0.4.0)
- Anyone running vyperlang vyper \<= 0.3.10

## Description

Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. Arrays can be keyed by a signed integer, while they are defined for unsigned integers only. The typechecker doesn't throw when spotting the usage of an \`int\` as an index for an array. The typechecker allows the usage of signed integers to be used as indexes to arrays. The vulnerability is present in different forms in all versions, including \`0.3.10\`. For ints, the 2's complement representation is used. Because the array was declared very large, the bounds checking will pass Negative values will simply be represented as very large numbers. As of time of publication, a fixed version does not exist.

There are three potential vulnerability classes: unpredictable behavior, accessing inaccessible elements and denial of service. Class 1: If it is possible to index an array with a negative integer without reverting, this is most likely not anticipated by the developer and such accesses can cause unpredictable behavior for the contract. Class 2: If a contract has an invariant in the form \`assert index \< x\`, the developer will suppose that no elements on indexes \`y \| y \>= x\` are accessible. However, by using negative indexes, this can be bypassed. Class 3: If the index is dependent on the state of the contract, this poses a risk of denial of service. If the state of the contract can be manipulated in such way that the index will be forced to be negative, the array access can always revert (because most likely the array won't be declared extremely large). However, all these the scenarios are highly unlikely. Most likely behavior is a revert on the bounds check.

## Affected and fixed versions

- PyPI `vyper`: affected \< 0.4.0; fixed 0.4.0, 0.4.0b1 (osv)
- vyperlang vyper: \<= 0.3.10 (cvelist)

## Mitigation

- Upgrade vyper to one of 0.4.0, 0.4.0b1 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-24563. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-24563.md
Affected: vyper < 0.4.0
Fixed in: 0.4.0, 0.4.0b1

Steps:
1. Search this machine and project for vyper (PyPI), vyperlang vyper: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-24563 being exploited?

There is no confirmed exploitation: CVE-2024-24563 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.24% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-24563?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-24563?

vyper \< 0.4.0.

### Is there a fix for CVE-2024-24563?

Yes. Fixed in 0.4.0, 0.4.0b1. Upgrade vyper to one of 0.4.0, 0.4.0b1 (or later in the same release line).

### How do I check if I'm affected by CVE-2024-24563?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/vyperlang/vyper/security/advisories/GHSA-52xq-j7v9-v4v2>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-24563>
- other: <https://github.com/vyperlang/vyper/blob/a1fd228cb9936c3e4bbca6f3ee3fb4426ef45490/vyper/codegen/core.py#L534-L541>
- other: <https://github.com/vyperlang/vyper/blob/c150fc49ee9375a930d177044559b83cb95f7963/vyper/semantics/types/subscriptable.py#L127-L137>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-150.yaml>
- other: <https://github.com/vyperlang/vyper>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-24563>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-52xq-j7v9-v4v2> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2024-150> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-24563> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-24563>
