vyper's range(start, start + N) reverts for negative numbers
CVE-2024-32481GHSA-ppx5-q359-pvwj
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (vyper 0.4.0), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
PyPI vyper
- Affected
- >= 0.3.8, < 0.4.0
- Fixed in
- 0.4.0
Sources
- Open Source Vulnerabilities (OSV.dev), including the GitHub Advisory Database
OSV record GHSA-ppx5-q359-pvwj lists affected ranges: PyPI vyper >=0.3.8 <0.4.0 (fixed)
VerifiedObserved Structured OSV record; GitHub-reviewed advisory.
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-ppx5-q359-pvwj lists affected ranges: PyPI vyper >=0.3.8 <0.4.0
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 5.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- EPSS
- CVE-2024-32481: 0.80% estimated exploitation activity in the next 30 days; percentile 56.56 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary When looping over a range of the form range(start, start + N), if start is negative, the execution will always revert. Details This issue is caused by an incorrect assertion inserted by the code generation of the range (stmt.parseForrange()): https://github.com/vyperlang/vyper/blob/9136169468f317a53b4e7448389aa315f90b95ba/vyper/codegen/stmt.py#L286-L287 This assertion was introduced in https://github.com/vyperlang/vyper/commit/3de1415ee77a9244eb04bdb695e249d3ec9ed868 to fix https://github.com/advisories/GHSA-6r8q-pfpv-7cgj. 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. PoC Patches patched in v0.4.0, specifically, https://github.com/vyperlang/vyper/pull/3679 disallows this form of range(). Impact Any contract having a range(start, start + N)…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 2 · amended ·
Amended from ghsa record GHSA-ppx5-q359-pvwj
- Revision 1 · created ·
Published from osv record GHSA-ppx5-q359-pvwj
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2024-32481 Advisory: vyper's range(start, start + N) reverts for negative numbers IDs: CVE-2024-32481, GHSA-ppx5-q359-pvwj Record: https://patchnext.com/advisories/cve-2024-32481 (revision 2, source checked 26 Oct 2026, 13:13 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 5.3) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: vyper 0.4.0. A vendor fix does not mean a deployment is fixed. ## Affected components - PyPI vyper: affected >= 0.3.8, < 0.4.0; fixed in 0.4.0 ## Suggested inspection (read-only) - `python -m pip show vyper`: prints the installed version. Run with the environment that serves production active. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on vyper. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://osv.dev/vulnerability/GHSA-ppx5-q359-pvwj (OSV record GHSA-ppx5-q359-pvwj lists affected ranges: PyPI vyper >=0.3.8 <0.4.0 (fixed)) - Verified: https://github.com/advisories/GHSA-ppx5-q359-pvwj (GitHub-reviewed advisory GHSA-ppx5-q359-pvwj lists affected ranges: PyPI vyper >=0.3.8 <0.4.0) Commands are suggestions: review each one before running it.
Loading voting…