GHSA-4v7v-gqf9-ww2g
Vyper: Call stack corruption when passing complex type containing non-base type members as argument
vyperpipLibraries & packages
CVSS
6.9MediumExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)No scoreNo FIRST EPSS score in this snapshot yet
What fixes it
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
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](https://github.com/vyperlang/vyper/releases/tag/v0.2.6).
Text from GitHub Advisory Database
Affected versions 24
- vyper, pip< 0.2.6GitHub
- vyper, PyPIfrom first release, fixed in 0.2.6OSV
- vyper, PyPI0.1.0b1OSV
- vyper, PyPI0.1.0b10OSV
- vyper, PyPI0.1.0b11OSV
- vyper, PyPI0.1.0b12OSV
- vyper, PyPI0.1.0b13OSV
- vyper, PyPI0.1.0b14OSV
- vyper, PyPI0.1.0b15OSV
- vyper, PyPI0.1.0b16OSV
- vyper, PyPI0.1.0b17OSV
- vyper, PyPI0.1.0b2OSV
- vyper, PyPI0.1.0b3OSV
- vyper, PyPI0.1.0b4OSV
- vyper, PyPI0.1.0b5OSV
- vyper, PyPI0.1.0b6OSV
- vyper, PyPI0.1.0b7OSV
- vyper, PyPI0.1.0b8OSV
- vyper, PyPI0.1.0b9OSV
- vyper, PyPI0.2.1OSV
- vyper, PyPI0.2.2OSV
- vyper, PyPI0.2.3OSV
- vyper, PyPI0.2.4OSV
- vyper, PyPI0.2.5OSV
References 6
- github.com/vyperlang/vyper/commit/0be02b7331e8febe79d5a4218829c72e30417a29Fixvia GitHub
- github.com/vyperlang/vyper/releases/tag/v0.2.6Fixvia GitHub
- github.com/vyperlang/vyper/security/advisories/GHSA-4v7v-gqf9-ww2gAdvisoryvia GitHub
- github.com/advisories/GHSA-4v7v-gqf9-ww2gAdvisoryvia GitHub
- github.com/vyperlang/vyper/issues/2183Referencevia GitHub
- github.com/vyperlang/vyper/pull/2184Referencevia GitHub