GHSA-2r3x-4mrv-mcxf: Vyper Memory Corruption Using Function Calls Vulnerability

MODERATE
CWE-129
Published
Advisory Summary

GHSA-2r3x-4mrv-mcxf is a MODERATE memory corruption using function calls vulnerability (CWE-129: Improper Validation of Array Index) affecting Vyper libraries in the PyPI ecosystem. The issue involves memory corruption using function calls within tuples / nested calls. Remediation is available by upgrading affected packages to version 0.2.6.

GHSA-2r3x-4mrv-mcxf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2r3x-4mrv-mcxf
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-129: Improper Validation of Array Index
Affected Product Vyper
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-2r3x-4mrv-mcxf

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.2.6
pip install vyper>=0.2.6
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 GHSA-2r3x-4mrv-mcxf, 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.2.6), 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-129: Improper Validation of Array Index, where the product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. 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

### Impact When performing a function call inside a tuple or as an argument inside another function call, there is a memory corruption issue that occurs because of an incorrect pointer to the the tip of the stack. Example code: ```python @internal def _foo(a: uint256, b: uint256, c: uint256) -> (uint256, uint256, uint256, uint256, uint256): return 1, a, b, c, 5 @internal def _foo2() -> uint256: a: uint256[10] = [6,7,8,9,10,11,12,13,15,16] return 4 @external def foo() -> (uint256, uint256, uint256, uint256, uint256): return self._foo(2, 3, self._foo2()) ``` Please see #2186 for further information ### Patches This problem was fixed in #2186, and released as a part of [`v0.2.6`](https://github.com/vyperlang/vyper/releases/tag/v0.2.6).

GHSA-2r3x-4mrv-mcxf Affected Vyper Versions

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

References

Frequently Asked Questions

What is GHSA-2r3x-4mrv-mcxf?
GHSA-2r3x-4mrv-mcxf is a security vulnerability in Vyper involving Memory corruption using function calls within tuples / nested calls under CWE-129: Improper Validation of Array Index.
Which Vyper versions are affected?
Affected versions include releases prior to 0.2.6 across affected packages: vyper.
What version fixes GHSA-2r3x-4mrv-mcxf?
Upgrading to 0.2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vyper affected?
Yes, vyper is affected in releases prior to 0.2.6. Upgrade your dependency to 0.2.6 or later.
What CWE is associated with GHSA-2r3x-4mrv-mcxf?
GHSA-2r3x-4mrv-mcxf is classified under CWE-129: Improper Validation of Array Index (The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.).
How can I check PyPI dependencies for GHSA-2r3x-4mrv-mcxf?
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-2r3x-4mrv-mcxf",
  "modified" : "2026-10-06T15:22:29Z",
  "published" : "2026-10-06T15:22:29Z",
  "aliases" : [ ],
  "summary" : "Vyper: Memory corruption using function calls within tuples / nested calls",
  "details" : "### Impact\nWhen performing a function call inside a tuple or as an argument inside another function call, there is a memory corruption issue that occurs because of an incorrect pointer to the the tip of the stack.\n\nExample code:\n```python\n@internal\ndef _foo(a: uint256, b: uint256, c: uint256) -> (uint256, uint256, uint256, uint256, uint256):\n    return 1, a, b, c, 5\n\n@internal\ndef _foo2() -> uint256:\n    a: uint256[10] = [6,7,8,9,10,11,12,13,15,16]\n    return 4\n\n@external\ndef foo() -> (uint256, uint256, uint256, uint256, uint256):\n    return self._foo(2, 3, self._foo2())\n```\n\nPlease see #2186 for further information\n\n### Patches\nThis problem was fixed in #2186, and released as a part of [`v0.2.6`](https://github.com/vyperlang/vyper/releases/tag/v0.2.6).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "vyper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vyperlang/vyper/security/advisories/GHSA-2r3x-4mrv-mcxf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vyperlang/vyper/pull/2186"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vyperlang/vyper/commit/74ba67d4bec5f8be4f05759e37d2bfb1463e0441"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vyperlang/vyper"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vyperlang/vyper/releases/tag/v0.2.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-129" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-06T15:22:29Z",
    "nvd_published_at" : null
  }
}