CVE-2024-24559 Vyper SHA3 code generation bug
A stack management error in Vyper's SHA3 code generation affects manually written IR, but is not triggerable via normal compilation.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-24559?
CVE-2024-24559 is a low-severity vulnerability in vyperlang vyper, published on 5 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Vyper is a Pythonic Smart Contract Language for the EVM. There is an error in the stack management when compiling the `IR` for `sha3_64`. Concretely, the `height` variable is miscalculated. The vulnerability can't be triggered without writing the `IR` by hand (that is, it cannot be triggered from regular vyper code). `sha3_64` is used for retrieval in mappings. No flow that would cache the `key` was found so the issue shouldn't be possible to trigger when compiling the compiler-generated `IR`. This issue isn't triggered during normal compilation of vyper code so the impact is low. At the time of publication there is no patch available.
Weakness: CWE-327
Which versions are affected by CVE-2024-24559?
3 open source packages ship an affected version, including vyper. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
vyper PyPI | All versions | 0.4.0 |
vyper PyPI | All versions | 0.4.0 |
vyper PyPI | All versions | 0.4.0b1 |
Products include Vyperlang Vyper.
How do I fix CVE-2024-24559?
Upgrade vyper to a fixed version for your release line: 0.4.0 or 0.4.0b1.
Is CVE-2024-24559 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24559 exists.
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-6845-xw22-ffxv, PYSEC-2024-147.