CVE-2025-27105
JSON

2.3low

AugAssign evaluation order causing OOB write within the object in Vyper

Severity
2.3low CVSS:4.0 by GitHub_M
Exploit likelihood
0.60% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4w26-8p97-f4jpPYSEC-2025-31

Description

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.

Affected

Product or packageVersionsReported by
vyperlang vyper< 0.4.1, before 0.4.1CVE List, NVD
vyper (PyPI)before 0.4.1GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M2.3low CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
CISA-ADP9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N

Classification

CWE-787

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database

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

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

is equivalent to:

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

rather than:

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
NVD (es)

vyper es un lenguaje de contrato inteligente Pythonic para EVM. Vyper gestiona las instrucciones AugAssign almacenando primero en caché la ubicación de destino para evitar una doble evaluación. Sin embargo, en el caso en que el destino sea un acceso a un DynArray y el rhs modifique la matriz, el destino almacenado en caché se evaluará primero y la verificación de límites no se volverá a evaluar durante la parte de escritura de la instrucción. Este problema se ha solucionado en la versión 0.4.1 y se recomienda a todos los usuarios que actualicen. No existen workarounds conocidos para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-27105 changed 2025-02-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-4w26-8p97-f4jp changed 2025-04-09CC-BY-4.0
NVDCVE-2025-27105 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2025-31 changed 2025-04-09CC-BY-4.0