Skip to main content

CVE-2022-29255: CWE-670: Always-Incorrect Control Flow Implementation in vyperlang vyper

Medium
Published: Mon Jun 06 2022 (06/06/2022, 19:55:10 UTC)
Source: CVE
Vendor/Project: vyperlang
Product: vyper

Description

Vyper is a Pythonic Smart Contract Language for the ethereum virtual machine. In versions prior to 0.3.4 when a calling an external contract with no return value, the contract address (including side effects) could be evaluated twice. This may result in incorrect outcomes for contracts. This issue has been addressed in v0.3.4.

AI-Powered Analysis

AILast updated: 06/22/2025, 00:51:32 UTC

Technical Analysis

CVE-2022-29255 is a vulnerability identified in the Vyper programming language, a Pythonic smart contract language designed for the Ethereum Virtual Machine (EVM). The vulnerability affects versions of Vyper prior to 0.3.4. Specifically, when a smart contract written in Vyper calls an external contract that does not return a value, the contract address and any associated side effects may be evaluated twice due to an incorrect control flow implementation (classified under CWE-670: Always-Incorrect Control Flow Implementation). This double evaluation can lead to unintended behavior in the smart contract, potentially causing incorrect outcomes or logic errors. Since smart contracts often handle financial transactions or critical logic, such an error could result in loss of funds, incorrect state changes, or vulnerabilities exploitable by attackers. The issue was addressed and fixed in version 0.3.4 of Vyper. There are no known exploits in the wild at the time of reporting, and no CVSS score has been assigned to this vulnerability. The problem arises from the way Vyper handles external contract calls without return values, which is a subtle but critical aspect of smart contract execution flow and state management on the Ethereum blockchain.

Potential Impact

For European organizations utilizing Vyper to develop or deploy Ethereum smart contracts, this vulnerability poses a risk of contract malfunction or unintended behavior. Financial institutions, fintech companies, and blockchain service providers in Europe that rely on Vyper for smart contract development could face risks including incorrect transaction processing, loss of funds, or compromised contract logic integrity. Given the immutable nature of deployed smart contracts, any flawed contract logic due to this vulnerability could be difficult to rectify post-deployment, potentially leading to financial losses or reputational damage. Additionally, organizations involved in decentralized finance (DeFi), supply chain management, or digital identity solutions using Vyper-based contracts may experience disruptions or exploitation attempts if the vulnerability is present in their deployed contracts. Although no known exploits are reported, the potential for incorrect contract behavior makes it a medium-risk issue that requires prompt attention to prevent future exploitation or operational failures.

Mitigation Recommendations

European organizations should immediately audit their smart contracts developed with Vyper versions prior to 0.3.4 to identify any contracts that perform external calls without return values. It is critical to upgrade all Vyper development environments and toolchains to version 0.3.4 or later to incorporate the fix. For already deployed contracts, organizations should assess the feasibility of deploying patched contract versions or implementing compensating controls such as transaction monitoring and anomaly detection to identify unexpected contract behavior. Incorporating rigorous testing and formal verification methods focusing on external call handling can help detect similar control flow issues. Additionally, organizations should establish secure development lifecycle practices for smart contracts, including dependency management and vulnerability scanning for language compilers and tools. Collaboration with blockchain security auditors to review contracts for this specific flaw is recommended. Finally, educating developers about the implications of external calls and control flow in smart contracts will reduce the risk of introducing similar vulnerabilities in the future.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-04-13T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf65f0

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 12:51:32 AM

Last updated: 8/12/2025, 2:31:31 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats