Vulnerability · Published Feb 1, 2024 · Assigned by GitHub_M

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

Critical 9.8

In plain English

A critical-severity memory corruption in vyper from vyperlang. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.9% (higher than 60% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.8Critical
Exploit odds (30 days)0.9%top 40.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIvyper0.4.0GHSA-9x7f-gwxq-6f2c
PyPIvyper0.4.0b1PYSEC-2024-149

Affected products (as reported)

VendorProductVersions
vyperlang vyper <= 0.3.10

Weakness: CWE-119 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

References