CVE-2021-41121 Memory corruption in Vyper
A memory corruption flaw in the Vyper compiler allows attackers to potentially execute arbitrary code via crafted smart contracts.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-41121?
CVE-2021-41121 is a high-severity memory corruption vulnerability in vyperlang vyper, published on 6 Oct 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
Vyper is a Pythonic Smart Contract Language for the EVM. In affected versions when performing a function call inside a literal struct, there is a memory corruption issue that occurs because of an incorrect pointer to the the top of the stack. This issue has been resolved in version 0.3.0.
Weakness: CWE-119
Which versions are affected by CVE-2021-41121?
3 open source packages ship an affected version, including vyper. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
vyper PyPI | All versions | 0.3.0 |
vyper PyPI | All versions | 0.3.0 |
vyper PyPI | All versions | 0.3.0 |
Products include Vyperlang Vyper.
How do I fix CVE-2021-41121?
Upgrade vyper to 0.3.0 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2021-41121 being exploited?
There is no known exploitation of CVE-2021-41121 in the wild and no public exploit code.
Other vulnerabilities in vyperlang vyper
- CVE-2024-24563 Vyper array negative index vulnerability
- CVE-2024-24561 Vyper bounds check on built-in `slice()` function can be overflowed
- CVE-2023-39363 Vyper incorrectly allocated named re-entrancy locks
- CVE-2022-24845 Integer bounds error in Vyper
- CVE-2022-29255 Multiple evaluation of contract address in call in vyper
Sources
Also known as GHSA-xv8x-pr4h-73jv, PYSEC-2021-365.