
Cloud Vulnerability DB
A community-led vulnerabilities database
Vyper, a Pythonic Smart Contract Language for the Ethereum Virtual Machine, contains a vulnerability in its concat built-in function that can write beyond the bounds of the allocated memory buffer and overwrite existing valid data. The vulnerability (CVE-2024-22419) affects versions up to and including 0.3.10. 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) (GitHub Advisory).
The vulnerability stems from the build_IR function's memory allocation process. When allocating a new internal variable for concatenation, the buffer is allocated for maxlen + 1 word to hold the array length. However, the copy_bytes function may pad to ceil32 of the length, potentially copying an entire 32-byte word even when copying just 1 byte. This can lead to buffer overflow when the destination data's distance to the end of the concat data buffer is less than 32 bytes, resulting in memory corruption (GitHub Advisory).
The buffer overflow can alter the contract's semantics, particularly when the concat operation is used within internal functions. The overflow is length-dependent and might go unnoticed during contract testing. However, the impact is limited to specific scenarios where concat is used in an internal function and close to the return statement where other memory allocations don't occur. A contract search was performed, and no vulnerable contracts were found in production (GitHub Advisory).
The vulnerability has been fixed in Vyper version 0.4.0. Users are advised to upgrade to this version when possible. The fix was implemented through commit 55e18f6d1 which properly handles the memory allocation and copying process (GitHub Advisory, GitHub Commit).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."