Skip to main content
← All vulnerabilities
CVE-2024-24560GHSA-GP3W-2V2M-P686PYSEC-2024-148

Vyper external calls can overflow return data to return input buffer

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 0.4.0, 0.4.0b1
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: yes
  • Technical impact: partial

Summary

Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. When calls to external contracts are made, we write the input buffer starting at byte 28, and allocate the return buffer to start at byte 0 (overlapping with the input buffer). When checking RETURNDATASIZE for dynamic types, the size is compared only to the minimum allowed size for that type, and not to the returned value's length. As a result, malformed return data can cause the contract to mistake data from the input buffer for returndata. When the called contract returns invalid ABIv2 encoded data, the calling contract can read different invalid data (from the dirty buffer) than the called contract returned.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: yes · Technical impact: partial

  3. Record last updated

Affected versions

  • vyperlang vyper

    through 0.3.10

  • vyperPyPI

    fixed in 0.4.0

  • vyperPyPI

    fixed in 0.4.0b1

References 1

GitHub · vyperlang/vyper