{"id":"CVE-2024-22419","published":"2024-01-18T18:45:55Z","modified":"2025-06-02T15:03:38Z","title":"concat built-in can corrupt memory in vyper","vendor":"vyperlang","product":"vyper","tier":"tail","description":{"text":"Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. The `concat` built-in can write over the bounds of the memory buffer that was allocated for it and thus overwrite existing valid data. The root cause is that the `build_IR` for `concat` doesn't properly adhere to the API of copy functions (for `>=0.3.2` the `copy_bytes` function). A contract search was performed and no vulnerable contracts were found in production. The buffer overflow can result in the change of semantics of the contract. The overflow is length-dependent and thus it might go unnoticed during contract testing. However, certainly not all usages of concat will result in overwritten valid data as we require it to be in an internal function and close to the return statement where other memory allocations don't occur. This issue has been addressed in 0.4.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.3,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01014,"percentile":0.62249,"provenance":"source"},"cwes":[{"id":"CWE-120","name":"Buffer Copy without Checking Size of Input"}],"references":[{"url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-2q8v-3gqq-4f8p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/vyperlang/vyper/issues/3737","tags":["x_refsource_MISC"]},{"url":"https://github.com/vyperlang/vyper/commit/55e18f6d128b2da8986adbbcccf1cd59a4b9ad6f","tags":["x_refsource_MISC"]}],"priority":{"score":17.6,"factors":[{"name":"EPSS percentile","points":12.45},{"name":"CVSS severity","points":5.11}]},"vendorSlug":"vyperlang","affectedVersions":[{"vendor":"vyperlang","product":"vyper","versions":["< 0.4.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-05-08T15:34:44.069747Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"vyper","vulnerableRanges":[">=0.3.0, <0.4.0","<0.4.0b1"],"patched":["0.4.0","0.4.0b1"],"from":["GHSA-2q8v-3gqq-4f8p","PYSEC-2024-103"],"provenance":"source"}],"summary":{"text":"The concat built-in in Vyper, the Pythonic smart contract language for the Ethereum Virtual Machine, can write past the bounds of the memory buffer allocated for it, because its code generation does not correctly follow the copy-function API (copy_bytes in versions 0.3.2 and later). An attacker can trigger this through a contract's use of concat inside an internal function near a return statement, where overwriting existing valid memory can change the contract's behaviour; the overflow is length-dependent, so it may pass testing unnoticed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:14:01Z"},"euvd":{"id":"EUVD-2024-0173","exploited":false,"provenance":"source"}}