Always-Incorrect Control Flow Implementation Affecting vyper package, versions [,0.3.10rc1)


Severity

Recommended
0.0
low
0
10

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

Threat Intelligence

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-5880667
  • published5 Sept 2023
  • disclosed4 Sept 2023
  • credittrocher

Introduced: 4 Sep 2023

CVE-2023-41052  (opens in a new tab)
CWE-670  (opens in a new tab)

How to fix?

Upgrade vyper to version 0.3.10rc1 or higher.

Overview

vyper is a Pythonic Smart Contract Language for the EVM.

Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation. The order of evaluation of the arguments of the builtin functions uint256_addmod, uint256_mulmod, ecadd and ecmul does not follow source order.

  1. For uint256_addmod(a,b,c) and uint256_mulmod(a,b,c), the order is c,a,b.

  2. For ecadd(a,b) and ecmul(a,b), the order is b,a.

Note:

This behaviour is problematic when the evaluation of one of the arguments produces side effects that other arguments depend on.

Mitigation:

When using builtins from the list above, users need to make sure that the arguments of the expression do not produce side effects or, if one does, that no other argument is dependent on those side effects.

CVSS Scores

version 3.1