VAITP Dataset

← Back to the dataset

CVE-2023-30837

Storage allocation overflow vulnerability in Vyper (before version 0.3.8)

  • CVSS 7.5
  • CWE-789
  • Design Defects
  • Remote

Vyper is a pythonic smart contract language for the EVM. The storage allocator does not guard against allocation overflows in versions prior to 0.3.8. An attacker can overwrite the owner variable. This issue was fixed in version 0.3.8.

CVSS base score
7.5
Published
2023-05-08
OWASP
A04 Insecure Design
Orthogonal defect classification
Assignment
Code defect classification
Incorrect Assignment
Category
Design Defects
Subcategory
Inadequate Error Handling
Accessibility scope
Remote
Impact
Unauthorized Access
Fixed by upgrading
Yes

Solution

Update to Vyper version 0.3.8 or higher

Vulnerable code sample

owner: public(address)
data: public(uint256)

@public
def set_data(new_data: uint256):
    self.data = new_data

@public
def set_owner(new_owner: address):
    self.owner = new_owner

Patched code sample

owner: public(address)
data: public(uint256)

@public
def set_data(new_data: uint256):
    assert new_data >= 0
    self.data = new_data

@public
def set_owner(new_owner: address):
    assert new_owner != ZERO_ADDRESS
    self.owner = new_owner

Cite this entry

@misc{vaitp:cve202330837,
  title        = {{Storage allocation overflow vulnerability in Vyper (before version 0.3.8)}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2023},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2023-30837},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-30837/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::