CVE-2022-24788: Buffer Overflow in vyper

vyper Updated 02 Oct 2025

Summary

20/04/2022
Yes i
High
7.1

CVE-2022-24788: Buffer Overflow in vyper. Affects vyper versions < 0.3.2. Fixed in 0.3.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Vyper is a Python-based programming language specifically designed for writing smart contracts on the Ethereum blockchain. It offers a simplified syntax and aims to enhance security by eliminating common pitfalls in Solidity, the predominant language for Ethereum smart contracts. However, a vulnerability has been discovered in Vyper that can lead to a buffer overflow when importing a function from a JSON interface that returns bytes. This vulnerability can potentially result in a buffer overrun, compromising the integrity and stability of the affected system.

Vulnerability Detail

The vulnerability arises from the generation of bytecode that does not clamp the length of returned bytes. As a result, an attacker could exploit this oversight to overflow the buffer, potentially leading to arbitrary code execution or denial of service attacks. The impact of this vulnerability is classified as HIGH, with a CVSS score of 7.1. The vulnerability is identified as CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer) and CWE-120 (Buffer Copy without Checking Size of Input).

How To Fix

Latest published version: 0.4.3 as of 22 Oct 2026

pip install --upgrade "vyper==0.4.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.3.2

This is the first release that contains the fix.

pip install --upgrade "vyper==0.3.2"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the Vyper package is not immediately feasible, a workaround is to use .vy interfaces instead of importing functions from a JSON interface that returns bytes. By utilizing .vy interfaces, the bytecode generation will properly handle the length of returned bytes, mitigating the risk of buffer overflows.

Conclusion

In conclusion, the Vyper package is vulnerable to a buffer overflow when importing functions from a JSON interface that returns bytes. This vulnerability can have severe consequences, including arbitrary code execution and denial of service attacks. It is crucial to update the Vyper package to version 0.3.2 or later to mitigate this vulnerability. Alternatively, using .vy interfaces can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for vyper →

Share this vulnerability

FAQ

Vyper is a Python-based programming language designed for writing smart contracts on the Ethereum blockchain. It aims to enhance security and eliminate common pitfalls in Solidity.

The vulnerability can lead to a buffer overflow, potentially resulting in arbitrary code execution or denial of service attacks.

Update the Vyper package to version 0.3.2 or later. The fix has been implemented in commit 049dbdc647b2ce838fae7c188e6bb09cf16e470b.

Yes, you can use .vy interfaces instead of importing functions from a JSON interface that returns bytes.

The CVSS score of this vulnerability is 7.1, indicating a high severity.

Related vulnerabilities

Recent vulnerabilities recorded for vyper.

How To Fix

Latest published version: 0.4.3 as of 22 Oct 2026

pip install --upgrade "vyper==0.4.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.3.2

This is the first release that contains the fix.

pip install --upgrade "vyper==0.3.2"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback