Publish Advisories

GHSA-9p8r-4xp4-gw5w
GHSA-gp3w-2v2m-p686
This commit is contained in:
advisory-database[bot]
2024-06-18 15:18:03 +00:00
parent e53f549f13
commit 54a81e2a34
2 changed files with 6 additions and 6 deletions
@@ -1,13 +1,13 @@
{
"schema_version": "1.4.0",
"id": "GHSA-9p8r-4xp4-gw5w",
"modified": "2024-02-26T22:06:28Z",
"modified": "2024-06-18T15:16:24Z",
"published": "2024-02-26T20:11:07Z",
"aliases": [
"CVE-2024-26149"
],
"summary": "Vyper's `_abi_decode` vulnerable to Memory Overflow",
"details": "## Summary\n\nIf 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.\n\n## Proof of Concept\n\n```vyper\nevent Pwn:\n pass\n\n@external\ndef f(x: Bytes[32 * 3]):\n a: Bytes[32] = b\"foo\"\n y: Bytes[32 * 3] = x\n\n decoded_y1: Bytes[32] = _abi_decode(y, Bytes[32])\n a = b\"bar\"\n decoded_y2: Bytes[32] = _abi_decode(y, Bytes[32])\n\n if decoded_y1 != decoded_y2:\n log Pwn()\n```\n\nSending the following calldata results in `Pwn` being emitted. \n\n```\n0xd45754f8\n0000000000000000000000000000000000000000000000000000000000000020\n0000000000000000000000000000000000000000000000000000000000000060\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0\n```",
"details": "## Summary\n\nIf 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.\n\n## Proof of Concept\n\n```vyper\nevent Pwn:\n pass\n\n@external\ndef f(x: Bytes[32 * 3]):\n a: Bytes[32] = b\"foo\"\n y: Bytes[32 * 3] = x\n\n decoded_y1: Bytes[32] = _abi_decode(y, Bytes[32])\n a = b\"bar\"\n decoded_y2: Bytes[32] = _abi_decode(y, Bytes[32])\n\n if decoded_y1 != decoded_y2:\n log Pwn()\n```\n\nSending the following calldata results in `Pwn` being emitted. \n\n```\n0xd45754f8\n0000000000000000000000000000000000000000000000000000000000000020\n0000000000000000000000000000000000000000000000000000000000000060\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0\n```\n\n### Patches\nPatched 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.",
"severity": [
{
"type": "CVSS_V3",
@@ -28,7 +28,7 @@
"introduced": "0"
},
{
"last_affected": "0.3.10"
"fixed": "0.4.0"
}
]
}
File diff suppressed because one or more lines are too long