Quick answers
- Is CVE-2023-31146 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2023-31146 being exploited in the wild.
- How severe is CVE-2023-31146?
- Low severity, with a CVSS score of 3.1, published 11 May 2023.
- Which products and versions are affected?
- vyper (PyPI) ECOSYSTEM:introduced=0,fixed=0.3.8, GIT:introduced=0,fixed=4f8289a81206f767df1900ac48f485d90fc87edb|ECOSYSTEM:introduced=0,fixed=0.3.8.
- Is there a fix for CVE-2023-31146?
- Yes. vyper (PyPI): upgrade to 0.3.8 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2023-31146 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2023-31146?
- 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.8 or later
pip install "vyper>=0.3.8"
Technical details
This is a code generation (codegen) vulnerability affecting Vyper's handling of DynArray (dynamic array) assignments. When a DynArray is used on both the left-hand side (LHS) and right-hand side (RHS) of an assignment, the compiler writes the array's length metadata before validating bounds, leading to out-of-bounds memory access. The vulnerability affects operations like `a = [a[0], a[1], a[2]]` on empty or smaller arrays, including combinations with append() and pop() methods. No special privileges or network access required—any contract code compiled with vulnerable versions will exhibit the flaw. The issue was patched in version 0.3.8 (commit 4f8289a).
Affected products
- Vyper Vyper < 0.3.8
Identifiers
- CVE-2023-31146
- GHSA-3p37-3636-q8wv
- PYSEC-2023-77
Timeline
- 2023-05-11: disclosed
- 2023-05-12: patched: Fixed in version 0.3.8 (commit 4f8289a)