Vyper: Call stack corruption when passing complex type containing non-base type members as argumentGHSA-4v7v-gqf9-ww2g
Fix: vyperlang/vyper#2184GHSA-4v7v-gqf9-ww2g is a security vulnerability in vyper. A fix is available for vyper — see the affected versions and patch details below.
Real-World Exposure
vyperReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Impact
When we pass a multi-dimensional array (like [[1, 2], [3, 4]]) as an argument to internal/external functions we get incorrect output. This is due to a stack management issue, because it was assumed that the size of each subtype of an array/struct is 32, which is not always correct.
Example code:
@internal
def test_input(arr: int128[2][1], i: int128) -> (int128[2][1], int128):
return arr, i
@external
def test_values(arr: int128[2][1], i: int128) -> (int128[2][1], int128):
return self.test_input(arr, i)
Please see #2183 for further information
Patches
This problem was fixed in #2184, and released as a part of v0.2.6.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | vyper | all versions | 0.2.6pip install --upgrade 'vyper==0.2.6' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for vyper, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update vyper to 0.2.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4v7v-gqf9-ww2g is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-4v7v-gqf9-ww2g in your dependencies?
Find it across PyPI, including transitive dependencies.