Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. vyper
  4. ›
  5. CVE-2024-24561

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

February 1, 2024 (updated November 22, 2024)

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.

A contract search was performed and no vulnerable contracts were found in production.

tracking in issue https://github.com/vyperlang/vyper/issues/3756. patched in https://github.com/vyperlang/vyper/pull/3818.

References

  • github.com/advisories/GHSA-9x7f-gwxq-6f2c
  • github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-149.yaml
  • github.com/vyperlang/vyper
  • github.com/vyperlang/vyper/blob/b01cd686aa567b32498fefd76bd96b0597c6f099/vyper/builtins/functions.py
  • github.com/vyperlang/vyper/issues/3756
  • github.com/vyperlang/vyper/security/advisories/GHSA-9x7f-gwxq-6f2c
  • nvd.nist.gov/vuln/detail/CVE-2024-24561

Code Behaviors & Features

Detect and mitigate CVE-2024-24561 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.4.0

Fixed versions

  • 0.4.0

Solution

Upgrade to version 0.4.0 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer

Source file

pypi/vyper/CVE-2024-24561.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:44 +0000.