CVE-2024-26149: Vyper's `_abi_decode` vulnerable to Memory Overflow
Summary If an excessively large value is specified as the starting index for an array in abidecode, it can cause the read position to overflow. This results in the decoding of values outside the intended array bounds, potentially leading to bugs in contracts that use arrays within abidecode.
Published Feb 26, 2024 · Updated Mar 20, 2026
Affected packages
vyper
- Ecosystem
- PyPI
- Affected
- < 0.4.0
- Fixed in
- 0.4.0
- Check
pip show vyper
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
If an excessively large value is specified as the starting index for an array in _abi_decode, it can cause the read position to overflow. This results in the decoding of values outside the intended array bounds, potentially leading to bugs in contracts that use arrays within _abi_decode. The advisory has been assigned low severity, because it is only observable if there is a memory write between two invocations of abi_decode on the same input.
Proof of Concept
event Pwn:
pass
@external
def f(x: Bytes[32 * 3]):
a: Bytes[32] = b"foo"
y: Bytes[32 * 3] = x
decoded_y1: Bytes[32] = _abi_decode(y, Bytes[32])
a = b"bar"
decoded_y2: Bytes[32] = _abi_decode(y, Bytes[32])
if decoded_y1 != decoded_y2:
log Pwn()Sending the following calldata results in Pwn being emitted.
0xd45754f8
0000000000000000000000000000000000000000000000000000000000000020
0000000000000000000000000000000000000000000000000000000000000060
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0Patches
Patched in https://github.com/vyperlang/vyper/pull/3925, https://github.com/vyperlang/vyper/pull/4091, https://github.com/vyperlang/vyper/pull/4144, https://github.com/vyperlang/vyper/pull/4060.
Credited to minaminao-osec.
References
- https://github.com/vyperlang/vyper/security/advisories/GHSA-9p8r-4xp4-gw5w
- https://nvd.nist.gov/vuln/detail/CVE-2024-26149
- https://github.com/vyperlang/vyper/pull/3925
- https://github.com/vyperlang/vyper/pull/4060
- https://github.com/vyperlang/vyper/pull/4091
- https://github.com/vyperlang/vyper/pull/4144
- https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-164.yaml
- https://github.com/advisories/GHSA-9p8r-4xp4-gw5w
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesGHSA-2r3x-4mrv-mcxf
Vyper: Memory corruption using function calls within tuples / nested calls
medium6.9Oct 6, 2026GHSA-4v7v-gqf9-ww2g
Vyper: Call stack corruption when passing complex type containing non-base type members as argument
medium6.9Oct 6, 2026GHSA-vg88-3v92-rjx2
Vyper: Return inside for loop more than 1 level deep
medium6.3Oct 6, 2026CVE-2025-47285
Vyper's `concat()` builtin may elide side-effects for zero-length arguments
low2.9No fixMay 16, 2025CVE-2025-47774
Vyper's `slice()` may elide side-effects when output length is 0
low2.9No fixMay 16, 2025CVE-2025-26622
Vyper's sqrt doesn't define rounding behavior
low2.3Feb 21, 2025
