Skip to content
OpenAdvisories
Critical · 9.8 CVE-2024-24561 EUVD-2024-0176GHSA-9x7f-gwxq-6f2cPYSEC-2024-149

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

Published Feb 1, 2024 · Updated Jun 17, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
vyperlang vyper <= 0.3.10 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI vyper < 0.4.0 0.4.0 GHSA-9x7f-gwxq-6f2c
PyPI vyper < 0.4.0b1 0.4.0b1 PYSEC-2024-149

References