vyper performs double eval of the slice args when buffer from adhoc locations
Description
Vyper is a pythonic Smart Contract Language for the Ethereum virtual machine. In versions 0.3.10 and prior, using the slice builtin can result in a double eval vulnerability when the buffer argument is either msg.data, self.code or .code and either the start or length arguments have side-effects. It can be easily triggered only with the versions <0.3.4 as 0.3.4 introduced the unique symbol fence. No vulnerable production contracts were found. Additionally, double evaluation of side-effects should be easily discoverable in client tests. As such, the impact is low. As of time of publication, no fixed versions are available.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A double eval vulnerability in Vyper's `slice` builtin when used with `msg.data`, `self.code`, or `.code` and side-effect arguments.
Vulnerability
Description
CVE-2024-32646 describes a double evaluation vulnerability in the Vyper smart contract compiler, affecting versions 0.3.10 and prior [1]. The issue resides in the slice builtin function. When the buffer argument is msg.data, self.code, or .code and either the start or length argument contains side-effects, those side-effects are evaluated twice, leading to unexpected behavior [1]. This bug class is known as a "double eval" or "double evaluation" vulnerability.
Exploitation
Exploitation requires a smart contract that uses the slice builtin with one of the affected buffer types and has side-effects in the start or length parameters. According to the advisory, the vulnerability is easily triggered only in Vyper versions earlier than 0.3.4, as version 0.3.4 introduced a unique symbol fence that mitigates the issue [1]. However, the advisory also notes that no vulnerable production contracts were found [1]. The double evaluation of side-effects should be easily discoverable in client tests [1], suggesting that the attack surface is limited and detection is straightforward.
Impact
The impact is assessed as low by the publisher [1]. An attacker who can influence the side-effects of start or length arguments in a slice call could cause unexpected state changes or resource consumption. However, because no vulnerable production contracts have been found and the bug is detectable in testing, the practical risk is minimized. The vulnerability does not lead to direct fund loss unless combined with other logic errors.
Mitigation
Status
As of the publication date (2024-04-25), no fixed versions are available [1]. Users are advised to avoid using the slice builtin with msg.data, self.code, or .code as the buffer argument when the start or length arguments contain side-effects, or to upgrade to Vyper 0.3.4 or later if possible, since the unique symbol fence in those versions prevents easy triggering [1]. The Vyper development team is likely to address this in a future release, and the associated GitHub repository tracks potential fixes [2][3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
vyperPyPI | < 0.4.0 | 0.4.0 |
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-r56x-j438-vw5mghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-32646ghsaADVISORY
- github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-207.yamlghsaWEB
- github.com/vyperlang/vyper/pull/2914ghsaWEB
- github.com/vyperlang/vyper/security/advisories/GHSA-r56x-j438-vw5mghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.