Vyper external calls can overflow return data to return input buffer
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2024-24560
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 23:33 UTC · Revision 1
Source evidence
Vyper external calls can overflow return data to return input buffer
core-osv · Original sourcePublished 2 Feb 2024, 16:19 UTC
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.
osv:CVE-2024-24560
Complete source record
{
"id": "d28960f146bc8570968d1263da45404c500395e436b6a6fcd71638c54ba6b365",
"url": "https://osv.dev/vulnerability/CVE-2024-24560",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Vyper external calls can overflow return data to return input buffer",
"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.",
"evidence": "osv:CVE-2024-24560",
"products": [],
"severity": "low",
"structured": {
"id": "CVE-2024-24560",
"aliases": [
"CVE-2024-24560",
"GHSA-gp3w-2v2m-p686",
"PYSEC-2024-148"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/vyperlang/vyper",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"last_affected": "9136169468f317a53b4e7448389aa315f90b95ba"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"last_affected": "0.3.10"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"cpe": "cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:python:*:*",
"range": [
{
"introduced": "0"
},
{
"last_affected": "0.3.10"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v0.3.10",
"v0.3.10rc5",
"v0.3.10rc4",
"v0.3.10rc3",
"v0.3.10rc2",
"v0.3.10rc1",
"v0.3.9",
"v0.3.8",
"v0.3.7",
"v0.3.6",
"v0.3.5",
"v0.3.4",
"pre-release",
"v0.3.3",
"v0.3.2",
"v0.3.1",
"v0.3.0",
"v0.2.16",
"v0.2.15",
"v0.2.14",
"v0.2.13",
"v0.2.12",
"v0.2.11",
"v0.2.10",
"v0.2.9",
"v0.2.8",
"v0.2.7",
"v0.2.6",
"v0.2.5",
"v0.2.4",
"v0.2.3",
"v0.2.2",
"v0.2.1",
"0.2.1",
"v0.2.0",
"v0.1.0-beta.17",
"v0.1.0-beta.16",
"v0.1.0-beta.15",
"v0.1.0-beta.14",
"v0.1.0-beta.13",
"v0.1.0-beta.12",
"v0.1.0-beta.11",
"v0.1.0-beta.10",
"v0.1.0-beta.9",
"v0.1.0-beta.8",
"v0.1.0-beta.7",
"v0.1.0-beta.6",
"v0.1.0-beta.5",
"v0.1.0-beta.3",
"v0.1.0-beta.2",
"v0.1.0-beta.1",
"v0.0.4"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-24560.json"
}
}
],
"modified": "2026-10-28T02:30:40.512158581Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/24xxx/CVE-2024-24560.json",
"https://github.com/vyperlang/vyper/security/advisories/GHSA-gp3w-2v2m-p686",
"https://nvd.nist.gov/vuln/detail/CVE-2024-24560"
],
"provider_metadata": {
"cwe_ids": [
"CWE-119"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/24xxx/CVE-2024-24560.json"
}
},
"related_cves": [
{
"value": "CVE-2024-24560",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 508005,
"published_at": "2024-02-02T16:19:45.822+00:00"
}