CVE-2025-27105: Vyper AugAssign Evaluation Order Causing OOB Vulnerability

LOW
Advisory Identifier: GHSA-4w26-8p97-f4jp
CWE-787
Published
Advisory Summary

CVE-2025-27105 is a LOW augassign evaluation order causing oob vulnerability (CWE-787: Out-of-bounds Write) affecting Vyper libraries in the PyPI ecosystem. The issue involves augassign evaluation order causing oob write within the object in vyper. Remediation is available by upgrading affected packages to version 0.4.1.

CVE-2025-27105 at a Glance

CVE Identifier CVE-2025-27105
GHSA Identifier GHSA-4w26-8p97-f4jp
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Vyper
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-27105

To remediate this vulnerability, upgrade all affected Vyper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vyper fixed: 0.4.1
pip install vyper>=0.4.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show vyper

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-27105, inspect your installed packages using pip:

pip show vyper

Analyze the terminal output to locate any version of Vyper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.1), your application is affected.

Note: The pip show vyper command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Vyper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 ```

CVE-2025-27105 Affected Vyper Versions

1 component(s)
Fixed Versions:
0.4.1
Product / Package Ecosystem Affected Versions Fixed Version
vyper
PyPI
< 0.4.1
0.4.1

References

Frequently Asked Questions

What is CVE-2025-27105?
CVE-2025-27105 is a security vulnerability in Vyper involving AugAssign evaluation order causing OOB write within the object in Vyper under CWE-787: Out-of-bounds Write.
Which Vyper versions are affected?
Affected versions include releases prior to 0.4.1 across affected packages: vyper.
What version fixes CVE-2025-27105?
Upgrading to 0.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vyper affected?
Yes, vyper is affected in releases prior to 0.4.1. Upgrade your dependency to 0.4.1 or later.
What CWE is associated with CVE-2025-27105?
CVE-2025-27105 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2025-27105?
Run the dependency tree command: 'pip show vyper'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4w26-8p97-f4jp",
  "modified" : "2025-04-09T20:14:00Z",
  "published" : "2025-02-21T22:43:33Z",
  "aliases" : [ "CVE-2025-27105" ],
  "summary" : "AugAssign evaluation order causing OOB write within the object in Vyper",
  "details" : "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\n\n```vyper\ndef poc():\n    a: DynArray[uint256, 2] = [1, 2]\n    a[1] += a.pop()\n```\n\nis equivalent to:\n```vyper\ndef poc():\n    a: DynArray[uint256, 2] = [1, 2]\n    a[1] += a[len(a) - 1]\n    a.pop()\n```\nrather than:\n```vyper\ndef poc():\n    a: DynArray[uint256, 2] = [1, 2]\n    s: uint256 = a[1]\n    t: uint256 = a.pop()\n    a[1] = s + t  # reverts due to oob access\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "vyper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.4.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vyperlang/vyper/security/advisories/GHSA-4w26-8p97-f4jp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27105"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2025-31.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vyperlang/vyper"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-21T22:43:33Z",
    "nvd_published_at" : "2025-02-21T22:15:13Z"
  }
}