Miggo Logo

CVE-2024-24563:
Vyper negative array index bounds checks

9.8

CVSS Score

Basic Information

EPSS Score
-
Published
2/7/2024
Updated
11/22/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
vyperpip< 0.4.00.4.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key points:

  1. Typechecker weakness: The validate_index_type function in subscriptable.py validates against IntegerT.any() instead of requiring unsigned integers, allowing signed indexes.
  2. Runtime validation flaw: The bounds checking logic in core.py uses unsigned comparisons that interpret negative values as large positive numbers, enabling bypass when arrays are declared with lengths >= 2^255. The combination of these two flaws allows negative array indexing in specific scenarios. Both functions are directly referenced in vulnerability details and PoC code, with clear technical explanations in the provided code comments and advisory descriptions.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry *rr*ys **n ** k*y** *y * si*n** int***r, w*il* t**y *r* ***in** *or unsi*n** int***rs only. T** typ*****k*r *o*sn't t*row w**n spottin* t** us*** o* *n `int` *s *n in**x *or *n *rr*y. Typi**lly, n***tiv* int***rs *r* *ilt*r** out *t runti

Reasoning

T** vuln*r**ility st*ms *rom two k*y points: *. Typ*****k*r w**kn*ss: T** v*li**t*_in**x_typ* *un*tion in su*s*ript**l*.py v*li**t*s ***inst Int***rT.*ny() inst*** o* r*quirin* unsi*n** int***rs, *llowin* si*n** in**x*s. *. Runtim* v*li**tion *l*w: T