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

High 7.5 Published Updated

An integer overflow in Vyper loop variables allows attackers to manipulate contract logic, potentially leading to unauthorized code execution in smart contracts.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-32058?

CVE-2023-32058 is a high-severity vulnerability in vyperlang vyper, published on 11 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-190

Which versions are affected by CVE-2023-32058?

3 open source packages ship an affected version, including vyper. It affects 1 product.

PackageAffectedFixed in
vyper PyPIAll versions0.3.8
vyper PyPIAll versions0.3.8
vyper PyPIAll versions0.3.8

Products include Vyperlang Vyper.

How do I fix CVE-2023-32058?

Upgrade vyper to 0.3.8 or later.

Is CVE-2023-32058 being exploited?

There is no known exploitation of CVE-2023-32058 in the wild and no public exploit code.

Sources

Also known as GHSA-6r8q-pfpv-7cgj, PYSEC-2023-78.

Is CVE-2023-32058 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free