A Sagitta Defense mini-review of CVE-2023-39363
A CVE can establish that vulnerable software exists.
A Defense review has to go further.
It has to determine whether the vulnerability is present in the deployed system, whether the vulnerable behavior is active, whether the path can actually be reached, whether exploiting that path is economically meaningful, and what authority the protocol has once exposure is confirmed.
CVE-2023-39363 makes those distinctions unusually clear.
The vulnerability affected Vyper versions 0.2.15, 0.2.16, and 0.3.0. In those releases, named reentrancy locks could be allocated incorrectly, allowing cross-function reentrancy under a specific set of conditions. Vyper 0.3.1 contains the fix.
The compiler version established exposure.
The contract architecture determined what that exposure meant.
That progression is where Sagitta Defense begins.
The incident
On July 30, 2023, several Curve liquidity pools were exploited because contracts compiled with affected Vyper versions did not receive the reentrancy protection their code intended.
LlamaRisk's postmortem identifies four exploited pools:
- pETH/ETH
- msETH/ETH
- alETH/ETH
- CRV/ETH
The affected Curve pools were paired with native ETH and used a raw_call when sending native tokens. LlamaRisk also identified ERC-777 callbacks as another path capable of producing the same reentrancy condition. Pools paired with WETH were not affected by this particular path.
That incident produced several security states at the same time.
Some contracts had been built with affected compiler versions.
Some contained the relevant reentrancy mechanism.
Some exposed the callback path required to reach the vulnerable behavior.
And even among potentially reachable contracts, researchers did not identify the same economic outcome.
One CVE produced different operational realities.
A Defense review has to distinguish between them.
Sagitta Defense Mini-Review
Sample environment
Environment: Meridian Liquidity Protocol Status: Fictional demonstration environment Network: EVM-compatible chain Primary review target: Meridian ETH Reserve Pool CVE: CVE-2023-39363 Initial state: VERSION EXPOSED
Meridian is a fictional environment created solely to demonstrate the Sagitta Defense process. The sample findings below do not represent a deployed protocol or production contract.
1. Dependency inventory
Defense begins by establishing what produced the deployed artifact.
For a compiler vulnerability, dependency inventory means build provenance.
| Field | Sample finding |
|---|---|
| Contract language | Vyper |
| Compiler | Vyper 0.2.16 |
| Deployment artifact | Meridian ETH Reserve Pool |
| CVE | CVE-2023-39363 |
| Affected versions | 0.2.15, 0.2.16, 0.3.0 |
| Fixed version | 0.3.1 |
Vyper 0.2.16 falls inside the affected version set, establishing compiler exposure and moving the review from provenance into deployed contract behavior.
Defense finding: AFFECTED VERSION
The contract may contain the faulty lock behavior.
The next question is whether that behavior matters to this contract.
2. Feature status
CVE-2023-39363 concerns named reentrancy protection.
The Meridian ETH Reserve Pool uses the affected mechanism across functions operating on shared liquidity state.
| Feature condition | Meridian |
|---|---|
Named @nonreentrant protection | Present |
| Multiple functions rely on the intended shared lock | Present |
| Relevant functions active | Yes |
| Shared liquidity state | Present |
Defense finding: AFFECTED MECHANISM PRESENT
Vyper's advisory requires more than an affected compiler. The relevant contract must also contain functions whose intended shared lock can fail in a way that exposes intermediate state across an external interaction.
Feature exposure establishes that the mechanism matters.
Reachability determines whether the vulnerable path exists.
3. Technical reachability
The Meridian review now evaluates only the remaining execution conditions.
| Reachability condition | Finding |
|---|---|
| External interaction occurs before relevant state completion | Yes |
| Another function can act on that intermediate state | Yes |
| Relevant path is externally callable | Yes |
| Native ETH transfer provides the callback path | Yes |
Defense finding: TECHNICALLY REACHABLE
The CVE has now become a protocol-specific finding.
The historical Curve incident provides a useful reference point. LlamaRisk found that the affected Curve pools used vulnerable compiler versions and were paired with native ETH. Their contracts became vulnerable when making a raw_call to send native tokens. Pools paired with WETH were not affected by this path.
Consider a second fictional Meridian pool.
Meridian Stable Reserve Pool
The Stable Reserve Pool was also compiled with Vyper 0.2.16.
It also uses the affected reentrancy mechanism.
Its reviewed execution path uses ordinary ERC-20 assets and does not transfer native ETH or introduce an equivalent callback path.
| Finding | ETH Reserve Pool | Stable Reserve Pool |
|---|---|---|
| Affected Vyper version | Yes | Yes |
| Affected mechanism | Present | Present |
| Relevant callback path | Present | Absent |
| Technical reachability | REACHABLE | PATH NOT REACHED |
Same CVE.
Same compiler exposure.
Different Defense finding.
That is the purpose of reachability analysis.
4. Economic exploitability
Technical reachability still leaves another question:
Does the reachable path currently create an economically meaningful attack opportunity?
The Curve incident produced an important intermediate state.
LlamaRisk identified Arbitrum's Tricrypto pool as potentially affected. Auditors and Vyper developers had not identified a profitable exploit, while Curve still advised liquidity providers to exit as a precaution.
Defense therefore separates two findings.
Technical reachability
- REACHABLE
- PATH NOT REACHED
- UNRESOLVED
Economic exploitability
- PROFITABLE PATH IDENTIFIED
- PROFITABLE PATH NOT IDENTIFIED
- UNRESOLVED
For the fictional Meridian ETH Reserve Pool, the sample assessment finds that current liquidity and protocol state provide an economically meaningful path.
Technical finding: REACHABLE
Economic finding: PROFITABLE PATH IDENTIFIED
Defense posture: CONTINUITY RESPONSE REQUIRED
A PROFITABLE PATH NOT IDENTIFIED finding is time-bound. Liquidity, pricing, routing, asset balances, and protocol state can change the economics of a technically reachable path, so the finding requires reassessment while technical exposure remains.
Economic exploitability is therefore a monitored state rather than a permanent property of the contract.
This distinction affects the response clock.
A reachable path with no profitable path identified can still justify an advisory, migration preparation, heightened monitoring, or precautionary exit.
A reachable path with an identified economic opportunity demands a faster continuity response.
5. Authority path
Technical understanding now meets protocol authority.
For this review, Meridian intentionally has constrained emergency powers.
Protocol operators can:
- stop protocol-controlled incentives into the affected pool;
- remove the pool from protocol-controlled routing;
- mark the pool as restricted across supported interfaces;
- distribute an exit advisory;
- deploy a replacement pool.
Their authority does not extend to pausing the pool contract, moving user liquidity, or forcing LP positions into a replacement environment.
Defense finding: AUTHORITY PARTIAL
This changes the continuity problem.
The vulnerable execution surface remains callable.
Containment therefore has to happen around the contract rather than through an emergency pause inside it.
The historical Curve response faced the same type of constraint. LlamaRisk reported that Curve's emergency DAO could kill CRV gauge emissions to affected pools while lacking authority to pause the pools or handle user funds.
The question is no longer simply:
Can the protocol stop the vulnerable contract?
It becomes:
How does the protocol reduce exposure while the vulnerable contract remains live?
That is a continuity problem.
6. Continuity response
For Meridian, the response begins around the exposed surface.
Reduce new exposure
Protocol-controlled routing into the ETH Reserve Pool stops.
Liquidity incentives end.
Supported interfaces mark the pool as restricted.
Integrators receive the same state through the protocol's machine-readable interfaces.
The objective is to stop protocol-controlled systems from directing additional activity toward the exposed contract.
Establish an exit path
Existing LPs receive a public advisory identifying:
- the affected pool;
- the CVE;
- the current Defense finding;
- the available withdrawal path;
- the replacement destination when available;
- the evidence supporting the finding.
Users retain control of their positions.
The protocol coordinates the exit rather than moving funds on their behalf.
Preserve unaffected operations
The Stable Reserve Pool and other independent surfaces continue operating after separate reachability review.
The CVE becomes a scoped continuity event.
The entire protocol does not inherit the most severe finding simply because one deployed component does.
Build the replacement
A replacement ETH pool is compiled using a corrected Vyper release.
Build provenance is captured.
The relevant contract behavior is reviewed against the CVE conditions.
The deployed bytecode is matched against the reviewed artifact.
Whenever timing allows, the replacement environment becomes available before migration begins so LPs have a defined destination.
Coordinate migration
This is the critical continuity window.
The original pool remains callable.
Liquidity remains under the control of individual LPs.
The protocol has publicly disclosed the exposure.
The replacement environment is coming online while liquidity leaves the vulnerable one.
Defense therefore tracks migration as a changing system state:
Exposed liquidity → exiting liquidity → migrated liquidity → residual liquidity
The continuity event remains open while material residual exposure exists.
Routing, communications, incentive state, liquidity movement, replacement readiness, and economic conditions all become part of the active Defense record.
The historical Curve response illustrates why this phase matters. LlamaRisk's postmortem records pools being drained or having liquidity removed by users while the emergency DAO's direct authority remained limited. It also identifies creation of new pools, including WETH-paired replacements, among the next steps.
Migration is therefore part of remediation itself.
Verify and restore
Normal routing and incentives resume only on the verified replacement environment.
Restoration requires evidence that:
- the corrected compiler produced the replacement artifact;
- the reviewed bytecode matches deployment;
- the vulnerable execution condition is absent;
- routing points to the intended replacement;
- migration has reached the protocol's accepted residual-exposure threshold;
- runtime behavior remains within expected invariants.
Restoration becomes a documented decision.
The complete continuity path is:
Detect → Confirm → Reduce Exposure → Advise → Migrate → Verify → Restore
7. Detection
A Defense process needs a concrete meaning for Detect.
For this vulnerability class, detection can begin from either direction.
Intelligence detection
A new CVE, compiler advisory, security disclosure, or ecosystem incident is matched against the protocol's build and deployment inventory.
CVE-2023-39363 would match any recorded contract built with Vyper 0.2.15, 0.2.16, or 0.3.0.
That initiates exposure analysis.
Runtime detection
The deployed system can also signal that expected accounting relationships have broken.
During the Curve exploits, the reentrancy failure allowed liquidity operations to be calculated against inconsistent intermediate balances. LlamaRisk describes LP-token calculations occurring against pre-update balances and, in the CRV/ETH case, a pool whose recorded balances no longer reflected the assets actually present.
For this class of system, Defense can monitor invariants around:
LP-token supply ↔ accounting state ↔ underlying asset balances
A material divergence becomes a runtime signal requiring investigation.
This gives Defense two possible starting points:
Intelligence → exposure analysis
or
Runtime anomaly → incident analysis
Sometimes the advisory arrives first.
Sometimes the system tells you first.
The Defense process needs both.
8. Verification evidence
Each material conclusion should resolve to evidence.
| Evidence | Establishes |
|---|---|
| Build manifest | Compiler version |
| Compiler metadata | Build provenance |
| Verified contract source | Affected mechanism |
| Deployed bytecode hash | Reviewed artifact matches deployment |
| Execution analysis | Technical reachability |
| Asset and callback analysis | Relevant interaction path |
| Economic assessment snapshot | Exploitability at assessment time |
| Authority configuration | Available response powers |
| Routing state | Removal of protocol-directed traffic |
| Incentive transaction | End of protocol-controlled incentives |
| Advisory record | User notification |
| Replacement build record | Corrected compiler provenance |
| Replacement deployment hash | Identity of new environment |
| Migration state | Remaining exposed liquidity |
| Runtime invariant record | Operational behavior |
| Restoration authorization | Return to normal operation |
The Defense evidence chain becomes:
CVE → build → mechanism → reachability → economics → authority → response → migration → verification
That is the record an operator can inspect after the alert itself has passed.
Three findings from one CVE
CVE-2023-39363 shows why one vulnerability score cannot describe every affected protocol state.
Meridian Stable Reserve Pool
Affected compiler: YES Affected mechanism: PRESENT Technical reachability: PATH NOT REACHED Response: REMEDIATION PLANNED
Arbitrum Tricrypto historical example
Potential exposure: PRESENT Profitable exploit: NOT IDENTIFIED Response: PRECAUTIONARY EXIT ADVISED
LlamaRisk documented this intermediate state while the Curve incident was unfolding.
Meridian ETH Reserve Pool
Affected compiler: YES Affected mechanism: PRESENT Technical reachability: REACHABLE Economic exploitability: PROFITABLE PATH IDENTIFIED Authority: PARTIAL Response: CONTINUITY MIGRATION
One CVE.
Three operational findings.
That is why the CVE starts the review rather than finishing it.
Final Defense finding
CVE: CVE-2023-39363 Sample environment: Meridian ETH Reserve Pool Environment: FICTIONAL Compiler: Vyper 0.2.16 Affected version: CONFIRMED Affected mechanism: PRESENT Technical reachability: REACHABLE Economic exploitability: PROFITABLE PATH IDENTIFIED Authority: PARTIAL Pause capability: UNAVAILABLE User-fund control: USER CONTROLLED Continuity posture: MIGRATION REQUIRED Verification: REQUIRED THROUGH RESTORATION
A CVE is global intelligence.
A Defense finding is local intelligence.
It establishes how the vulnerability intersects with the actual protocol: what produced the deployed artifact, which affected mechanism exists, whether the path can be reached, whether the economics make that path actionable, what authority operators possess, how exposure can be reduced, how users move through remediation, and what evidence establishes restoration.
CVE-2023-39363 exposed a compiler failure.
The Curve incident showed why that was only the beginning of the operational question.
Would this CVE reach your protocol?
And if it would:
What can your protocol actually do when it does?
This mini-review uses a fictional protocol environment to demonstrate the Sagitta Defense process. Historical findings are based on CVE-2023-39363 and LlamaRisk's Curve Pool Reentrancy Exploit Postmortem.