Vyper incorrectly allocated named re-entrancy locks
Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). In 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: a `.vy` contract compiled with `vyper` versions `0.2.15`, `0.2.16`, or `0.3.0`; 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); and a secondary function that utilizes the same `key` and would be affected by the improper state caused by the primary function. Version 0.3.1 contains a fix for this issue.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2023-39363
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 14:58 UTC · Revision 1
Source evidence
Vyper incorrectly allocated named re-entrancy locks
core-osv · Original sourcePublished 7 Aug 2023, 18:40 UTC
Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). In 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: a `.vy` contract compiled with `vyper` versions `0.2.15`, `0.2.16`, or `0.3.0`; 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); and a secondary function that utilizes the same `key` and would be affected by the improper state caused by the primary function. Version 0.3.1 contains a fix for this issue.
osv:CVE-2023-39363
Complete source record
{
"id": "efcda54db882f0c1b32e2ae8538576eff4bb54563a125ae26d10efa45744bebb",
"url": "https://osv.dev/vulnerability/CVE-2023-39363",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Vyper incorrectly allocated named re-entrancy locks",
"summary": "Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM). In 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: a `.vy` contract compiled with `vyper` versions `0.2.15`, `0.2.16`, or `0.3.0`; 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); and a secondary function that utilizes the same `key` and would be affected by the improper state caused by the primary function. Version 0.3.1 contains a fix for this issue.",
"evidence": "osv:CVE-2023-39363",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2023-39363",
"aliases": [
"CVE-2023-39363",
"GHSA-5824-cm3x-3c38",
"PYSEC-2023-142"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:H/SA:H/E:A"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/vyperlang/vyper",
"type": "GIT",
"events": [
{
"introduced": "6e7dba7a8b5f29762d3470da4f44634b819c808d"
},
{
"last_affected": "8a23febbb2d523f3701f9a7d0aaf361c104a2a37"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "= 0.2.15"
},
{
"last_affected": "= 0.2.15"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "= 0.2.16"
},
{
"last_affected": "= 0.2.16"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "= 0.3.0"
},
{
"last_affected": "= 0.3.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"cpe": "cpe:2.3:a:vyperlang:vyper:0.2.15:*:*:*:*:python:*:*",
"range": [
{
"introduced": "0.2.15"
},
{
"last_affected": "0.2.15"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:vyperlang:vyper:0.2.16:*:*:*:*:python:*:*",
"range": [
{
"introduced": "0.2.16"
},
{
"last_affected": "0.2.16"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:vyperlang:vyper:0.3.0:*:*:*:*:python:*:*",
"range": [
{
"introduced": "0.3.0"
},
{
"last_affected": "0.3.0"
}
],
"source": "CPE_STRING"
}
]
}
}
],
"versions": [
"0.2.15",
"0.2.16",
"0.3.0",
"= 0.2.15",
"= 0.2.16",
"= 0.3.0",
"v0.3.0",
"v0.2.16",
"v0.2.15"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-39363.json"
}
}
],
"modified": "2026-10-28T02:30:30.076966957Z",
"provider": "osv",
"references": [
"https://hackmd.io/@LlamaRisk/BJzSKHNjn",
"https://hackmd.io/@vyperlang/HJUgNMhs2",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/39xxx/CVE-2023-39363.json",
"https://github.com/vyperlang/vyper/security/advisories/GHSA-5824-cm3x-3c38",
"https://nvd.nist.gov/vuln/detail/CVE-2023-39363",
"https://github.com/vyperlang/vyper/pull/2439",
"https://github.com/vyperlang/vyper/pull/2514"
],
"provider_metadata": {
"cwe_ids": [
"CWE-863"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/39xxx/CVE-2023-39363.json"
}
},
"related_cves": [
{
"value": "CVE-2023-39363",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 496601,
"published_at": "2023-08-07T18:40:25.615+00:00"
}