CVE-2023-39363
Python vulnerability analysis and mitigation

Overview

Vyper, a Pythonic Smart Contract Language for the Ethereum Virtual Machine (EVM), contained a critical vulnerability in versions 0.2.15, 0.2.16, and 0.3.0 where named re-entrancy locks were allocated incorrectly. Each function using a named re-entrancy lock received a unique lock regardless of the key, allowing cross-function re-entrancy in contracts compiled with the susceptible versions. The vulnerability was discovered on July 30th, 2023, and was patched in version 0.3.1 (GitHub Advisory, Vyper Report).

Technical details

The vulnerability stemmed from improper implementation of the re-entrancy guard mechanism. The compiler was allocating a new storage slot for each @nonreentrant decorator instance, regardless of the key value, instead of reusing the same slot for identical keys. This implementation error meant that functions sharing the same nonreentrant key would each get their own independent lock, effectively nullifying cross-function re-entrancy protection. The bug was introduced in PR#2391 of version 0.2.15 when the re-entrancy key allocation logic was moved to the front-end pass, removing the crucial check that ensured only one lock was allocated per nonreentrant key (Vyper Report).

Impact

The vulnerability primarily affected smart contracts that relied on named re-entrancy protection across multiple functions, particularly those handling native ETH transactions. Several Curve.Fi liquidity pools were exploited due to this vulnerability, resulting in significant financial losses. The most notable impacts included the draining of multiple pools: pETH/ETH (~$11M), msETH/ETH (~$3.4M), alETH/ETH (~$22.6M), and CRV/ETH (~$24.7M) (Curve Report).

Mitigation and workarounds

The vulnerability was patched in Vyper version 0.3.1 through two PRs: #2439 and #2514, which corrected the storage slot allocation for re-entrancy locks. For affected contracts, the primary mitigation is to upgrade to Vyper version 0.3.1 or higher. For contracts that cannot be upgraded, there are no direct workarounds, though following the Checks-Effects-Interactions pattern where possible can help prevent re-entrancy attacks (GitHub Advisory).

Community reactions

The vulnerability led to significant discussion in the DeFi community, particularly after the Curve.Fi exploits. The Vyper team acknowledged the bug on Twitter and has since announced several security initiatives, including competitive audits, bug bounty programs, and the formation of the Vyper Security Alliance. The team is also expanding to include dedicated security engineering roles and collaborating with multiple audit firms to review past versions (Vyper Report).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 09, 2025
CVE-2025-66645HIGH7.5
  • PythonPython
  • nicegui
NoYesDec 09, 2025
GHSA-9rwj-6rc7-p77cHIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 10, 2025
CVE-2025-67502MEDIUM5.4
  • PythonPython
  • taguette
NoYesDec 10, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management