{"answers":{"affected":"3 open source packages ship an affected version, including vyper. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32481 exists.","fix":"Upgrade vyper to a fixed version for your release line: 0.4.0 or 0.4.0b1.","what":"CVE-2024-32481 is a medium-severity denial of service vulnerability in vyperlang vyper, published on 25 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-32481 and fix it if it is affected.\n\nWhat it is: CVE-2024-32481 is a medium-severity denial of service vulnerability in vyperlang vyper, published on 25 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32481 exists.\n\nAffected packages and fixed versions:\n- vyper (PyPI): affected from 0.3.8; fixed in 0.4.0\n- vyper (PyPI): affected from 0.3.8; fixed in 0.4.0\n- vyper (PyPI): affected from 0.3.8; fixed in 0.4.0b1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-32481/ (Markdown: https://insights.sbomify.com/CVE-2024-32481/index.md)","id":"CVE-2024-32481","markdown":"https://insights.sbomify.com/CVE-2024-32481/index.md","name":"CVE-2024-32481","record":{"aliases":["GHSA-ppx5-q359-pvwj","PYSEC-2024-246"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Vyper smart contract compiler","requires_auth":"none","summary":"Attackers can cause smart contract execution to revert by supplying negative start values to range loops, leading to denial of service.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"vyper","vendor":"vyperlang"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-681","name":"Incorrect Conversion between Numeric Types"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"vyper's range(start, start + N) reverts for negative numbers","id":"CVE-2024-32481","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":3,"n_references":4,"next":{"headline":"Tillitis TKey Signer possible RAM disclosure vulnerability","id":"CVE-2024-32482"},"packages":[{"ecosystem":"PyPI","fixed":["0.4.0"],"introduced":["0.3.8"],"last_affected":[],"package":"vyper","purl":null,"source":"GHSA-ppx5-q359-pvwj"},{"ecosystem":"PyPI","fixed":["0.4.0"],"introduced":["0.3.8"],"last_affected":[],"package":"vyper","purl":"pkg:pypi/vyper","source":"GHSA-ppx5-q359-pvwj"},{"ecosystem":"PyPI","fixed":["0.4.0b1"],"introduced":["0.3.8"],"last_affected":[],"package":"vyper","purl":"pkg:pypi/vyper","source":"PYSEC-2024-246"}],"prev":{"headline":"LibreNMS's Time-Based Blind SQL injection leads to database extraction","id":"CVE-2024-32480"},"products":["vyper"],"published":"2024-04-25","related":[{"cvss_score":9.8,"headline":"Vyper array negative index vulnerability","id":"CVE-2024-24563","kev_date_added":null,"published":"2024-02-07"},{"cvss_score":9.8,"headline":"Vyper bounds check on built-in `slice()` function can be overflowed","id":"CVE-2024-24561","kev_date_added":null,"published":"2024-02-01"},{"cvss_score":9.1,"headline":"Vyper incorrectly allocated named re-entrancy locks","id":"CVE-2023-39363","kev_date_added":null,"published":"2023-08-07"},{"cvss_score":8.8,"headline":"Integer bounds error in Vyper","id":"CVE-2022-24845","kev_date_added":null,"published":"2022-04-13"},{"cvss_score":8.2,"headline":"Multiple evaluation of contract address in call in vyper","id":"CVE-2022-29255","kev_date_added":null,"published":"2022-06-06"},{"cvss_score":8.1,"headline":"Vyper vulnerable to memory corruption in certain builtins utilizing `msize`","id":"CVE-2023-42443","kev_date_added":null,"published":"2023-09-18"},{"cvss_score":7.5,"headline":"Vyper has incorrect storage layout for contracts containing large arrays","id":"CVE-2023-46247","kev_date_added":null,"published":"2023-12-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["vyperlang"]},"summary":"Attackers can cause smart contract execution to revert by supplying negative start values to range loops, leading to denial of service.","url":"https://insights.sbomify.com/CVE-2024-32481/"}