CVE-2024-24559 Vyper SHA3 code generation bug

Low 3.7 Published Updated

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.

PackageAffectedFixed in
vyper PyPIAll versions0.4.0
vyper PyPIAll versions0.4.0
vyper PyPIAll versions0.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.

Sources

Also known as GHSA-6845-xw22-ffxv, PYSEC-2024-147.

Is CVE-2024-24559 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free