CVE-2024-32481
CVE-2024-32481 is a medium-severity vulnerability in Vyperlang Vyper with a CVSS 3.x base score of 5.3. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-681.
Key facts
- Severity: Medium (CVSS 3.x base score 5.3)
- EPSS exploit prediction: 1% (52nd percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2024-1269
- Weakness: CWE-681
- Affected product: Vyperlang Vyper
- Published:
- Last modified:
Description
Vyper is a pythonic Smart Contract Language for the Ethereum virtual machine. Starting in version 0.3.8 and prior to version 0.4.0b1, when looping over a `range` of the form `range(start, start + N)`, if `start` is negative, the execution will always revert. This issue is caused by an incorrect assertion inserted by the code generation of the range `stmt.parse_For_range()`. The issue arises when `start` is signed, instead of using `sle`, `le` is used and `start` is interpreted as an unsigned integer for the comparison. If it is a negative number, its 255th bit is set to `1` and is hence interpreted as a very large unsigned integer making the assertion always fail. Any contract having a `range(start, start + N)` where `start` is a signed integer with the possibility for `start` to be negative is affected. If a call goes through the loop while supplying a negative `start` the execution will revert. Version 0.4.0b1 fixes the issue.
Frequently asked questions
- What is CVE-2024-32481?
- Vyper is a pythonic Smart Contract Language for the Ethereum virtual machine. Starting in version 0.3.8 and prior to version 0.4.0b1, when looping over a `range` of the form `range(start, start + N)`, if `start` is negative, the execution will always revert. This issue is caused by an incorrect assertion inserted by the code generation of the range `stmt.parse_For_range()`. The issue arises when `start` is signed, instead of using `sle`, `le` is used and `start` is interpreted as an unsigned integer for the comparison. If it is a negative number, its 255th bit is set to `1` and is hence interpreted as a very large unsigned integer making the assertion always fail. Any contract having a `range(start, start + N)` where `start` is a signed integer with the possibility for `start` to be negative is affected. If a call goes through the loop while supplying a negative `start` the execution will revert. Version 0.4.0b1 fixes the issue.
- How severe is CVE-2024-32481?
- CVE-2024-32481 has a CVSS 3.x base score of 5.3, rated medium severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is none, integrity low, and availability none.
- Is CVE-2024-32481 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (52nd percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2024-32481?
- CVE-2024-32481 primarily affects Vyperlang Vyper. In total, 2 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2024-32481?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround.
- Does CVE-2024-32481 have an EU (EUVD) identifier?
- Yes. CVE-2024-32481 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2024-1269.
- When was CVE-2024-32481 published?
- CVE-2024-32481 was published on 2024-04-25 and last updated on 2026-06-17.
References
- https://github.com/vyperlang/vyper/blob/9136169468f317a53b4e7448389aa315f90b95ba/vyper/codegen/stmt.py#L286-L287
- https://github.com/vyperlang/vyper/commit/3de1415ee77a9244eb04bdb695e249d3ec9ed868
- https://github.com/vyperlang/vyper/commit/5319cfbe14951e007ccdb323257e5ada869b35d5
- https://github.com/vyperlang/vyper/security/advisories/GHSA-ppx5-q359-pvwj
Affected products (2)
- cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:python:*:*
- cpe:2.3:a:vyperlang:vyper:0.4.0:-:*:*:*:python:*:*
More vulnerabilities in Vyperlang Vyper
- CVE-2024-24563 — Critical (CVSS 9.8): Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. Arrays can be keyed by a signed integer,…
- CVE-2024-24561 — Critical (CVSS 9.8): Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In versions 0.3.10 and earlier, the…
- CVE-2025-27105 — Critical (CVSS 9.1): vyper is a Pythonic Smart Contract Language for the EVM. Vyper handles AugAssign statements by first caching the target…
- CVE-2022-24845 — High (CVSS 8.8): Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. In affected versions, the return of…
- CVE-2022-29255 — High (CVSS 8.2): Vyper is a Pythonic Smart Contract Language for the ethereum virtual machine. In versions prior to 0.3.4 when a calling…
- CVE-2023-42443 — High (CVSS 8.1): Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). In version 0.3.9 and prior, under…
All CVEs affecting Vyperlang Vyper →
Other CWE-681 vulnerabilities
- CVE-2022-40138 — Critical (CVSS 9.8): An integer conversion error in Hermes bytecode generation, prior to commit 6aa825e480d48127b480b08d13adf70033237097,…
- CVE-2021-36357 — Critical (CVSS 9.8): An issue was discovered in OpenPOWER 2.6 firmware. unpack_timestamp() calls le32_to_cpu() for endian conversion of a…
- CVE-2021-38187 — Critical (CVSS 9.8): An issue was discovered in the anymap crate through 0.12.1 for Rust. It violates soundness via conversion of a *u8 to a…
- CVE-2019-19317 — Critical (CVSS 9.8): lookupName in resolve.c in SQLite 3.30.1 omits bits from the colUsed bitmask in the case of a generated column, which…
- CVE-2019-14842 — Critical (CVSS 9.8): Structured reply is a feature of the newstyle NBD protocol allowing the server to send a reply in chunks. A bounds…
- CVE-2018-8786 — Critical (CVSS 9.8): FreeRDP prior to version 2.0.0-rc4 contains an Integer Truncation that leads to a Heap-Based Buffer Overflow in…