CVE-2025-27104 Details
Description
vyper is a Pythonic Smart Contract Language for the EVM. Multiple evaluation of a single expression is possible in the iterator target of a for loop. While the iterator expression cannot produce multiple writes, it can consume side effects produced in the loop body (e.g. read a storage variable updated in the loop body) and thus lead to unexpected program behavior. Specifically, reads in iterators which contain an ifexp (e.g. `for s: uint256 in ([read(), read()] if True else [])`) may interleave reads with writes in the loop body. Vyper for loops allow two kinds of iterator targets, namely the `range()` builtin and an iterable type, like SArray and DArray. During codegen, iterable lists are required to not produce any side-effects (in the following code, `range_scope` forces `iter_list` to be parsed in a constant context, which is checked against `is_constant`). However, this does not prevent the iterator from consuming side effects provided by the body of the loop. For SArrays on the other hand, `iter_list` is instantiated in the body of a `repeat` ir, so it can be evaluated several times. This issue is being addressed and is expected to be available in version 0.4.1. Users are advised to upgrade as soon as the patched release is available. There are no known workarounds for this vulnerability.
A vulnerability exists in Vyper versions through 0.4.0, allowing multiple evaluations of a single expression in the iterator target of for loops. This issue can lead to unexpected program behavior by interleaving reads and writes. Specifically, iterators containing conditional expressions can consume side effects from the loop body, such as reading a storage variable that was updated during the loop. The vulnerability arises because, while the iterator expression itself cannot generate multiple writes, it can read and process side effects in a way that disrupts the intended flow of the program.
Users are advised to upgrade to Vyper version 0.4.1, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 22, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/vyperlang/vyper/pull/4488 | [email protected] | Issue TrackingPatch |
| https://github.com/vyperlang/vyper/security/advisories/GHSA-h33q-mhmp-8p67 | [email protected] | ExploitVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| NVD-CWE-noinfo | Insufficient Information to Classify Weakness | [email protected] |
| CWE-662 | Improper Synchronization | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| vyperlang vyper | < 0.4.1 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Mar 28, 2025 | Initial Analysis | [email protected] |
| Feb 22, 2025 | CVE Modified | CISA-ADP |
| Feb 21, 2025 | New CVE Received | [email protected] |