Cyber Resilience

CVE-2025-27104

Vyperlang Vyper ≤ 0.4.1

Public PoC
Published
21 February 2025
Modified
28 March 2025
Patch / advisory
CVSS Score v4 2.3
Click a component to see what it means
Raw vectorCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
EPSS Score 0.0043 36th percentile
Risk Priority 27 floored blend · peak EPSS

Summary

CVE-2025-27104 is a low-severity Improper Synchronization (CWE-662) vulnerability in Vyperlang Vyper. Its CVSS base score is 2.3 (Low).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 36th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SC-39 (Process Isolation) and SC-4 (Information in Shared System Resources) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2025-27104 is a vulnerability in vyper, a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). It enables multiple evaluations of a single expression in the iterator target of a for loop, allowing the iterator to consume side effects produced in the loop body, such as reading a storage variable updated during iteration. This can lead to unexpected program behavior, particularly with iterators containing if expressions (e.g., `for s: uint256 in ([read(), read()] if True else [])`) or SArrays, where the iterator list is instantiated in a `repeat` IR and re-evaluated multiple times. Vyper's codegen enforces constant context for iterable lists like range() but fails to prevent side-effect consumption from the loop body.

Remote attackers require no privileges (PR:N) and can exploit the vulnerability over the network (AV:N) by interacting with deployed smart contracts compiled using affected vyper versions that contain vulnerable for loops. Triggering such loops causes interleaved reads and writes, potentially resulting in incorrect contract execution or state manipulation. The CVSS v3.1 base score of 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) highlights high availability impact due to disrupted program flow, with associated CWEs including CWE-662 (Component with Excessive Influence).

The vyper security advisory (GHSA-h33q-mhmp-8p67) and pull request #4488 state that the issue is addressed in version 0.4.1. Users are advised to upgrade to the patched release as soon as available, with no known workarounds.

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1548 Abuse Elevation Control Mechanism Privilege Escalation
Adversaries may circumvent mechanisms designed to control privilege elevation to gain higher-level permissions.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-42441Same product: Vyperlang Vyper
CVE-2024-32648Same product: Vyperlang Vyper
CVE-2023-39363Same product: Vyperlang Vyper
CVE-2024-24567Same product: Vyperlang Vyper
CVE-2023-32058Same product: Vyperlang Vyper
CVE-2023-37902Same product: Vyperlang Vyper
CVE-2024-32481Same product: Vyperlang Vyper
CVE-2023-42460Same product: Vyperlang Vyper
CVE-2024-32646Same product: Vyperlang Vyper
CVE-2023-46247Same product: Vyperlang Vyper

Affected Assets

vyperlang
vyper
≤ 0.4.1

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V15.4.1
  • V6.5.1
  • V15.1.3
  • V15.4.2

Mitigating Controls (NIST 800-53 r5) AI

Process isolation reduces the attack surface and blast radius of synchronization failures but does not itself implement the required synchronization.

SC-4 directly requires preventing unintended information transfer through shared resources, which is achieved only by proper synchronization primitives for exclusive access.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require synchronization mechanisms and concurrency testing to prevent race conditions.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect synchronization flaws but does not itself implement the required controls.

prevents

Secure development lifecycle requires concurrency controls and synchronization primitives to prevent race conditions.

prevents

Secure system architecture principles include thread-safety and resource-locking mechanisms to avoid improper synchronization.

prevents

Secure coding standards explicitly mandate proper use of locks, semaphores, and atomic operations to eliminate race conditions.

References