Quick answers
- Is CVE-2023-41052 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2023-41052 being exploited in the wild.
- How severe is CVE-2023-41052?
- Medium severity, with a CVSS score of 5.3, published 4 September 2023.
- Which products and versions are affected?
- vyper (PyPI) < 0.3.10, ECOSYSTEM:introduced=0,fixed=0.3.10, ECOSYSTEM:introduced=0,fixed=0.3.10rc1.
- Is there a fix for CVE-2023-41052?
- Yes. vyper (PyPI): upgrade to 0.3.10, 0.3.10rc1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2023-41052 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2023-41052?
- Check whether you run vyper (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- vyper (PyPI): upgrade to 0.3.10, 0.3.10rc1 or later
pip install "vyper>=0.3.10rc1"
Technical details
This vulnerability is a compiler bug in Vyper's code generation for four builtin functions. For uint256_addmod(a,b,c) and uint256_mulmod(a,b,c), the compiler evaluates arguments in order c,a,b instead of a,b,c. For ecadd(a,b) and ecmul(a,b), it evaluates b,a instead of a,b. This violates the expected left-to-right evaluation order defined in the Vyper specification. The issue manifests as problematic behavior when arguments with side effects (state mutations, external contract calls) are used and subsequent arguments depend on those side effects. An attacker could craft a contract that exploits this reordering to manipulate the logic of vulnerable contracts. The vulnerability affects all Vyper versions before 0.3.10, and is patched in version 0.3.10 via PR #3583.
Affected products
- Vyper Vyper < 0.3.10
Identifiers
- CVE-2023-41052
- GHSA-4hg4-9mf5-wxxq
- PYSEC-2023-168
Timeline
- 2023-09-04: disclosed
- 2023-09-04: patched: Version 0.3.10 released with fix via PR #3583