CVE-2023-30837: vyper vulnerable to storage allocator overflow
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.37764%
CWE
Published
5/5/2023
Updated
11/19/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| vyper | pip | < 0.3.8 | 0.3.8 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from the storage allocator's lack of overflow checks. The commit diff shows:
- A new SimpleStorageAllocator class was added with explicit overflow checks
- The original set_storage_slots function used a simple counter (storage_slot += math.ceil(...)) without overflow protection
- The example exploit demonstrates that wrapping the storage slot calculation allowed overwriting the 'owner' variable
- Tests were added to validate overflow prevention (test_allocator_overflow) The core issue was in the storage position calculation logic handled by set_storage_slots, which failed to prevent 256-bit integer overflows during allocation.