Buffer Overflow Affecting vyper package, versions [,0.3.8)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.08% (35th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-VYPER-5498580
  • published7 May 2023
  • disclosed5 May 2023
  • creditToonVanHove, trocher

Introduced: 5 May 2023

CVE-2023-30837  (opens in a new tab)
CWE-120  (opens in a new tab)

How to fix?

Upgrade vyper to version 0.3.8 or higher.

Overview

vyper is a Pythonic Smart Contract Language for the EVM.

Affected versions of this package are vulnerable to Buffer Overflow. The storage allocator does not guard against allocation overflows.

PoC

owner: public(address)
take_up_some_space: public(uint256[10])
buffer: public(uint256[max_value(uint256)])

@external
def initialize():
    self.owner = msg.sender

@external
def foo(idx: uint256, data: uint256):
    self.buffer[idx] = data

References

CVSS Scores

version 3.1