CVE-2024-26149
LOW3.7EPSS 0.59%Vyper's `_abi_decode` vulnerable to Memory Overflow
描述
## 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 ```vyper 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 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0 ``` ### Patches 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.
受影響套件(2)
- PyPI/vyperfrom 0, < 0.4.0
- PyPI/vyperfrom 0, < 0.4.0b1
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| osv | CVSS 3.1 | LOW3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N |
參考連結(8)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2024-26149
- PATCHhttps://github.com/vyperlang/vyper
- WEBhttps://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2024-164.yaml
- WEBhttps://github.com/vyperlang/vyper/pull/3925
- WEBhttps://github.com/vyperlang/vyper/pull/4060
- WEBhttps://github.com/vyperlang/vyper/pull/4091
- WEBhttps://github.com/vyperlang/vyper/pull/4144
- WEBhttps://github.com/vyperlang/vyper/security/advisories/GHSA-9p8r-4xp4-gw5w