Skip to content
Heist/ feed
Back to feed
High

Vyper vulnerable to OOB DynArray access when array is on both LHS and RHS of an assignment

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-31146
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 00:55 UTC · Revision 1

Source evidence

Vyper vulnerable to OOB DynArray access when array is on both LHS and RHS of an assignment

core-osv · Original source

Published 11 May 2023, 20:51 UTC

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.

osv:CVE-2023-31146
Complete source record
{
  "id": "3f017d4e7c33c6620c66b31ff1895005178b34086f766beba9d4a322b9182f8c",
  "url": "https://osv.dev/vulnerability/CVE-2023-31146",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Vyper vulnerable to OOB DynArray access when array is on both LHS and RHS of an assignment",
    "summary": "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.",
    "evidence": "osv:CVE-2023-31146",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-31146",
      "aliases": [
        "CVE-2023-31146",
        "GHSA-3p37-3636-q8wv",
        "PYSEC-2023-77"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/vyperlang/vyper",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "036f153683e0d55b890305eb4c77680a0872fcba"
                },
                {
                  "fixed": "4f8289a81206f767df1900ac48f485d90fc87edb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.3.8"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "4f8289a81206f767df1900ac48f485d90fc87edb"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.3.7",
            "v0.3.6",
            "v0.3.5",
            "v0.3.4",
            "pre-release",
            "v0.3.3",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.16",
            "v0.2.15",
            "v0.2.14",
            "v0.2.13",
            "v0.2.12",
            "v0.2.11",
            "v0.2.10",
            "v0.2.9",
            "v0.2.8",
            "v0.2.7",
            "v0.2.6",
            "v0.2.5",
            "v0.2.4",
            "v0.2.3",
            "v0.2.2",
            "v0.2.1",
            "0.2.1",
            "v0.2.0",
            "v0.1.0-beta.17",
            "v0.1.0-beta.16",
            "v0.1.0-beta.15",
            "v0.1.0-beta.14",
            "v0.1.0-beta.13",
            "v0.1.0-beta.12",
            "v0.1.0-beta.11",
            "v0.1.0-beta.10",
            "v0.1.0-beta.9",
            "v0.1.0-beta.8",
            "v0.1.0-beta.7",
            "v0.1.0-beta.6",
            "v0.1.0-beta.5",
            "v0.1.0-beta.3",
            "v0.1.0-beta.2",
            "v0.1.0-beta.1",
            "v0.0.4"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-31146.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.833216469Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/31xxx/CVE-2023-31146.json",
        "https://github.com/vyperlang/vyper/security/advisories/GHSA-3p37-3636-q8wv",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-31146",
        "https://github.com/vyperlang/vyper/commit/4f8289a81206f767df1900ac48f485d90fc87edb"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-787"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/31xxx/CVE-2023-31146.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-31146",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491371,
  "published_at": "2023-05-11T20:51:51.666+00:00"
}