Vulnerability · Published May 11, 2023 · Assigned by GitHub_M

CVE-2023-32058Vyper vulnerable to integer overflow in loop

High 7.5

In plain English

A high-severity integer overflow in vyper from vyperlang. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.9% (higher than 60% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)0.9%top 39.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Vyper is a Pythonic smart contract language for the Ethereum virtual machine. Prior to version 0.3.8, due to missing overflow check for loop variables, by assigning the iterator of a loop to a variable, it is possible to overflow the type of the latter. The issue seems to happen only in loops of type `for i in range(a, a + N)` as in loops of type `for i in range(start, stop)` and `for i in range(stop)`, the compiler is able to raise a `TypeMismatch` when trying to overflow the variable. The problem has been patched in version 0.3.8.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIvyper0.3.8GHSA-6r8q-pfpv-7cgj
PyPIvyper0.3.8PYSEC-2023-78

Affected products (as reported)

VendorProductVersions
vyperlang vyper < 0.3.8

Weakness: CWE-190 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References