{"id":"CVE-2023-39363","aliases":["GHSA-5824-cm3x-3c38","PYSEC-2023-142"],"title":"Vyper has incorrectly allocated named re-entrancy locks","summary":"Vyper has incorrectly allocated named re-entrancy locks","severity":"high","cvss":8.7,"cvssVector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:H","vendor":"vyper","product":"vyper","ecosystem":"pip","affected":["vyper >= 0.2.15, < 0.3.1"],"patched":["vyper 0.3.1"],"published":"2023-08-09","updated":"2026-09-10","sourceUpdated":"2026-09-10T03:49:57.451549676Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-5824-cm3x-3c38","references":[{"url":"https://github.com/vyperlang/vyper/security/advisories/GHSA-5824-cm3x-3c38"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39363"},{"url":"https://github.com/vyperlang/vyper/pull/2439"},{"url":"https://github.com/vyperlang/vyper/pull/2514"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2023-142.yaml"},{"url":"https://github.com/vyperlang/vyper"},{"url":"https://hackmd.io/@LlamaRisk/BJzSKHNjn"},{"url":"https://hackmd.io/@vyperlang/HJUgNMhs2"}],"tags":["osv","pip"],"epss":0.00821,"epssPercentile":0.55418,"ingestedAt":"2026-09-12T03:13:01.659Z","slug":"CVE-2023-39363","body":"## Overview\n\n### Impact\n\nIn versions 0.2.15, 0.2.16 and 0.3.0, named re-entrancy locks are allocated incorrectly. Each function using a named re-entrancy lock gets a unique lock regardless of the key, allowing cross-function re-entrancy in contracts compiled with the susceptible versions. A specific set of conditions is required to result in misbehavior of affected contracts, specifically:\n\n- A `.vy` contract compiled with either of the following `vyper` versions: `0.2.15`, `0.2.16`, `0.3.0`\n- A primary function that utilizes the `@nonreentrant` decorator with a specific `key` and does not strictly follow the check-effects-interaction pattern (i.e. contains an external call to an untrusted party before storage updates)\n- A secondary function that utilizes the same `key` and would be affected by the improper state caused by the primary function\n\n### Patches\nhttps://github.com/vyperlang/vyper/pull/2439, https://github.com/vyperlang/vyper/pull/2514\n\n### Workarounds\nUpgrade to 0.3.1 or higher\n\n### References\nTechnical post-mortem report: https://hackmd.io/@vyperlang/HJUgNMhs2\n\n## Affected packages\n\n- `vyper >= 0.2.15, < 0.3.1`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `vyper 0.3.1`","depth":"twilight","depthScore":48,"depthScoreParts":{"impact":47.8,"likelihood":0.2,"exploitation":0,"ransomware":0},"changes":[]}