PyPI: vyper
CVE-2023-37902
Safety vulnerability ID: SFTY-20230725-82514
Safety legacy ID: pyup.io-59955
Vyper 0.3.10 includes a fix for a vulnerability. Prior to version 0.3.10, the ecrecover precompile does not fill the output buffer if the signature does not verify. However, the ecrecover builtin will still return whatever is at memory location 0. This means that if the compiler has been convinced to write to the 0 memory location with specially crafted data, just before the ecrecover, a signature check might pass on an invalid signature. https://github.com/vyperlang/vyper/commit/019a37ab98ff53f04fecfadf602b6cd5ac748f7f https://github.com/vyperlang/vyper/security/advisories/GHSA-f5x6-7qgp-jhf3
Overview
ecrecover can return undefined data if signature does not verify
Advisory
Vyper 0.3.10 includes a fix for a vulnerability. Prior to version 0.3.10, the ecrecover precompile does not fill the output buffer if the signature does not verify. However, the ecrecover builtin will still return whatever is at memory location 0. This means that if the compiler has been convinced to write to the 0 memory location with specially crafted data, just before the ecrecover, a signature check might pass on an invalid signature. https://github.com/vyperlang/vyper/commit/019a37ab98ff53f04fecfadf602b6cd5ac748f7f https://github.com/vyperlang/vyper/security/advisories/GHSA-f5x6-7qgp-jhf3
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20230725-82514/CVE-2023-37902
- https://github.com/vyperlang/vyper/security/advisories/GHSA-f5x6-7qgp-jhf3
- https://github.com/vyperlang/vyper/commit/019a37ab98ff53f04fecfadf602b6cd5ac748f7f
- https://nvd.nist.gov/vuln/detail/CVE-2023-37902
- https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2023-133.yaml
- https://github.com/advisories/GHSA-f5x6-7qgp-jhf3
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
