CVE-2024-32648: Vyper Vyper Default Functions Don't Respect Vulnerability
MODERATECVE-2024-32648 is a MODERATE (CVSS 5.3) vyper default functions don't respect vulnerability (CWE-667: Improper Locking) affecting Vyper libraries in the PyPI ecosystem. The issue involves vyper default functions don't respect nonreentrancy keys. Remediation is available by upgrading affected packages to version 0.3.0.
CVE-2024-32648 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2024-32648
To remediate this vulnerability, upgrade all affected Vyper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install vyper>=0.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show vyper
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-32648, inspect your installed packages using pip:
pip show vyper
Analyze the terminal output to locate any version of Vyper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.0), your application is affected.
Note: The pip show vyper command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-667: Improper Locking, where the product does not properly acquire or release a lock on a resource, leading to unexpected resource state changes and behaviors. In Vyper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-32648 Affected Vyper Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
vyper
|
PyPI |
< 0.3.0
|
0.3.0
|
References
Frequently Asked Questions
What is CVE-2024-32648?
Which Vyper versions are affected?
What version fixes CVE-2024-32648?
Is vyper affected?
What is the CVSS score of CVE-2024-32648?
What CWE is associated with CVE-2024-32648?
How can I check PyPI dependencies for CVE-2024-32648?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m2v9-w374-5hj9",
"modified" : "2025-01-14T16:37:11Z",
"published" : "2024-04-25T19:50:35Z",
"aliases" : [ "CVE-2024-32648" ],
"summary" : "vyper default functions don't respect nonreentrancy keys",
"details" : "### Summary\nPrior to v0.3.0, `__default__()` functions did not respect the `@nonreentrancy` decorator and the lock was not emitted. This is a known bug and was already visible in the issue tracker (https://github.com/vyperlang/vyper/issues/2455), but it is being re-issued as an advisory so that tools relying on the advisory publication list can incorporate it into their searches.\n\nA contract search was additionally performed and no vulnerable contracts were found in production.\n\n### PoC\n```vyper\n@external\n@payable\n@nonreentrant(\"default\")\ndef __default__():\n pass\n```\n\nafter codegen:\n```\n[seq,\n [if, [lt, calldatasize, 4], [goto, fallback]],\n [mstore, 28, [calldataload, 0]],\n [with, _func_sig, [mload, 0], seq],\n [seq_unchecked,\n [label, fallback],\n [seq,\n pass,\n # Line 5\n pass,\n pass,\n # Line 4\n stop]]],\n```\n\n### Impact\nNo vulnerable production contracts were found. Additionally, using a lock on a `default` function is a very sparsely used pattern. As such, the impact is `low`.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "vyper"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.2.16"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/vyperlang/vyper/security/advisories/GHSA-m2v9-w374-5hj9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32648"
}, {
"type" : "WEB",
"url" : "https://github.com/vyperlang/vyper/issues/2455"
}, {
"type" : "WEB",
"url" : "https://github.com/vyperlang/vyper/commit/93287e5ac184b53b395c907d40701f721daf8177"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-163.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/vyperlang/vyper"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-667" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-04-25T19:50:35Z",
"nvd_published_at" : "2024-04-25T18:15:09Z"
}
}