CVE-2024-24561 Vyper bounds check on built-in `slice()` function can be overflowed
Attackers can exploit an integer overflow in Vyper's slice bounds check to access or corrupt out-of-bounds storage, memory, or calldata.
- 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-24561?
CVE-2024-24561 is a critical vulnerability in vyperlang vyper, published on 1 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 ethereum virtual machine. In versions 0.3.10 and earlier, the bounds check for slices does not account for the ability for start + length to overflow when the values aren't literals. If a slice() function uses a non-literal argument for the start or length variable, this creates the ability for an attacker to overflow the bounds check. This issue can be used to do OOB access to storage, memory or calldata addresses. It can also be used to corrupt the length slot of the respective array.
Which versions are affected by CVE-2024-24561?
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-24561?
Upgrade vyper to a fixed version for your release line: 0.4.0 or 0.4.0b1.
Is CVE-2024-24561 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24561 exists.
Other vulnerabilities in vyperlang vyper
- CVE-2024-24563 Vyper array negative index vulnerability
- 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
- CVE-2023-42443 Vyper vulnerable to memory corruption in certain builtins utilizing `msize`
Sources
Also known as GHSA-9x7f-gwxq-6f2c, PYSEC-2024-149.