CVE-2024-24563CWE-129

Vyper array negative index vulnerability

Critical ยท published February 7, 2024

CVSS v3.1
9.8
EPSS
2%
Percentile
74.7
In the wild
Unconfirmed
What it is

โš ๏ธ Watch out for unexpected behaviors! In Vyper, indexing arrays with signed integers can lead to some seriously unpredictable results โ€“ it's like using a negative room number in a hotel. ๐Ÿค”๐Ÿ” Think of a hotel where guests can book rooms not only by their number but also using negative numbers. A guest trying to check into room -1 expects nothing to happen, but the system sees room 999 and checks them in โ€“ chaos ensues! This critical vulnerability could lead to catastrophic consequences. Attackers might find ways to access elements they shouldn't, causing unpredictable behavior in smart contracts. Worst case? They could force a denial of service, making your contract inaccessible when the state is manipulated. The potential for financial loss is absolutely devastating! ๐Ÿ”ฅ

Put simply

Think of a hotel where guests can book rooms not only by their number but also using negative numbers. A guest trying to check into room -1 expects nothing to happen, but the system sees room 999 and checks them in โ€“ chaos ensues! In Vyper, the typechecker doesn't flag signed integers as invalid indexes for arrays, which should only accept unsigned integers. As such, negative integers can be treated as large unsigned values, leading to unexpected behavior and potential exploitation through array access violations.

What to do

This critical vulnerability could lead to catastrophic consequences. Attackers might find ways to access elements they shouldn't, causing unpredictable behavior in smart contracts. Worst case? They could force a denial of service, making your contract inaccessible when the state is manipulated. The potential for financial loss is absolutely devastating! ๐Ÿ”ฅ Developers must be vigilant! Review any usages of array indexes in your contracts, ensuring that only unsigned integers are utilized. Until a fixed version is released, consider implementing manual checks or constraints to prevent negative indexing. Documentation and community forums could provide interim guidance! ๐Ÿš€ You've got this! Stay proactive and keep your Vyper contracts safe while awaiting an official fix. ๐Ÿ›ก๏ธ

The record
Technical detail
CVSS v3.1
9.8 ยท CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01539 ยท 74.7th percentile
Weakness
CWE-129 ยท Improper Validation of Array Index
Published
2024-02-07T17:10Z
EPSS history
Timeline
  • 07 FEB 17:10Z
    Vyper array negative index vulnerability
    cvelistv5