Skip to content
Business logic Audit finding Advanced

Repeated Junior entry around a VPI rebate round trip makes incumbent Junior LPs redeem below deposit

A trader can time a Junior tranche deposit so it activates after a skew-reducing open has paid out a VPI rebate from pool cash, lowering the Junior NAV, and then collect a share of that rebate when the position closes and the reserve returns to the pool. Incumbent Junior LPs then redeem below their deposit, with the attacker's gain funded by them.

itko69 Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#98045 [SC-Critical] Repeated Junior entry around a VPI rebate round trip makes incumbent Junior LPs redeem below deposit

Submitted on Nov 4th 2026 at 15:37:15 UTC by @itko69 for Audit Competition | Plether

Description

Brief/Intro

A skew-reducing open is paid its VPI rebate r out of HousePool cash, and the account must lock the same amount as a non-withdrawable VPI rebate reserve. The lifetime VPI clamp makes the full close return r to the pool, but terminal LP NAV leaves the reserve out, so Junior NAV is r lower until that close. The attacker requests a Junior deposit before the request cutoff, opens the skew-reducing leg 120 s before the epoch boundary b, settles the epoch through the permissionless Router at b + 1 s and commits the close at b + 2 s. The deposit activates on the lowered NAV, the attacker holds a share α of the Junior tranche when r returns, and it redeems after the 1-hour cooldown. The incumbent Junior LPs fund the entrant's α·r. The trading account's VPI nets to zero, and it pays its two execution fees.

In the PoC (launch parameters, basket held at 1.20), an incumbent Junior LP deposits 10,000,000 USDG and the attacker runs eight cycles in one trading day with a 40M USDG Junior deposit; at the end every position is closed and every incumbent redeems in full. The incumbent's claimRedeem pays 9,955,325.067168 USDG in a Junior-only pool and 9,863,536.928756 USDG with 20M Senior, against 10,001,717.044833 and 10,000,402.386472 USDG without the attacker, and each of the attacker's two legs on its own leaves it at or above its deposit. The attacker nets +21,965.393356 and +63,671.134698 USDG. At 10 bps, the widest basket confidence the oracle accepts, the incumbent still ends 33,655.807162 and 103,384.037261 USDG below its deposit. After one cycle it is still above its deposit, because its NAV still includes the VPI charge paid by T, the independent trader whose long creates the skew; from the second cycle on it is below it.

Severity. Critical, "Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield": over one trading day the incumbent's claimRedeem falls below its deposit only when both attacker legs run (U1, first forge test command under Proof of Concept; see Classification). If the amount taken is classified as yield, the applicable impact is "Theft of unclaimed yield" (High): test_R7_1 and test_R7_4 to test_R7_12 prove that impact on their own, against the controls test_R7_2 and test_R7_3 (R7, second forge test command).

Vulnerability Details

Root cause

Three properties combine. Each one is intended on its own (see "Relation to the documented design").

(1) The rebate leaves pool cash and is locked as a reserve.

  • When an open's trade cost (VPI plus fee) is negative, the planner sets poolRebatePayoutAssets = -tradeCost (src/libraries/CfdEnginePlanLib.sol:333), and the sidecar pays it out of the pool (src/CfdEngineSettlementSidecar.sol:442-444). Because -tradeCost is the rebate net of the fee, the open's execution fee is then paid from pool cash to the protocol treasury (CfdEngineSettlementSidecar.sol:498, 905-926), so pool assets fall by the full rebate r (asserted in test 1).
  • The account's reserve target is its gross negative lifetime VPI (CfdEnginePlanLib.sol:348-349). It is locked at CfdEngineSettlementSidecar.sol:466-478.
  • The skew cap does not stop the open, because the open takes skew to zero (CfdEnginePlanLib.sol:473-480).

(2) The clamp guarantees the reserve returns to the pool, at a time the position owner chooses.

Solidity
// src/libraries/CloseAccountingLib.sol:112-118
// Clamp so lifetime VPI (accrued + delta) never goes negative. Prevents LP sandwich attacks
// where an attacker opens at high depth, reduces pool depth, then closes to extract a
// net-negative lifetime VPI rebate. ...
if (state.proportionalAccrualAssets + state.vpiDeltaAssets < 0) {
    state.vpiDeltaAssets = -state.proportionalAccrualAssets;
}
  • A full close, or a liquidation (ACCOUNTING_SPEC.md:1181-1184), therefore charges at least r, whatever the depth at that moment.
  • Until then, the reserve can only be consumed by that clawback, or released against equivalent withholding or a lower surviving target (SECURITY.md:376).
  • The close moves the reserve into the pool (CfdEngineSettlementSidecar.sol:690-693). MarginClearinghouse.sol:883 describes this as "Returns reserved negative-VPI backing to the LP pool as cash recovery."
  • The close records the amount as claimant Revenue / CashArrived (CfdEngineSettlementSidecar.sol:604-613).

(3) LP NAV leaves the reserve out, and deposits are priced on that NAV.

  • Distributable LP equity is physical assets, plus the signed terminal price delta, minus trader claims (src/libraries/HousePoolAccountingLib.sol:60-78).
  • The terminal snapshot has no VPI or reserve term (src/TerminalNavBookV2.sol:208-237).
  • HousePool._settleLpEpoch reconciles first (src/HousePool.sol:835). The reconcile compares distributable equity with the tranches' claimed equity and books the net difference: a shortfall against Junior principal first, a surplus as revenue (src/libraries/HousePoolReconcilePlanLib.sol:84-104; src/libraries/HousePoolWaterfallAccountingLib.sol:98-110, 140-159, 167-184).
  • It then prices Junior deposits on the post-reconcile juniorPrincipal (HousePool.sol:914-920; src/TrancheVault.sol:1398-1410).

Attack cycle

Test 1 setup: Junior 1M, Senior 2M, entrant X = 4M. An independent trader T holds a long of 1,140,000 USDG notional, which is 0.38 of pool depth. All amounts are in USDG.

Time Step Measured
before b − 300 s The attacker's LP wallet requests a Junior deposit of X for epoch b (TrancheVault.sol:545-556). Junior requests are uncapped (:1313-1326) and can be cancelled until b (:851-860). —
b − 120 s Account B commits a SHORT of T's size. The attacker executes it as keeper in the next block. Pool assets fall by r = 2,164.435835, which is 0.5·k·N²/D at D = 3,002,167.998556. B's reserve = r and B's lifetime VPI = −r. Pending-reconcile Junior NAV goes from 1,002,131.082085 to 999,966.641176.
b + 1 s Anyone calls OrderRouter.settleLpEpoch (src/router/OrderLiquidationBatchLogic.sol:549-581 → HousePool.sol:797-821). X activates 21.60 bps below the Junior share price just before B's open. That price includes T's charge. α = 0.800005.
b + 2 s B commits its full close. The attacker executes it in the next block. The unclamped close VPI at the post-activation depth D − r + X would be 928.285241 (logged as "depth D+X", with D measured after B's open). The assessed charge is 2,620.435835 = r + the 456 fee. Reserve consumed: r.
activation + 1 h Once the cooldown has passed, the attacker requests redemption (TrancheVault.sol:617-619; the cooldown starts at activation, :1108-1110). The request targets b + 2 h, and the attacker settles and claims. Redeemed: 4,001,702.363794 (LP P&L +1,702.363794). Treasury: +912 (B's two fees).

The next cycle's boundary is b + 3 h; its deposit request is placed right after the b + 2 h exit settles, once the attacker's shares have left Junior.

Exit direction (same rule, opposite sign)

An LP that also trades can reverse the legs around its own redemption:

  1. It opens a skew-increasing position 60 s before its redemption is priced. Its VPI charge c is now pool cash (recorded as revenue at CfdEngineSettlementSidecar.sol:454-463), so it is inside the NAV that prices the redemption.
  2. It closes right after the settlement. The clamp allows this skew-reducing close a rebate of up to c, paid from pool cash that now belongs to the remaining LPs.

RT6 tests A3, A4 and A6 measure this. A7 runs the entry direction at Senior/Junior = 3 (see Impact Details).

Relation to the documented design

The following is documented, and this report does not dispute it:

  • Anticipated VPI and the VPI reserve are outside terminal K and LP NAV. "Carry, VPI, execution/frozen spreads, protocol fees, liquidation reserve, order margin, and other action reserves are deliberately excluded" (ACCOUNTING_SPEC.md:141-142). "The VPI reserve therefore does not inflate marked LP receivables or symmetric LP NAV" (ACCOUNTING_SPEC.md:1064-1066). See also SECURITY.md:863, SECURITY.md:871-872, WHITEPAPER.md:510-512 and WHITEPAPER.md:887-888.
  • Entry and exit are priced from one terminal-NAV snapshot. "an entrant ... receives credit only for collectible marked receivables" (ACCOUNTING_SPEC.md:172-173; invariant 7 at ACCOUNTING_SPEC.md:1288; WHITEPAPER.md:544-547).
  • Trading can change NAV between the request cutoff and settlement (ACCOUNTING_SPEC.md:228-229; SECURITY.md:1044-1048; WHITEPAPER.md:742-744).
  • For carry, collection-time ownership is intentional. "This intentionally allows a trader and incoming LP to time collection after LP activation and share carry accrued before that activation" (ACCOUNTING_SPEC.md:737-740; WHITEPAPER.md:974-977).

The PoC does not show any of these rules being broken. It shows what they produce when the party that times the deposit also creates the VPI rebate reserve that returns to the pool after activation. That result differs from the documented carry case in four ways (the first three measured, the fourth from the documentation):

  1. No revenue is created beyond B's own payments. Test 3 runs B's round trip without the entrant:
    • incumbent Junior value changes by +0.035145 USDG, and the treasury receives B's two fees, 912 USDG;
    • after the settlement at b, stored juniorPrincipal (the Junior tranche's stored NAV, which also takes in revenue) is 2,164.435835 lower than without B (999,966.032348 against 1,002,130.468183). The reconcile at b nets the dip against T's VPI charge (2,165.998556), which had not been distributed yet and covers the whole dip, so in this cycle the dip reduces undistributed revenue. The remaining 34.966977 between stored juniorPrincipal and the 1,000,000.999325 recorded after bootstrap is the Senior coupon accrued since bootstrap (36.529698, the same gap the world without B shows against bootstrap plus T's charge) minus the 1.562721 by which T's charge exceeds r. B's close restores the 2,164.435835.
    • What reaches the pool after activation is the pool's own rebate, coming back from B's reserve.
    • Over one trading day (U1_1, NEG world; see Impact Details), eight such round trips without the entrant leave the incumbent's claimRedeem 42.607766 USDG above the run without them.
  2. The loss is not limited to revenue.
    • U1: over one trading day, the incumbent's loss against the run without the attacker is 3.37 to 5.19 times an upper bound on all trading revenue the pool receives in that run, and the incumbent redeems less than it deposited (see Impact Details).
    • Test 4: three natural-skew cycles cost incumbents 5,199.366316 USDG against the control. That is more than twice T's 2,165.998556 USDG charge.
    • Test 5 has no third-party trader. Account A opens the skew, paying 2,165.998556 USDG of VPI into the pool, and closes it after the third cycle, when the pool pays out 1,696.684425 USDG. Each B round trip returns exactly the rebate it received. With every position closed, incumbents end 4,642.421468 USDG (46.43 bps) below a run in which the attacker never acts.
    • By contrast, the carry text accepts only that timing can "transfer part of old carry revenue to a new LP" (ACCOUNTING_SPEC.md:739-740).
  3. Value collected before activation is left out of the activation price. For carry, "Carry collected before deposit activation is already included in the activation price" (ACCOUNTING_SPEC.md:734-735; WHITEPAPER.md:969-970).
    • In the control of test 1, the entrant pays for T's charge: it activates at the pre-open price, a 0.00 bps discount.
    • In the attack, B's open, committed 120 s before the boundary and executed in the next block, removes r from pool assets, and the entrant activates 21.60 bps lower. The clamp returns exactly r seconds after activation.
    • The carry rule's other half, sharing carry collected after activation, concerns pending carry, which the spec defines as trader debt, not an LP NAV receivable (ACCOUNTING_SPEC.md:731-733); it has not yet been paid to the pool. r was pool cash until B's open executed, 119 s before the boundary.
  4. Unlike the carry case, this result was not found in the documentation.
    • For carry, the corresponding result is stated as intentional (ACCOUNTING_SPEC.md:737-740). For the VPI reserve, the documentation states the exclusion ("does not inflate marked LP receivables or symmetric LP NAV", ACCOUNTING_SPEC.md:1065-1066; also SECURITY.md:871-872) and the withdrawal rule ("LPs cannot withdraw it as marked equity before the matching position obligation settles", WHITEPAPER.md:887-888; also ACCOUNTING_SPEC.md:821-822).
    • No passage was found in the perps documentation or the NatSpec on an entrant that activates while a VPI rebate reserve is outstanding and then shares it when the clawback returns it to the pool. Neither "LP accounting limitations" (SECURITY.md:1380-1399) nor "VPI limitations" (SECURITY.md:1434-1444) lists it.

The clamp comment quoted above names "LP sandwich attacks" around a VPI round trip as the threat the clamp addresses (CloseAccountingLib.sol:112-114). "VPI limitations" states that "the lifetime clamp intentionally zeroes otherwise extractable rebate-only round trips" (SECURITY.md:1443). Both hold for B's account in the PoC; the value moves through the deposit's share price instead.

The anti-flash cooldown starts at activation (WHITEPAPER.md:715-716), and the attacker respects it. Because the reserve returns seconds after activation, the cooldown only sets how long the attacker holds the shares. Of the request-to-activation delay, the whitepaper says: "The delay separates request funding from activation; it is not a substitute for exact valuation." (WHITEPAPER.md:734-735).

Known issues

  • AI scan "Temporary pool liquidity can reduce a skew-increasing close charge" (info, audits/scan-plether-fi-plether-core-d4541b49.md:1693). The entrant's deposit does raise depth before B's skew-increasing close, and the clamp then holds B's charge at r + fee in every cycle (test 1: 2,620.435835 USDG assessed, against an unclamped VPI of 928.285241 USDG at depth D − r + X). Without the entrant, B's close is priced at the depth reduced by r and repays slightly more than r, about r²/D per cycle (U1_1 NEG: the incumbent ends 42.607766 USDG above BASELINE over eight round trips, B's carry included). The deposit therefore lowers B's close charge only by that depth term, while the entrant takes α·r of the returned reserve.
  • AI scan "Temporary pool-liquidity reduction can amplify a skew-reducing close rebate" (info, :1742). This concerns the exit direction, where the attacker's own redemption lowers depth before its skew-reducing close.
    • In A3, the pool pays back 50,911.852575 USDG at the close, against a 63,680.398407 USDG charge at the open.
    • A6 runs the same close before the boundary, at unchanged depth, and the pool pays back 50,861.740002 USDG.
    • The attacker's gain comes from the redemption price. Its LP leg receives 50,944.596856 USDG more than in the plain round trip, while its trading account ends 25,536.545832 USDG below its funding.
  • Cecuro HIGH-1, MED-7 and MED-18 (clock alignment, component selection, mark rewrite). The basket is 1.20 on every update, so no price choice is involved.
  • SC Audit Studio SC-H1, "Deposit Before Yield is Accrued Allows to Dilute Yield". This concerns the Senior coupon and was fixed by the Senior rewrite (plether-core#23). In test 2 the entrant pays its share of the coupon (−29.211846 USDG), so that fix holds here. The value source in this report is the VPI rebate reserve. SC-H1's stated impact is "Yield can be diluted leading to loss of funds for previous depositors"; in U1 the incumbent's redemption falls below its deposit.
  • SECURITY.md "Known Limitations" (SECURITY.md:1328-1457). None of its seven subsections, including "LP accounting limitations" and "VPI limitations", describes an entrant capturing a reserve that returns to the pool after it activates.

Impact Details

One trading day: the incumbent redeems less than it deposited (U1; USDG; release build)

packages/perps/test/poc/u1/U1_JitJuniorPrincipalLoss.t.sol reuses the R7 harness unchanged: launch parameters, 1 USDG seeds, production entrypoints and a basket of 1.20 on every update. It runs one trading day of eight cycles, one every 3 h, in four worlds on one absolute timestamp schedule:

  • ATTACK: B's round trip and the entrant's Junior deposit and redemption in every cycle;
  • CONTROL: the same deposits and redemptions, without B;
  • NEG: B's round trips, without any deposit;
  • BASELINE: no attacker activity.

Trader T holds a long of 0.38 of pool depth all day and closes it after the last cycle, so no position is open in any world. Every incumbent LP then redeems in full through requestRedeem, OrderRouter.settleLpEpoch and claimRedeem. The test asserts that no pending or claimable redeem request remains. The first table gives the USDG the incumbent Junior LP receives from claimRedeem minus the 10,000,000 USDG it deposited. Attacker net is defined as for the R7 table below.

Test Pool Confidence ATTACK BASELINE CONTROL NEG Attacker net
U1_1 J 10M, X 40M 0 −44,674.932832 +1,717.044833 +1,615.080433 +1,759.652599 +21,965.393356
U1_2 J 10M, X 40M 10 bps −33,655.807162 +3,611.937429 +3,510.072523 +18,821.489942 +12,846.537849
U1_3 J 10M, S 20M, X 40M 0 −136,463.071244 +402.386472 +2,522.242295 +530.220406 +63,671.134698
U1_4 J 10M, S 20M, X 40M 10 bps −103,384.037261 +6,087.182932 +8,205.536810 +51,716.822251 +36,292.926453
Test Incumbent loss vs BASELINE Revenue bound, BASELINE day Loss / bound Senior claimRedeem, ATTACK − BASELINE
U1_1 46,391.977665 8,936.739801 5.19 n/a (seed only)
U1_2 37,267.744591 10,828.023190 3.44 n/a (seed only)
U1_3 136,865.457716 26,811.243763 5.10 +0.527123
U1_4 109,471.220193 32,485.212145 3.37 +0.527123

What the runs show:

  • Below the deposit only when both legs run. With no open position and no price move, the ATTACK incumbent redeems less than it deposited (44.67 bps less in U1_1, 136.46 bps in U1_3), while BASELINE, CONTROL and NEG each return at least the deposit. Both are asserted in every U1 test.
  • More than all revenue of the same day without the attacker. In BASELINE the only trading inflows to the pool are T's VPI charge cT at its open and what T pays at its close. T's close also pays T a VPI rebate, which the lifetime clamp caps at cT, so what T pays at its close is at most T's close flow plus cT, and the day's trading revenue is at most 2·cT + T's close flow (U1_1: 2 × 7,219.694559 − 5,502.649317 = 8,936.739801). The incumbent's loss against BASELINE is 3.37 to 5.19 times that bound (the test asserts more than 3 times) and larger than its whole realized BASELINE yield (also asserted).
  • The returned rebates are recorded as revenue, but they are not new value. In ATTACK the pool records the eight returned reserves as Revenue. Each returns exactly the rebate the pool paid B at its open (asserted every cycle), so together they equal the logged sum of B's rebates, Σr = 57,832.891994 USDG in U1_1, which is more than the entrant takes (Σα·r = 46,285.066506). NEG runs the same round trips without the entrant, and the incumbent ends 42.607766 USDG above BASELINE: B's close is priced at the depth reduced by r, so B repays slightly more than r; B's carry adds to that. At 10 bps NEG ends higher still (U1_2: +15,209.552513 against BASELINE), because B's adverse fills also pay the pool.
  • Above the deposit after cycle 1, below it from cycle 2 on, lower after every cycle. After cycle 1 the ATTACK incumbent is still above its deposit in every test (U1_1: 10,001,448.129496). From cycle 2 on, about 5 h after the first boundary, it is below it (U1_1: 9,995,672.567372 after cycle 2, 9,960,934.816881 after cycle 8), and every later cycle lowers it further. All three facts are asserted. In U1_1's BASELINE the same valuation stays at 10,007,219.69 USDG, the deposit plus T's VPI charge, until T closes; T's close then refunds most of that charge (pool flow at T's close: −5,502.649317). The margin above the deposit after cycle 1 (U1_1: 1,448.129496) is smaller than that refund. In U1_1 the cycle-1 gap between BASELINE and ATTACK (5,771.564305) is already larger than BASELINE's realized yield for the whole day (1,717.044833); this comparison is arithmetic on the logged values, and the test asserts the cumulative form.
  • Where the value goes. The incumbent's loss against CONTROL equals Σα·r minus the adverse-fill drag to within 2 % (asserted; U1_1: 46,290.013265 against 46,285.066506; U1_2: 37,165.879685 against 46,284.272489 − 9,118.061613). The attacker keeps that take net of B's 16 execution fees, which are the whole treasury difference (asserted; U1_1: 24,319.488).
  • CONTROL against BASELINE. −101.964400 in U1_1 and −101.864906 in U1_2: T's carry is utilization-priced (WHITEPAPER.md:922-939), so the entrant's capital lowers T's carry while it is in the pool, and the difference equals the difference in T's close flow to within 0.0002 USDG. +2,119.855823 in U1_3 and +2,118.353878 in U1_4, where the entrant pays part of the Senior coupon; this is why the loss against CONTROL is larger than the loss against BASELINE in those two tests.
  • Senior redeems more than its deposit in ATTACK and in BASELINE, and the attack changes its claimRedeem by +0.527123 USDG (U1_3, U1_4).

The per-cycle values are vault valuations (convertToAssets) at a fresh mark, read at the same second in every world; the pending-reconcile view applies the mark-dependent part of the reconcile only while the mark is fresh (HousePool.sol:1648). Where no settlement ran at that second, the test takes a state snapshot, applies one permissionless mark refresh, reads and reverts, so the read does not become part of that world's history. The realized figures are the claimRedeem amounts.

Single-cycle and three-cycle results (R7 and RT6; USDG; release build)

Definitions:

  • Attacker net: the change in value of all attacker addresses over the run (wallets, clearinghouse balances, and Junior shares at NAV). It is after B's fees, carry, and the entrant's share of the Senior coupon.
  • Control: the same schedule with the entrant but without B's round trip.
  • bps (this table): the loss divided by the incumbent Junior LP's value at the end of the comparison run (the control; for test 5, the run without the attacker), truncated to two decimals as the PoC prints it.
Test Setup Attacker net Incumbent Junior LPs
1 J 1M / S 2M / X 4M; natural skew 0.38·D; 1 cycle; confidence 0 +790.328977 −1,731.539093 vs control (17.27 bps)
7 / 8 / 9 test 1 at confidence 1 / 5 / 10 bps +756.196181 / +619.659826 / +448.977744 −1,697.406164 / −1,560.869283 / −1,390.186543 vs control
6 J 10M / S 20M / X 40M; otherwise as test 1 +7,903.303339 −17,315.419987 vs control (17.27 bps)
10 / 11 / 12 test 6 at confidence 1 / 5 / 10 bps +7,561.975417 / +6,196.612040 / +4,489.791427 −16,974.090440 / −15,608.720568 / −13,901.891837 vs control
4 test 1 repeated for three consecutive cycles +2,375.733126 −5,199.366316 vs control (51.88 bps)
5 J 1M / S 2M / X 4M; skew opened and finally closed by attacker account A; three cycles +1,450.418995 −4,642.421468 vs no attacker activity (46.43 bps)
2 control: entrant without B's round trip −29.211846 +29.211040 vs no attacker activity
3 negative control: B's round trip without the entrant B pays its two fees (912) +0.035145 vs no B round trip

Where the value goes:

  • Test 1: the incumbents' loss against the control (1,731.539093) equals the attacker's gain against the control (819.540823) plus B's two fees to the treasury (912), to within 0.001730. Senior differs by 0.000000.
  • Test 6: the same split holds: 17,315.419987 against 8,195.421717 + 9,120.
  • Test 5: the incumbents' loss equals the attacker's net plus the treasury's 3,192, to within 0.002473.
  • With confidence (tests 7–12): every fill is shifted against the trader by 25 % of the basket confidence; the PoC asserts this from the fill events. This lowers both the attacker's gain and the incumbents' loss. The sign does not change up to the 10 bps limit, which is the widest confidence the oracle accepts (PletherOracle.sol:869-873).

Exit direction and entry at S/J = 3 (RT6 tests, release build). Setup: Senior 30M, honest Junior 10M, attacker Junior 40M, basket 1.20, confidence 0.

Test What the attacker does Attacker net (plain LP round trip) Honest Junior LP value, plain → attack
A3 SHORT of 31,920,000 notional (just under 0.4 of depth), opened 60 s before its exit settlement and closed after it +24,969.688449 (−438.362575) 9,999,616.439766 → 9,961,440.316452 (−38,176.123314)
A4 A3 three times in a row +75,098.378071 (−1,315.133846) 9,998,849.297878 → 9,884,131.721317 (−114,717.576561)
A6 timing control: the same trade, opened and closed before the settlement −15,770.038270 (−438.362575, the same plain round trip as A3) 9,999,616.439766 → 10,002,180.115205 (+2,563.675439)
A7 entry: a SHORT against an honest LONG of 15,960,000 notional, opened before its activation and closed after it +12,245.611184 (−438.083600) 10,031,456.279911 → 10,006,004.587670 (−25,451.692241)

Classification

Selected impact: Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield (Critical). The attack takes part of the USDG the incumbent Junior LP deposited, not only yield owed to it:

  1. Counterfactual. With every position closed, no price move and a full redemption at the end, the incumbent's claimRedeem falls below its 10,000,000 USDG deposit only when both attacker legs run (U1): 9,955,325.067168 USDG in a Junior-only pool and 9,863,536.928756 USDG with 20M Senior. BASELINE, CONTROL and NEG all return at least the deposit. Without the attacker, the incumbent's realized yield for the day is +1,717.044833 USDG (U1_1); the attack costs it 46,391.977665 USDG against that day.
  2. More than all revenue of the same day without the attacker. The loss against BASELINE is 3.37 to 5.19 times an upper bound on all trading revenue the pool receives in the same day without the attacker (BASELINE). Tests 4 and 5 show the same in R7 (see "Relation to the documented design", item 2).
  3. The Revenue record is the pool's own cash coming back. The returned reserve is recorded as claimant Revenue (CfdEngineSettlementSidecar.sol:604-613), and in ATTACK the returned reserves alone exceed the entrant's take (U1_1: Σr = 57,832.891994 against 46,285.066506). Each record closes a round trip that nets to zero for the pool: the same r left pool cash 122 s earlier (HousePool.payOut, HousePool.sol:604-613), and each close returns exactly r (asserted). Without the entrant, the same eight round trips leave the incumbent 42.607766 USDG above BASELINE (NEG). The entrant's share of each return is therefore value the incumbents held before B's open.
  4. Repetition. Each cycle takes α·r of the incumbents' NAV (less the adverse-fill drag at nonzero confidence), whatever that NAV consists of; the test asserts r ≤ 0.08 % of pool depth at every B open. After cycle 1 the incumbent is still above its deposit in all four U1 tests, because T's VPI charge is still in its NAV. From cycle 2 on it is below its deposit, and each of cycles 3 to 8 starts below the deposit and lowers its value again, so each of those cycles takes deposited USDG (both asserted; values under "What the runs show"). Every step is permissionless, and on a trading day a new cycle can start every 3 hours (entry activation is deferred while the oracle is frozen, SECURITY.md:1387-1388).

For comparison, Immunefi reports #37315 and #37311 (Jito Restaking) are published as High, "Theft of unclaimed yield": a depositor that joins just before a reward is distributed takes part of that reward (99 % of it in #37311). Both describe the existing depositors' loss as part of the reward; neither describes a loss of deposited principal. Here the incumbent's redemption falls below its deposit.

Every executed attack run is net profitable; the lowest are +448.977744 USDG for one cycle (test 9) and +12,846.537849 USDG for one day (U1_2), both at the 10 bps confidence limit. The griefing rule therefore does not apply.

Fallback. If the amount taken is classified as yield, the applicable impact is Theft of unclaimed yield (High), and the R7 tests prove it without U1: test_R7_1 and test_R7_4 to test_R7_12 measure the take, and test_R7_2 (entrant without B) and test_R7_3 (B without entrant) are the controls. In every cycle B's open lowers the incumbents' Junior NAV by r bef

The original report as published on Immunefi, by itko69. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

Likely the design prices new LP deposits on a NAV that excludes the locked VPI rebate reserve, while the reserve returns to the pool shortly after activation, so whoever times the deposit captures part of it.

Impact

Over one trading day the incumbent Junior LP's redemption falls below its deposit only when both attacker legs run, and the attacker nets a profit; the text notes the loss is 3.37 to 5.19 times an upper bound on the day's trading revenue.

What the attacker needed

A Junior deposit request before cutoff; ability to execute keeper transactions; a third-party trader creating skew; attacker capital for the deposit

How it was found

  1. Request a Junior deposit before the epoch request cutoff.
  2. Open a skew-reducing position about 120 seconds before the epoch boundary so a rebate leaves pool cash and is locked as a reserve.
  3. Settle the epoch through the permissionless router about one second after the boundary so the deposit activates at the lowered NAV.
  4. Commit the full close about two seconds after the boundary so the reserve returns to the pool.
  5. After the one-hour cooldown, request redemption, settle and claim.

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.

A pool holds money for people who deposit it, and each depositor's share is priced from what the pool is currently worth. The report shows a trader who can make the pool look temporarily poorer just before their deposit is priced, then richer again just after, so they buy shares cheaply and sell them back at the higher price. The extra value comes out of the other depositors' money.

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.

More from Plether

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.