Vyper has incorrect storage layout for contracts containing large arrays
CVE-2023-46247
7.5HIGH
What is CVE-2023-46247?
The Vyper Smart Contract Language for the Ethereum Virtual Machine contains a flaw in its calculation for determining the number of storage slots required for large arrays. Prior to version 0.3.8, the algorithm for calculating the storage needed using math.ceil(type_.size_in_bytes / 32) can result in inaccurate slot allocation due to floating-point precision errors. Specifically, this may lead to underallocation or overallocation of storage slots when dealing with arrays that are sized near a power of 2, which can compromise the integrity and functionality of smart contracts.
Affected Version(s)
vyper < 0.3.8
