CVE-2024-32481: medium-severity vulnerability in vyperlang vyper
vyper's range(start, start + N) reverts for negative numbers
Published · Updated
E-mail alert when it lands in KEV, gets a public PoC or its score goes up.
No sign of exploitation. No public exploitation artifact known so far.
Vyper smart contracts using range loops with negative starting values will fail unexpectedly. This is a bug in how Vyper generates code for these loops, making them unusable when the start value is negative.
CWE-681 involves incorrect numeric comparison in Vyper's range() code generation for signed integers. When start is negative in range(start, start + N), the compiler incorrectly uses an unsigned comparison (le) instead of signed comparison (sle), causing the negative value to be interpreted as a large unsigned integer and the assertion to always fail, resulting in transaction revert.
In the same product, most dangerous first.