Insufficient Control Flow Management Affecting vyper package, versions [0.3.8,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

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-10183408
  • published19 May 2025
  • disclosed16 May 2025
  • creditGinoah Chu

Introduced: 16 May 2025

NewCVE-2025-47285  (opens in a new tab)
CWE-691  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

vyper is a Pythonic Smart Contract Language for the EVM.

Affected versions of this package are vulnerable to Insufficient Control Flow Management through optimization in the concat function. An attacker can skip evaluation of side effects when the length of an argument provided to the function is zero.

Note: This is only exploitable if unusual user-code patterns are used, such as constructing zero-length bytestrings with side effects using the ternary operator introduced in v0.3.8.

PoC

counter: public(uint256)

@external
def test() -> Bytes[256]:
    a: Bytes[256] = concat(b"" if self.sideeffect() else b"", b"aaaa")
    return a

def sideeffect() -> bool:
    self.counter += 1
    return True

CVSS Base Scores

version 4.0
version 3.1