CVE-2025-27105: AugAssign evaluation order causing OOB write within the object in Vyper

Published Feb 21, 2025
·
Updated

Vyper handles AugAssign statements by first caching the target location to avoid double evaluation. However, in the case when target is an access to a DynArray and the rhs modifies the array, the cached target will evaluate first, and the bounds check will not be re-evaluated during the write portion of the statement. In other words, the following code

vyper def poc(): a: DynArray[uint256, 2] = [1, 2] a[1] += a.pop()

is equivalent to: vyper def poc(): a: DynArray[uint256, 2] = [1, 2] a[1] += a[len(a) - 1] a.pop() rather than: vyper def poc(): a: DynArray[uint256, 2] = [1, 2] s: uint256 = a[1] t: uint256 = a.pop() a[1] = s + t # reverts due to oob access

Other sources

vyper is a Pythonic Smart Contract Language for the EVM. Vyper handles AugAssign statements by first caching the target location to avoid double evaluation. However, in the case when target is an access to a DynArray and the rhs modifies the array, the cached target will evaluate first, and the bounds check will not be re-evaluated during the write portion of the statement. This issue has been addressed in version 0.4.1 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

— MITRE

Affected Software

2 affected componentsFixes available
vyperlang Vyper Python<0.4.1
pip/vyper<=0.4.0
0.4.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/vyper to a version that resolves this vulnerability.

    Fixed in 0.4.1
  2. Upgrade

    Upgrade Vyper to a version that resolves this vulnerability.

    Fixed in 0.4.1

Event History

Feb 21, 2025
CVE Published
via MITRE·09:27 PM
Data Sourced
via MITRE·09:27 PM
DescriptionWeakness
Advisory Published
via GitHub·10:43 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-27105?

CVE-2025-27105 is a vulnerability in Vyper that can lead to improper bounds checking of dynamic arrays, potentially resulting in exploitation.

2

How do I fix CVE-2025-27105?

To mitigate CVE-2025-27105, upgrade Vyper to version 0.4.1 or later.

3

What versions of Vyper are affected by CVE-2025-27105?

CVE-2025-27105 affects Vyper versions up to and including 0.4.0.

4

What consequences may arise from CVE-2025-27105 if exploited?

Exploitation of CVE-2025-27105 may allow an attacker to bypass bounds checks, leading to undefined behavior or vulnerabilities.

5

Is there a specific action recommended for developers using Vyper regarding CVE-2025-27105?

Developers using Vyper should immediately update to version 0.4.1 to protect against CVE-2025-27105.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203