Refundable lifetime VPI omitted from LP NAV lets trader-LPs extract other Junior LPs' principal around epoch settlement
The protocol's LP net asset value omits the signed lifetime volume price impact (VPI) that a position accrues, so a trader who is also a large LP can redeem or activate shares at a transient price and then close the position to recover the VPI. This lets the attacker take principal from other Junior LPs, realising roughly 15.6k USDG per cycle on the exit leg and 12.3k USDG on the mirror leg in the author's tests.
- Disclosed after under an hour
#99850 [SC-Critical] Refundable lifetime VPI omitted from LP NAV lets trader-LPs extract other Junior LPs' principal around epoch settlement
Submitted on Nov 15th 2026 at 13:03:52 UTC by @legat for Audit Competition | Plether
- Report ID: #99850
- Report Type: Smart Contract
- Report severity: Critical
- Target: https://github.com/immunefi-team/audit-comp-plether/tree/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src
- Impacts:
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Asset
Tested version and environment
Repository: https://github.com/immunefi-team/audit-comp-plether
Commit: a82d4fefb02768e5b3bddcc97dee371eee24fea8
Category: Smart Contract
Execution: Local Foundry test using the repository's production-topology perps fixture
Parameters: Frozen checked-in initial release configuration (not a live-state claim)
Compiler: Solidity 0.8.35, optimizer 200, via-IR, Prague EVM
Token: USDG, 6 decimals
The PoC uses the repository's production-topology perps fixture and deploys the scoped production implementations of the Pool, both Vaults, Clearinghouse, Engine, terminal-NAV book, planning and settlement sidecars, Oracle, and lifecycle components. The repository's LegacyOrderRouterHarness is a production-OrderRouter-derived fixture adapter; MockSettlementToken provides controlled USDG minting and MockPyth holds an equal-weight two-feed basket at one unchanged price. The inherited helper supplies conf = 0 (BasePerpTest.sol:308-315), so the logged profits do not include an adverse-confidence price shift. The two-feed oracle fixture is intentionally smaller than the deployed release feed set, but the exploit does not depend on feed count or price movement. No target storage is overwritten, and no target accounting component is mocked or replaced. The test asserts the checked-in economic parameters used by the construction before executing either leg:
vpiFactor 0.01e18
maxSkewRatio 0.4e18
executionFeeBps 4
maxSeniorExposureAssets 40_000_000e6
maxSeniorShareBps 8_000
minOpenNotionalAssets 1_000e6
LP epoch duration 1 hour
LP request cutoff 5 minutes
The sealed run used Foundry/Forge 1.8.1 (982849d3140c01fd3b72905759581a132df7aa98) on macOS 27.2.1. Both authored tests and the complete fresh log are reproduced in the Proof of Concept section with SHA-256 hashes.
Impact
Impact: Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Summary
Plether charges or rebates Volume Price Impact (VPI) when a position is opened or increased and accumulates that signed amount on the position for later close settlement. Negative lifetime VPI is backed by a nonwithdrawable reserve. Positive lifetime VPI is the clamp-capped maximum rebate the position can receive if its later close is skew-reducing; in the demonstrated self-created-skew sequence, the attacker controls that condition. The opening VPI cash transfer therefore is not necessarily final LP revenue: the same position can later receive or repay it.
LP NAV does not include that outstanding signed lifetime-VPI state. TerminalNavBookV2 authenticates entry cost, marked price PnL, and collectible price-loss caps, but exports no VPI field. HousePoolAccountingLib.buildReconcileSnapshot consequently prices LP entry and exit from Pool cash, trader claims, and marked price PnL only.
This creates two directions of the same root cause:
- Exit leg: a trader-LP opens a skew-increasing position. Positive VPI enters the Pool and is reconciled as Junior revenue. The attacker redeems Junior shares at the inflated NAV, then closes the position and receives the lifetime-clamped VPI rebate. The LPs who remain fund the rebate.
- Entry leg: a trader opens a skew-reducing position. The Pool immediately pays negative VPI while a dedicated reserve secures the later clawback. The attacker activates a large Junior deposit at the depressed NAV, then closes the position. The clawback restores the Pool, and the newly minted shares capture part of the recovery from prior Junior LPs.
At the frozen release-scale parameters, the full E2E exit leg realizes 15,610.991561 USDG for the attacker and records a 23,753.743050 USDG starting-basis shortfall for the remaining Junior LPs in one cycle. The mirror leg realizes 12,315.925026 USDG and records a 22,829.381288 USDG starting-basis shortfall for prior Junior LPs. Those shortfalls include ordinary Senior coupon accrued during the elapsed epochs; versus an equivalent no-attack baseline, the attack-attributable single-cycle losses are approximately 23.7k USDG for the exit leg and 21.9k USDG for the mirror leg. Opposite-order controls are loss-making, isolating the LP settlement placed between opening VPI and lifetime settlement as the cause. Ten-cycle runs realize 156,611.278629 USDG and 123,854.366637 USDG respectively, with cumulative third-party Junior losses.
Finding Description
Intended behavior
LP entry and exit should not let a position owner cross an LP settlement boundary and recover the same VPI cash twice: once through an LP redemption or favorable share activation, and again when that position closes. This is the repository's stated anti-extraction intent, not an assumption imported from a different accounting design.
CloseAccountingLib.sol:112-114 says: "Prevents LP sandwich attacks where an attacker opens at high depth, reduces pool depth, then closes to extract a net-negative lifetime VPI rebate." The comment names this exact open, reduce-depth, close sequence as an attack. The clamp stops the net-negative-lifetime rebate, while the same sequence still moves value between LP cohorts through asynchronous NAV pricing. SECURITY.md:1443 likewise says the clamp "intentionally zeroes otherwise extractable rebate-only round trips." For the backed negative side, ACCOUNTING_SPEC.md:821-822 states that VPI reserve cannot be extracted by LPs before its account obligation settles, and WHITEPAPER.md:885-888 says the reserve is excluded from the terminal curve so LPs cannot withdraw it as marked equity before the matching position obligation settles.
The documentation separately states that VPI stays outside the pre-close price book and that neither anticipated VPI nor its reserve inflates terminal K or symmetric NAV (SECURITY.md:863,866-872). The defect is not that broad pre-close policy by itself. It is that Pool cash already transferred for an open position enters asynchronous LP pricing without a corresponding cohort-safe adjustment, allowing the same trader-LP to withdraw or buy through the transient cash state before its controlled close reverses it.
WHITEPAPER.md:411-412,811 says positive VPI increases physical Pool assets and names the Pool as beneficiary when VPI is positive. In the demonstrated round trip, net lifetime VPI is zero: one LP cohort keeps the opening cash while another funds the clamp-capped refund.
The only express collection-time cohort policy is scoped to pending carry. ACCOUNTING_SPEC.md:731-740 says "LP ownership follows collection time" for indexed pending carry and retained carry arrears, and calls that an intentional collection-time ownership policy. It does not extend that acceptance to VPI recovered or repaid by the same still-open position.
The close path enforces the lifetime clamp:
if (state.proportionalAccrualAssets + state.vpiDeltaAssets < 0) {
state.vpiDeltaAssets = -state.proportionalAccrualAssets;
}
Negative accrued VPI is a reserve-backed later clawback. Positive accrued VPI is not a certain liability in every future book state; it is the clamp-capped maximum close rebate. In the demonstrated unchanged-mark, self-created-skew sequence, the attacker controls the skew-reducing close that realizes that cap. Unrelated organic flow before close is an execution risk, not a prerequisite.
Actual behavior
TerminalNavBookV2.terminalNavSnapshot() verifies aggregate lots and entry notional, computes only the marked price delta, and exports claims and maximum price liability:
if (snapshot.hasOpenPositions) {
snapshot.terminalLpPriceDeltaAssets = _terminalLpPriceDeltaAssetAtoms(uint32(markPrice));
}
snapshot.totalTraderClaimsAssets = engine.totalTraderClaimBalanceAssets();
snapshot.maxDirectionalLiabilityAssets = longMaxProfit > shortMaxProfit ? longMaxProfit : shortMaxProfit;
The per-account curve input similarly contains only size, entry cost, collectible price cap, and side. Although engine.positions(account) returns vpiAccrued, the book discards that value.
HousePoolAccountingLib.buildReconcileSnapshot() then constructs LP equity as:
uint256 terminalAssets = engineSnapshot.physicalAssets;
uint256 terminalLiabilities = engineSnapshot.traderClaimBalanceAssets;
int256 terminalDelta = engineSnapshot.terminalLpPriceDeltaAssets;
It adds a positive marked-price delta or adds a negative marked-price delta to liabilities, but it has no lifetime-VPI term.
For positive opening VPI, the settlement sidecar sends the non-fee cost to HousePool and records it as Revenue with CashArrived. The next reconciliation therefore raises Junior principal. For negative opening VPI, the sidecar pays the rebate from HousePool and locks the required negative-lifetime-VPI reserve in the Clearinghouse. The cash decrease is treated as a current Pool loss even though the position must later repay the backed amount.
When the position closes, CloseAccountingLib clamps lifetime VPI and the settlement sidecar pays the positive-lifetime rebate or consumes the negative-lifetime reserve/clawback. The LP epoch can be settled between these two cash transfers. Because the first transfer changes Pool cash but the matching lifetime settlement state is absent from NAV, shares can be redeemed or minted at a transient price that the attacker can reverse by closing the same position in the demonstrated book state.
Leg 1: redeem after positive VPI enters the Pool, then close
Use a release-configured Pool with 20M USDG Senior principal, 30M USDG Junior principal, and 50M USDG depth. The attacker owns 80% of Junior shares.
-
Before the five-minute cutoff, the attacker requests redemption of all unlocked Junior shares for epoch
e+1. -
Before the epoch boundary, the attacker's trader opens a 19.9M USDG LONG at unchanged mark. The 19.9M skew is below the release cap
0.4 * 50M = 20M. -
The VPI curve charges:
Text X = 0.005 * 19.9M^2 / 50M = 39,601 USDGThe 4-bps execution fee is 7,960 USDG. VPI cash enters the Pool; the execution fee goes to the protocol fee path.
-
After the boundary, a permissionless current-hour LP settlement reconciles the 39,601 USDG as Junior revenue and funds the attacker's redemption. The attacker's 80% share receives the transient increase through the funded redemption; the exact fixture payout is 24,031,534.640675 USDG instead of 24M USDG.
-
The redemption lowers Pool depth to approximately 26M USDG.
-
The attacker closes at the unchanged mark. Raw close VPI at the lower depth exceeds
X, so the lifetime clamp limits the VPI rebate toX. After close accounting and the execution fee, the exact Pool payout is 31,637.350886 USDG. -
Across the LP and trader identities, the attacker earns approximately:
Text realized combined attacker net = 15,610.991561 USDG remaining-Junior loss = 23,753.743050 USDG Treasury gain = 7,960 USDGThese are balance-derived E2E values after the Vault, Pool, Clearinghouse, Router, close clamp, and integer rounding all execute.
The valid control opens and closes the same 19.9M position before the queued LP exit settles; it loses 9,704.429722 USDG. Settling the 80% exit before opening that same 19.9M position is not an executable control: depth falls to roughly 26M, so source arithmetic puts the trade above the release 40% skew cap, and the PoC asserts that commitOrder reverts. The successful opposite ordering proves that price movement or the VPI curve alone is not the extraction; profitability requires LP settlement between the opening charge and its clamp-capped close rebate.
The PoC repeats the attack for ten cycles over 108,001 seconds and realizes +156,611.278629 USDG to the attacker and -241,691.492008 USDG to remaining Junior LPs. Boundary cases measure -156.321479 USDG near 40% ownership and +15,610.991561 USDG at 80%. A near-100% redemption request is partially funded because the frozen 80% Senior-share covenant requires Junior capital to remain; the PoC reports funded shares rather than claiming an impossible uncapped result.
Leg 2: activate a deposit after negative VPI leaves the Pool, then close
Use 50M USDG Pool depth, 30M USDG Junior principal, and an organic 20M USDG net-long book. The attacker escrows a 60M USDG Junior deposit for the next eligible epoch.
-
Before the deposit activates, the attacker's trader opens a 12M USDG SHORT. This reduces absolute skew from 20M to 8M.
-
The gross VPI difference is negative:
Text R = 0.005 * (20M^2 - 8M^2) / 50M = 33,600 USDG -
The exact gross VPI credit and protected reserve are 33,599.964092 USDG. In the production path, the 4,800 USDG opening fee is debited from the trader's Clearinghouse balance separately; the Pool cash/NAV dip itself is the full 33,599.964092 USDG.
-
A permissionless epoch settlement reconciles the depressed Pool cash and activates the attacker's 60M USDG Junior deposit. The attacker receives approximately two-thirds of post-entry Junior ownership.
-
The attacker closes the short. The lifetime clamp requires repayment of the 33,600 USDG negative accrual even if the changed depth would otherwise quote less. Reserve consumption is routed back as claimant revenue and Junior NAV recovers.
-
After the close clawback, cooldown, and real redemption/claim path, the attacker realizes 12,315.925026 USDG and the independently funded old-Junior cohort loses 22,829.381288 USDG. Treasury receives exactly 9,600 USDG across the open and close.
The control activates the deposit before the skew-reducing open and realizes a 10,087.980556 USDG attacker loss. The PoC repeats the full attack over ten cycles and realizes +123,854.366637 USDG attacker profit, -228,990.806032 USDG old-Junior loss, and +96,000 USDG Treasury fees.
The mirror leg requires an existing same-direction skew. At the stated release parameters, an organic skew below roughly 0.3 * D makes the self-funded version uneconomic. That requirement is included in Likelihood rather than hidden.
Root Cause
The root cause is an incomplete definition of terminal LP NAV.
Plether maintains signed lifetime VPI per open position and settles it again when the position closes. Positive accrued VPI is the clamp-capped maximum trader rebate available if the later close is skew-reducing; negative accrued VPI is a Pool receivable protected by a dedicated nonwithdrawable reserve. In the demonstrated self-skew sequence, unchanged price and the attacker-controlled skew-reducing close make the positive cap realizable. However, the authenticated terminal NAV contains marked price PnL and trader claims but no aggregate signed lifetime-VPI adjustment.
As a result:
- positive opening VPI is immediately treated as LP revenue even though the same position can later receive it back;
- negative opening VPI immediately reduces LP NAV even though the same position is reserve-bound to repay it; and
- asynchronous LP entry or exit can be placed between the cash transfer and its matching lifetime settlement.
The close clamp protects the trader/Pool round trip from net-negative lifetime VPI, but it does not protect LP cohorts from buying or redeeming while the signed lifetime-VPI state is omitted from NAV.
Impact Explanation
The selectable impact is Critical: Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield.
The attack is not merely a temporary share-price display error. The attacker's LP claim is funded from Pool cash into the Vault, its shares are burned or minted at the manipulated epoch price, and the attacker can claim the funded USDG. After the trader leg closes, independently funded Junior LPs own a smaller claim on Pool principal. The unchanged-price controls isolate that principal transfer from ordinary market risk.
For the specified release-scale examples:
| Construction | Attacker net per cycle | Other Junior starting-basis shortfall per cycle | Ten-cycle attacker net | Ten-cycle other-Junior starting-basis shortfall |
|---|---|---|---|---|
| Exit leg | +15,610.991561 USDG | -23,753.743050 USDG | +156,611.278629 USDG | -241,691.492008 USDG |
| Entry leg | +12,315.925026 USDG | -22,829.381288 USDG | +123,854.366637 USDG | -228,990.806032 USDG |
The logged Junior shortfalls are measured against starting basis and therefore include the ordinary Senior coupon accrued over elapsed epochs (about 182.65 USDG per hour on 20M Senior principal at 8% annualized). The estimated attack-attributable single-cycle losses versus a no-attack baseline are approximately 23,717 USDG for the exit construction and 21.9k USDG for the entry construction. This baseline adjustment does not change either attacker's realized profit or the direction and materiality of third-party loss; the ten-cycle logged shortfalls likewise include ordinary coupon accrual.
Likelihood Explanation
Every state-changing action used by the attack is permissionless or an ordinary user action: trading, requesting an LP redemption or deposit, and triggering current-hour epoch settlement. No owner, guardian, Oracle signer, Treasury, keeper, or dependency compromise is required. The attacker can act as its own trader and permissionless keeper using authentic prices.
The attack is capital-intensive and its per-cycle return is bounded:
- the stated exit-leg PoC ties up 24M USDG of Junior ownership and provisions 1M USDG in the trader's Clearinghouse account, with 500k USDG selected as opening margin; roughly 40% of Junior ownership approaches break-even, while 80% or above is materially profitable;
- the stated mirror leg escrows 60M USDG of new Junior capital plus trader margin and needs a pre-existing organic skew of roughly
0.3 * Dor greater; self-building that skew would require additional funded positions and must be included in net economics; - the 40% maximum-skew cap limits the exit-leg VPI magnitude;
- each cycle spans multiple one-hour epochs and a one-hour share cooldown;
- execution fees, carry, Pyth fees, and Arbitrum gas reduce the result; and
- the current fixture sets Pyth confidence to zero. Release configuration permits a 10-bps confidence ratio with a 2,500-bps adverse multiplier (
DEPLOYMENT.md:146-147), or at most a 2.5-bps adverse execution-price shift. Conservatively applying that bound to both executions costs about 9,950 USDG gross on the 19.9M exit leg and 6,000 USDG gross on the 12M mirror leg; after approximate LP recapture, the incremental attacker costs are about 6k and 4k respectively, leaving both demonstrated sizes profitable. These are source-parameter estimates, not assertions made by theconf = 0PoC.
These constraints reduce frequency, but they do not require an unlikely code race. LP requests are asynchronous by design and the attacker controls whether its trade occurs before or after the public epoch boundary. At 50M USDG depth the demonstrated absolute profit is material, and the same sequence can be repeated while sufficient Junior liquidity and the required skew state exist.
The public HIGH-1 limitation is not this root cause. HIGH-1 concerns the disclosed Arbitrum/Pyth clock-alignment behavior. This construction uses an unchanged authentic mark and derives no benefit from observing a price before its on-chain commit timestamp.
The HIGH-1 exception requires repeatable, net-profitable LP extraction. The PoC meets that condition with ten successful cycles, realized attacker cash, measured independent LP loss, and opposite-order controls.
The closest VPI disclosure is SCAN-31, KNOWN_ISSUES.md:172 and the linked report at reports/scan-plether-fi-plether-core-d4541b49.md:1742-1810. SCAN-31 says a trader can temporarily reduce Pool depth before a skew-reducing close so the current-depth curve quotes a larger rebate than the unmanipulated curve. That is not the causal defect here. At the original 50M USDG depth, the unchanged-mark close quote is exactly -C(19.9M) = -39,601 USDG = -X under CfdMath.sol:138-139; the opening and closing curve terms telescope. The lower post-redemption depth makes the raw quote larger, but the lifetime clamp still returns exactly X, so the depth reduction adds zero to the rebate. Profit comes from first capitalizing X into Junior NAV and paying it into the funded redemption. The mirror construction is independently outside SCAN-31 because it uses deposit activation around a reserve-backed negative-VPI clawback, not a depth-reduced close quote.
The documented "LP ownership follows collection time" exception is expressly about pending carry (ACCOUNTING_SPEC.md:731-740), not VPI recovered by the same position. No located disclosure accepts a trader-LP redeeming opening VPI and then shifting its matching lifetime-capped refund below another LP's funded basis. The anti-extraction comment in CloseAccountingLib.sol:112-114, SECURITY.md:1443, the non-extractable-reserve rule in ACCOUNTING_SPEC.md:821-822, and WHITEPAPER.md:885-888 instead establish the opposite intent. This report does not characterize the broad decision to omit anticipated VPI from pre-close price curves as the bug; it identifies the cross-cohort extraction created when physical VPI cash and asynchronous LP settlement are combined without a cohort-safe NAV adjustment.
Attack Path / Reproduction Path
Exit leg
- Establish the ordinary release state: 20M Senior principal, 30M Junior principal, 50M Pool depth, live current mark, and attacker ownership of 80% of Junior shares.
- Before the request cutoff, request redemption of all attacker Junior shares for epoch
e+1. - Before boundary
e+1, fund and open a 19.9M USDG LONG at the unchanged mark. - Confirm 39,601 USDG VPI enters the Pool and 7,960 USDG open fee is charged.
- After the boundary, submit an authentic current-hour mark and settle the LP epoch through the Router.
- Claim the funded Junior redemption and record attacker/victim/Pool/Treasury balances.
- Close the LONG at the unchanged mark.
- Withdraw the trader balance and assert +15,610.991561 USDG combined attacker profit and -23,753.743050 USDG remaining-Junior loss.
- Run the valid open-and-close-before-exit control and assert a 9,704.429722 USDG attacker loss; separately show that source arithmetic puts the same 19.9M trade over the 40% skew cap after exit-before-open and assert that
commitOrderreverts. - Repeat ten cycles and test the 40%, 80%, and near-100% request boundaries, including Senior-covenant partial funding.
Entry/mirror leg
- Establish 50M USDG depth, 30M Junior principal, and an organic 20M USDG net-long book.
- Request a 60M USDG Junior deposit for epoch
e+1. - Before activation, open a 12M USDG SHORT at the unchanged mark.
- Confirm the exact 33,599.964092 USDG Pool payout and matching Clearinghouse reserve; confirm the 4,800 USDG opening fee is charged separately to the trader.
- After the boundary, settle the LP epoch and claim the attacker's newly activated Junior shares.
- Close the SHORT and confirm the lifetime VPI clawback restores the Pool/Junior NAV.
- After cooldown, request and fund redemption, then claim USDG.
- Log +12,315.925026 USDG combined attacker profit and -22,829.381288 USDG loss to old Junior LPs; the PoC asserts these outcomes within stated ranges.
- Run the activate-before-open control and log a 10,087.980556 USDG attacker loss, asserted within its stated range.
- Repeat ten full cycles and log +123,854.366637 USDG attacker profit and -228,990.806032 USDG old-Junior loss, asserted within stated ranges.
External Preconditions
- The target uses the scoped perps contracts at commit
a82d4fefb02768e5b3bddcc97dee371eee24fea8or equivalent affected logic. - The release configuration has nonzero VPI factor and permits the demonstrated size under the maximum-skew rule.
- Oracle mode is live, not frozen, and authentic current-hour price data is available.
- Sufficient Pool cash exists for the open rebate, LP funding, and close settlement.
- For the mirror leg, an organic same-direction skew of approximately
0.3 * Dor greater exists, unless the attacker funds a more complex self-built-skew composition.
Internal Preconditions
- The attacker's LP request targets a future one-hour epoch and is placed before the five-minute cutoff.
- For the exit leg, the attacker owns a sufficiently large unlocked Junior fraction; approximately 40% is near break-even and 80% is profitable in the stated state.
- For the entry leg, the attacker has enough queued Junior capital to own a material fraction after activation.
- The trade executes before the targeted LP settlement, while the matching close executes after it.
- No LP settlement hold, Pool pause, oracle-frozen state, terminal deficit, or deposit-entry gate prevents the relevant epoch action.
- The position remains open across the LP settlement so its lifetime VPI remains outstanding but absent from terminal NAV.
Affected Code
Primary affected paths at frozen commit a82d4fefb02768e5b3bddcc97dee371eee24fea8:
packages/perps/src/TerminalNavBookV2.sol:208-235exports terminal price PnL, claims, and maximum liability but no lifetime-VPI term.packages/perps/src/TerminalNavBookV2.sol:418-448reads the position and constructs a curve without using returnedvpiAccrued.packages/perps/src/interfaces/ICfdEngineTypes.sol:451-467definesTerminalNavSnapshotwithout signed lifetime VPI.packages/perps/src/libraries/HousePoolAccountingLib.sol:63-79constructs distributable LP equity from physical assets, claims, and marked price PnL only.packages/perps/src/CfdMath.sol:115-179computes the signed opening VPI transfer.packages/perps/src/libraries/CfdEnginePlanLib.sol:320-374,443-481plans opening VPI, reserve targets, and the release maximum-skew rule.packages/perps/src/CfdEngineSettlementSidecar.sol:415-465pays a negative opening rebate or records positive opening VPI as Pool revenue.packages/perps/src/libraries/CloseAccountingLib.sol:103-126computes close VPI and clamps lifetime VPI from becoming negative.packages/perps/src/CfdEngineSettlementSidecar.sol:580-625settles the close rebate/clawback and routes revenue.packages/perps/src/HousePool.sol:797-925reconciles current NAV, funds redemptions, and then activates deposits at the transient price.packages/perps/src/TrancheVault.sol:545-556places requests into future epochs around the five-minute cutoff.
Recommended Mitigation
Include outstanding signed lifetime VPI in the authenticated terminal NAV used by both LP entry and exit.
One consistent implementation is to maintain an authenticated aggregate sum(vpiAccrued) alongside the terminal price curves and expose a signed VPI NAV adjustment in TerminalNavSnapshot:
- positive lifetime VPI is the maximum close rebate permitted by the lifetime clamp and should reduce distributable LP NAV to the extent it is realizable in the authenticated book state;
- negative lifetime VPI is a future Pool clawback receivable and may increase LP NAV only to the extent it is backed by the dedicated nonwithdrawable VPI reserve; and
- when open/close changes lifetime VPI, the aggregate adjustment and reserve-backed amount must update atomically with the position and terminal book.
An equivalent design can quarantine both directions of opening VPI in a pending claimant/liability bucket excluded from ordinary LP pricing until the position realizes the matching close settlement. In either design, avoid counting the same cash once as physical Pool assets and again as a receivable.
Add regression tests that execute both action orders for both directions:
- open/increase -> LP redeem -> close;
- LP redeem -> open/increase -> close;
- negative-VPI open -> LP deposit activation -> close;
- LP deposit activation -> negative-VPI open -> close;
- partial closes and repeated cycles; and
- reserve, claim, Senior-first, frozen-mode, and zero/wiped-Junior boundaries.
The invariant should be that, at an unchanged mark and absent non-VPI fees, changing only whether LP settlement occurs before or after an open position's reversible VPI transfer cannot create a positive combined trader-LP profit or a matching loss to another LP cohort.
Proof of Concept
Description
This full E2E Foundry PoC deploys Plether's scoped production Pool, Senior and Junior Vaults, Clearinghouse, Engine, terminal-NAV book, planning and settlement sidecars, Oracle, lifecycle components, and the repository's production-OrderRouter-derived fixture adapter at the frozen commit. It executes ordinary asynchronous LP requests, epoch settlement, claims, Router opens and closes, lifetime-VPI reserve/clawback accounting, cooldowns, and final USDG realization.
The exit scenario queues an 80%-Junior redemption, opens the 19.9M LONG before the boundary, settles and claims the inflated redemption, closes at the unchanged price, and withdraws trader cash. The mirror scenario queues a 60M Junior deposit against an organic 20M LONG, op
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The terminal LP NAV calculation includes pool cash, trader claims and marked price PnL but no aggregate signed lifetime-VPI term, so asynchronous LP entry or exit can be placed between the VPI cash transfer and its matching settlement at close.
Impact
The attacker could directly take other Junior LPs' principal, realising about 15.6k USDG per cycle on the exit leg and 12.3k USDG on the mirror leg, though the attack is capital-intensive, bounded by the 40% skew cap, and the test fixture sets oracle confidence to zero so real adverse-price costs are not included.
What the attacker needed
Large Junior LP position; trader margin in Clearinghouse; pre-existing skew for mirror leg; permissionless epoch settlement
The fix
The terminal LP NAV should include the aggregate signed lifetime-VPI state, or LP entry and exit should be adjusted so that VPI cash transferred for a still-open position cannot be redeemed or bought through before its matching close settlement.
How it was found
- Request redemption of all attacker Junior shares for the next epoch before the cutoff.
- Before the epoch boundary, open a large LONG at the unchanged mark so positive VPI enters the Pool.
- After the boundary, settle the LP epoch so the VPI is reconciled as Junior revenue and the redemption is funded.
- Claim the funded redemption, then close the LONG at the unchanged mark so the lifetime clamp returns the VPI as a rebate.
- For the mirror leg, open a skew-reducing SHORT before a large Junior deposit activates, settle the epoch, then close the SHORT to trigger the reserve-backed clawback.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When someone opens a trade, the protocol charges or pays a fee called volume price impact, and that amount is meant to be settled again when the trade closes. The pool's share price is calculated without counting this pending amount, so a person who is both a trader and a large pool investor can cash out shares at a temporarily inflated or depressed price and then close the trade. The result is that other pool investors end up paying for the difference.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.