GitHub Advisoryadvisory · PyPI

GHSA-j2x6-9323-fp7h Integer bounds error in Vyper

HIGH Published 2022-04-22 Modified 2022-04-22 Official page ↗
Aliases
CVE-2022-24845
Ecosystem
PyPI
Packages
vyper
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weaknesses
CWE-190
Reviewed
2022-04-22

Affected packages

• PyPI vyper: < 0.3.2 → fixed in 0.3.2

Description

Impact in the following code, the return of `.returns_int128()` is not validated to fall within the bounds of `int128`. as of v0.3.0, `.returns_int128()` is validated in simple expressions, but not complex expressions. ```vyper interface iface: def returns_int128() -> int128: view def returns_Bytes33() -> Bytes[33]: view x: iface @external def call_out(): x: int128 = self.x.returns_int128() # affected, = 0.3.0, <0.3.2 ``` Patches 0.3.2 (as of https://github.com/vyperlang/vyper/commit/049dbdc647b2ce838fae7c188e6bb09cf16e470b) Workarounds Break up operations involving external calls into multiple statements. For instance, instead of the example above, use ``` x: int128 = self.x.returns_int128() y: uint256 = convert(x, uint256) ```

Related

Alias · CVE (1)

  • CVE-2022-24845 Vyper is a pythonic Smart Contract Language for the ethereum virtual machine. vulnerability

Weakness · CWE (1)

  • CWE-190 Integer Overflow or Wraparound weakness

References