CVE-2024-24561CWE-119

Vyper bounds check on built-in `slice()` function can be overflowed

Critical · published February 1, 2024

CVSS v3.1
9.8
EPSS
1%
Percentile
59.3
In the wild
Unconfirmed
What it is

🔥 A sneaky oversight in Vyper could let rogue contracts access data they shouldn't—like a magic show where the illusionist reads your mind without permission! Think of it like a restaurant that lets customers order more food than they can actually pay for—a customer sneaks in an extra slice of cake that wasn't on the menu, and the kitchen can’t check how much the bill should've been. In this case, attackers can overflow the bounds check in smart contracts, gaining access to unauthorized data. An attacker leveraging this vulnerability could manipulate the bounds check, leading to Out-of-Bounds (OOB) access to sensitive storage, memory, or calldata. This could be absolutely devastating, allowing them to corrupt data or exploit contract behavior, effectively putting your assets at risk!

Put simply

Think of it like a restaurant that lets customers order more food than they can actually pay for—a customer sneaks in an extra slice of cake that wasn't on the menu, and the kitchen can’t check how much the bill should've been. In this case, attackers can overflow the bounds check in smart contracts, gaining access to unauthorized data. In Vyper versions 0.3.10 and earlier, the slice() function fails to validate non-literal arguments for start and length, allowing an attacker to overflow bounds checks and access restricted areas of storage or memory.

What to do

An attacker leveraging this vulnerability could manipulate the bounds check, leading to Out-of-Bounds (OOB) access to sensitive storage, memory, or calldata. This could be absolutely devastating, allowing them to corrupt data or exploit contract behavior, effectively putting your assets at risk! Immediately upgrade your Vyper version to 0.3.11 or later to mitigate this vulnerability. Furthermore, review your smart contracts to ensure they do not rely on non-literal arguments for the slice() function. Regular audits will help catch potential exploits before they happen! You've got this! With these steps, you'll fortify your smart contracts and become a security hero in the Ethereum ecosystem! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00902 · 59.3th percentile
Weakness
CWE-119 · Improper Restriction of Operations within the Bounds of a Memory Buffer
Published
2024-02-01T16:37Z
EPSS history
Timeline
  • 01 FEB 16:37Z
    Vyper bounds check on built-in `slice()` function can be overflowed
    cvelistv5