Skip to content
Business logic Audit finding Advanced

Plether Perps: returnable positive VPI booked as distributable LP equity lets a redeeming LP cohort export the close-side rebate onto the remaining junior tranche

A positive VPI charge collected when a trader opens a position is booked as distributable pool equity even though the pool still owes it back on close, and nothing reserves it. An attacker who is both the trader and a redeeming LP can withdraw the inflated principal before the close, leaving the remaining junior LPs to absorb the rebate shortfall.

pizzalover337 Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#97608 [SC-Critical] Plether Perps: returnable positive VPI booked as distributable LP equity lets a redeeming LP cohort export the close-side rebate onto the remaining junior tranche

Submitted on Nov 2nd 2026 at 14:20:07 UTC by @pizzalover337 for Audit Competition | Plether

Description

A positive VPI charge collected when a trader increases skew can be returned in full when the trader later reduces skew. The protocol credits this charge to HousePool revenue as soon as the open settles, but reserves nothing against the position's positive vpiAccrued. An LP that redeems before the trader closes is therefore paid from principal that includes funds the pool still owes back to the trader.

An attacker can control both the trader and the redeeming LP. After the redemption leaves, the close pays the VPI rebate from remaining pool cash, and the next reconciliation assigns the resulting shortfall to the junior tranche first. The LPs who remain in the pool bear the loss, and the cycle repeats against them at every epoch boundary. In the executed deferred-window PoC, one cycle nets the attacker $656.99 after all fees while the remaining junior LPs absorb a $2,663.23 shortfall, and a control run of the identical cycle with the redemption moved outside the window nets −$1,091.31.

Impact

Impact claimed: Theft of unclaimed yield. Severity claimed: High.

Value booked as junior-tranche revenue out of a charge the pool still owed back to the trader is exported out of the pool by a redeeming LP cohort before the trader's close returns it; the resulting shortfall is charged to the junior LPs who remain, none of whom has claimed any of it. In the executed deferred-window PoC, one cycle nets the attacker coalition $656.99 after all execution fees, carry and gas, while the standing junior cohort absorbs a $2,663.23 shortfall charged junior-first by the waterfall, and a sentinel LP's identical 0.5M stake redeems at 991.54 per 1,000 fair while the attacker exited at 1,000.36. The attack is permissionless, requires no privileged role, no misconfiguration and no particular market direction, and repeats at the 1-hour LP-epoch cadence against the same standing cohort.

A control run isolates the cause. The identical cycle with a single change, namely the redemption request moved past the epoch cutoff so that it prices after the close, yields a coalition net of −$1,091.31. The unreserved booking, not fees or mark drift, is what pays the attacker.

Escalation, offered for the triager's assessment rather than as the claim: within any single cycle the pool as a whole remains solvent; value moves between LP cohorts rather than out of the protocol, and the attack compounds by repetition toward junior insolvency, diluting every deposit priced inside a live window (in the executed PoC a sentinel deposit minted measurably fewer shares than an identical deposit one epoch earlier, with no redemption anywhere in its settlement pass). The shortfall is charged below the juniors' principal line: juniorPrincipal drops by the absorbed amount against deposit-backed value. If that loss is read as a reduction of the LPs' principal rather than of distributed yield, the same demonstrated facts satisfy the Critical entry "Direct theft of any user funds, whether at-rest or in-motion": the PoC demonstrates the mechanism identically under either reading.

Victim: the remaining HousePool junior LPs whose tranche principal absorbs the exported rebate through the junior-first shortfall, and any LP whose deposit or redemption is priced inside a live VPI window.

Root cause

Between a skew-increasing open's collection of a positive VPI charge and the skew-reducing close that returns it, nothing reserves the still-returnable charge from LP equity. Every LP redemption priced inside that window therefore exits with a share of a charge the pool owes back.

Mechanism

  1. Booking. CfdEngineSettlementSidecar.executeOpen (lines 446-464). When an open settles, the whole VPI charge V lands in the HousePool as recordClaimantInflow(V, Revenue, CashArrived). With live tranches this is immediately distributable pool equity: HousePool.recordClaimantInflow credits accountedAssets, and Revenue is queued into pending trading revenue only when seniorPrincipal + juniorPrincipal == 0. The trader's right to the whole charge back is recorded in parallel (vpiAccrued = +V, written at sidecar line 517), but the engine creates no escrow for it. The vpiRebateReserve ledger, which does escrow returnable VPI, exists only for the negative side (sidecar 466-477: lockVpiRebateReserve runs only on a negative charge). Demonstrated on-chain at the open transaction: pool inflow equals V exactly, vpiRebateReserve == 0, pendingTradingRevenue unchanged.

  2. Recognition. Every settleLpEpoch reconcile (HousePool._settleLpEpoch, HousePool.sol:824, reconcile call at :835). HousePoolAccountingLib.buildReconcileSnapshot (lines 60-78) computes distributable pool equity from physical assets, trader claims and the terminal price delta, with no deduction for open positions' positive vpiAccrued, and HousePoolReconcilePlanLib.planReconcile (surplus routing at lines 84-99) sends the surplus through distributeRevenue into juniorPrincipal (`HousePoolWaterfallAccountingLib.sol:140-159). The string "vpi" does not appear anywhere in HousePool.

  3. Payment. executeClose (sidecar 618-624; the rebate payment itself at 621-624) with CfdEnginePlanLib 953-977 and CloseAccountingLib 103-118. The close returns the accrual out of current pool free cash. CashPriorityLib.reserveFreshPayouts reserves only trader claims, never LP liability, buffer, or any escrow of previously distributed VPI income, so freePoolCashAssets still contains the booked V, and HousePool.payOut sends it (accountedAssets -= paid). The lifetime clamp caps the rebate at the position's VPI accrual, net of the close leg's own costs: the executed run emitted ActionRebateSettled with assessed == paid == $2,627.36 and waived == 0 against the open-leg accrual V = $3,360.65 (the $733.28 difference is the close leg's 4 bps execution fee), and juniorPrincipal was unchanged by the payment transaction. The shortfall surfaces only at the next reconcile, junior-first, on whoever still holds shares.

Conservation therefore fails across LP cohorts rather than for the pool as a whole: the redeeming cohort realizes redemptions exceeding its pre-window entitlement by the pro-rata share of V, the trader is made whole by the rebate, and the difference is absorbed by the remaining juniors with no offsetting trader loss.

Two exploitation paths

The defect is exercisable through two orderings of the same legs. Both were executed on the fork.

Primary path (cross-epoch). The redemption is requested after the banking epoch's cutoff and matures an epoch later, so the banking settle provably funds zero redemptions and the same-settlement pricing described below never runs. The extraction still works because every settle between the engine's booking and the engine's payment prices the contaminated principal. The window is "any settle before the close", not "the banking pass". The full executed timeline is in the next section.

Variant (same settlement). The redemption phases of a settleLpEpoch pass read pricingPrincipal after the reconcile has banked V into juniorPrincipal (HousePool.sol:839-888), so a queued junior redemption converts shares to cash at a principal that includes V. Executed result: one settle first banks $3,699.82 as junior revenue (V plus mark drift), then funds the attacker's matured redemption at the inflated principal, a payout of $2,502,312.66 against a $2,500,000.00 fair value, a harvest of $2,312.66. The close then returns the accrual from pool cash and the following settle charges $2,801.24 junior-first to the remaining holders. A sentinel LP with an identical stake realized −$471.51 on its $500k redemption (per-share 998.567 against the attacker's 1000.435; same deposit, same terms, one epoch apart). The variant's control is the decisive falsification: move only the redemption request past the epoch cutoff so that it prices after the close, and the identical cycle yields a coalition net of −$1,091.31.

Executed scenario (primary path, arbitrum-sepolia fork of the deployed stack)

Attacker: one operator with two plain contracts (no cheatcodes against the targets; actors are funded through the deployment's public MockUSDG.mint). Marks are real signed Pyth keeper blobs with block and transaction provenance inline in the fixtures. LP epochs are 1h.

  1. ep498160-498161: the attacker LP deposits 2.5M USDG junior; a sentinel LP deposits 0.5M (activated at the fair pre-window price).
  2. ep498162: the sentinel deposits a second 0.5M (tranche T2), which matures for activation at the ep498163 settle and provides that settle's required "progress".
  3. ep498163: the trader opens LONG 19,000 lots (~$1.83M notional, ~36% skew). The whole VPI charge V = $3,360.65 lands as Revenue/CashArrived: pool.totalAssets() rises by exactly V, vpiAccrued = +V, vpiRebateReserve = 0, pendingTradingRevenue unchanged. The attacker then requests its full redemption after the epoch cutoff (matures ep498164).
  4. Banking settle: the reconcile banks V (plus drift) as junior revenue and prices zero redemptions (LpEpochSettled carries juniorRedeemAssets == 0, asserted in the test). Its only priced entry is the sentinel's T2, which mints fewer shares than the identical T1 deposit one epoch earlier: the contamination repriced a deposit with no redemption in the pass.
  5. ep498164, one full epoch later: a router settle funds the attacker's matured redemption at the still-V-inflated principal, a payout of $2,502,132.71 against a $2,500,000.00 pre-window fair value, harvesting $2,132.71 (101.5% of the attacker's pro-rata share f·V).
  6. Same epoch, after the redemption: the trader closes the full position. Net depth is lower, the lifetime clamp caps the rebate at the position's VPI accrual, and the planner pays $2,627.36 (the $3,360.65 accrual net of the close leg's $733.28 execution fee) from trader-claims-only free pool cash: assessed == paid, waived == 0, juniorPrincipal unchanged by this transaction, vpiAccrued back to exactly 0.
  7. ep498165: the next reconcile absorbs the shortfall junior-first: a pure absorb of $2,663.23 charged to whoever still holds (sentinel plus unredeemed T2), senior untouched (asserted). The sentinel's identical 0.5M stake redeems at 991.54 per 1,000 fair while the attacker exited at 1,000.36, a measured per-share cohort differential.

Coalition result per ~4h cycle: the trader's own charge is returned in full (modulo fees) while the attacker LP already left with $2,132.71 of the same charge; net +$656.99 after all fees, carry and gas (final assertion on usdg.balanceOf(attackerLp)). The same-settlement variant nets +$660.25 per cycle on the same accounting.

Documentation analysis

Every mechanical leg is documented in the project's own material at the audited commit a82d4fef (byte-identical to the deployment source 1209ca8a):

  • WHITEPAPER.md:811, "VPI | Price a change in directional skew | Pool when positive; trader rebate when negative"; :411-412, "Positive VPI increases physical pool assets".
  • ACCOUNTING_SPEC.md:635, "recordClaimantInflow(amount, Revenue, CashArrived): claimant-owned value where fresh cash entered the pool in this flow"; WHITEPAPER.md:765-766 same.
  • WHITEPAPER.md:903-904: the $20,000 telescoping example makes the charge returnable ("Reversing the move at unchanged depth produces a $20,000 rebate").
  • WHITEPAPER.md:885-886 / ACCOUNTING_SPEC.md:1061-1063 / SECURITY.md:871: the close-time action rebate "comes only from pool cash free of existing trader claims".
  • ACCOUNTING_SPEC.md:337, "Charge a shortfall to Junior first, then Senior."

The protective statements are all scoped to the negative (receivable) side of the same mechanism. SECURITY.md:866-871 reserves gross negative lifetime VPI ("a dedicated nonwithdrawable reserve equal to max(-vpiAccrued, 0)"); WHITEPAPER.md:887-888 excludes that reserve from the terminal price curve ("so LPs cannot withdraw it as marked equity before the matching position obligation settles"); SECURITY.md:376 states VPI reserve conservation for the negative side only. No first-party statement classifies the returnable positive charge's ownership. The nearest permissive analogue, the carry collection-timing policy (ACCOUNTING_SPEC.md:731-740, "not a claim that timing cannot transfer part of old carry revenue to a new LP"), covers carry, which is not returnable: a closing trader cannot reclaim collected carry, but can reclaim the entire VPI charge. The repository's own tests assert only trader-side invariants (VpiRoundTripAccounting.t.sol: "Depth manipulation round-trip must not produce positive PnL", "VPI clamp should prevent net rebate extraction"); no test covers an LP redemption inside the VPI window.

Relation to known issues

None of the program's published known issues covers this mechanism.

  • Cecuro HIGH-1 (Arbitrum/Pyth clock alignment) concerns commit-side latency under clock skew. This demonstration commits and settles on fresh, honestly-kept marks; no latency, skew or race is involved.
  • SC-M4 (pre-audit, "Risk Free Option in 60Sec Oracle Window") is an oracle-window order timing option. This report is an LP-cohort accounting defect, an unreserved returnable charge, not order timing or optionality.
  • Cecuro MED-22 (carry rounding): the deltas here are exact, not a rounding edge. MED-16 and LOW-57 (opens committed against a stale cached price; keeper bounty sizing): the opens here commit against fresh marks. MED-13 (oracle rotation retargeting armed stop-losses) and MED-7 (older valid signed price per feed): no rotation, no price selection, one feed basket throughout.
  • The known-issue entry on ordinary closes carrying no execution bounty concerns close-path keeper economics. Both paths in this report are open-side VPI booking and LP-side pricing.

Affected assets

Deployed on arbitrum-sepolia (chain 421614), perps v2.0.0:

  • CfdEngineSettlementSidecar 0xd3ede337e042d5aa6ba68e03d0c885b3d4a062dc (booking and payment)
  • CfdEngine 0xca18a6783d7542f9d2f28f4f259772b74c4d6baa (vpiAccrued)
  • HousePool 0xeb5604c393843b2f3c347ec24fa9ddad6ab2131e (revenue booking, payOut, settleLpEpoch pricing)
  • Junior vault 0x4a8b67184a1e3224c11a191cc69f22c50eef734e, Senior vault 0x5dc42ba5a1e8dd3e1b6868d10f66a9bf8fb5b83d
  • MarginClearinghouse 0xb5b851f627d6df3cf3f096e23e20a58884d7b89a, OrderRouter 0x918663d6da8cb33b325a04c4a5e8c51d42f3b444, settlement USDG 0x3d051dbbf5ff427a4ae8ad09746902666af8fb9d

All are non-proxy deployments; on-chain bytecode was verified identical to the audit pin a82d4fef at every fork block used below (the only differences are constructor immutables and the metadata hash). The PoCs touch none of the six excluded view-only lens and quoter contracts.

Economics

All numbers come from the executed traces; USDG is counted 1:1.

  • VPI charge booked and returned in full: V = $3,360.65 per open/close round trip at 19,000 lots (~$1.83M notional, ~36% skew; vpiFactor 0.01, maxSkewRatio 0.4 at deployed defaults).
  • Gross harvest per cycle (excess over pre-window fair value): $2,132.71 (attacker junior share f ≈ 0.556 of 4.5M junior).
  • Attacker cost per cycle: $1,476.43, consisting of two 4 bps execution fees on the notional (about $733 at the open and $733.28 at the close, exactly the accrual-minus-paid gap), carry, and gas (11,702,125 gas ≈ $0.70 at L2 base fee with ETH at a $3,000 stand-in).
  • Net +$656.99 per ~4h cycle, repeatable at the 1-hour epoch cadence, on a $2.5M parked junior stake.
  • Realizable bound: at most ~8 bp of net pool depth per cycle (about $1.6k against the standing $2.0M TVL; about $4k at the PoC's $5.0M depth).
  • Victim loss: the standing junior cohort absorbs $2,663.23 per cycle (junior-first); deposits priced inside any window are diluted in the same way as the sentinel's T2.

Recommendation

Reserve the returnable positive VPI from distributable LP equity symmetrically with the negative side. Concretely, either book positive VPI charges into vpiRebateReserve (or pendingTradingRevenue) until the position's skew-reducing leg settles and release only the waived or expired remainder as revenue, or price LP redemptions and deposits inside any live returnable-VPI window off the reserve-adjusted principal that the negative side already uses.

Limitations and environment notes

  • Deployed configuration only (vpiFactor 0.01e18, maxSkewRatio 0.4, 1h LP epochs, 4 bps execution fee per leg, markStalenessLimit 60s); no other configuration exists to test.
  • The demonstrated window is one epoch; multi-epoch windows are mechanically identical but were not run.
  • The close ran in the FAD sub-window before the Friday 21:00Z oracle freeze; a frozen-regime close would reduce the rebate by the frozen spread.
  • Mark drift between the open and settle/close marks was ~0.13 bp (about $25 on the position); an adverse intraday move could shrink or invert a single cycle's surplus. The attacker times the settles; the marks are the public keeper stream.
  • The senior impairment path was not exercised (senior stayed at its high-water mark; the waterfall's senior-restore branch never ran).
  • The sentinel's T2, minted at the inflated price, was left unredeemed; the realized victim witness is the sentinel's impaired T1 redemption and the junior-first absorb.
  • The banking settle requires HousePool "progress" (any matured deposit or redemption demand); in a fully idle pool the returnable V would sit in unreserved totalAssets until the first settle with progress, which is still LP-facing equity, only the principal-folding timing differs.
  • The Pyth ticks are the frozen public stream (keepers stopped at pt 1793393999); live-streaming freshness and racing were not exercised.
  • Test environment: the fork runs under chainid 31337 (anvil's ArbSys emulation does not track vm.roll, so the router's SameBlock shield could never clear on a 421614 fork; the repository's own tests run on 31337; chainid feeds only EIP-712 domains here). vm.warp and vm.roll schedule the declared epoch-cadence timeline against the real signed ticks. The pinned fork state was served by an archive gateway; the public rollup RPC prunes.

Proof of Concept

Both demonstrations are reproduced entirely from the material inline in this section. Two test files cover the two paths, and each test drives 22 deployed contracts through the real router, engine, clearinghouse and pool paths:

  • Primary path (cross-epoch): testVpiCrossEpochHarvest in test/VpiCrossEpochPoc.sol proves the engine's booking and payment legs with the same-settlement coupling removed. The redemption is requested after the banking epoch's cutoff, matures an epoch later, and the banking settle provably funds zero redemptions.
  • Variant (same settlement): testInsideWindowHarvest and its control testAfterCloseOrdering in test/VpiSameEpochPoc.sol prove the same-settlement pricing path and isolate the cause.

Environment

  • foundry (forge) 1.8.x; solc 0.8.35 is auto-managed by the repository's configuration.
  • Clone https://github.com/immunefi-team/audit-comp-plether, check out commit a82d4fef, and work inside the packages/perps foundry project (its foundry.toml carries the remappings, solc 0.8.35, optimizer and via_ir). Create the four files below under packages/perps/test/; no other setup is needed.
  • An arbitrum-sepolia archive RPC endpoint serving historical state at block 325012936 (primary path) and 324710693 (variant). The public rollup RPC prunes after roughly 29 minutes; the gateways named below served both pins.
  • Each test selects its fork endpoint from the environment variable HUNT_FORK_URL (an arbitrary name) and pins its own fork block, so no --fork-url flag is needed.

Files (under packages/perps/test/)

file contents
packages/perps/test/Ticks.sol real-tick fixtures shared by both tests
packages/perps/test/Ticks164.sol primary-path tick fixtures
packages/perps/test/VpiCrossEpochPoc.sol primary-path PoC
packages/perps/test/VpiSameEpochPoc.sol variant PoC and control

Run: primary path (fork block 325012936)

From packages/perps/:

Bash
export HUNT_FORK_URL=https://gateway.tenderly.co/public/arbitrum-sepolia
forge test --match-path test/VpiCrossEpochPoc.sol --match-test testVpiCrossEpochHarvest -vvvv

Expected: PASS, with these logged witnesses (micro-USDG, 6 dp), each asserted in the test:

Text
VPI charge V (returnable accrual): 3360646912; pool totalAssets inflow at open: 3360646912
  (booking leg: the whole charge became unreserved pool equity; vpiRebateReserve 0,
   pendingTradingRevenue unchanged)
juniorRedeem/DepositAssets at the banking pass: 0 500000000000
  (control: the banking settle priced ZERO redemptions; sentinel T2 minted fewer shares than
   identical T1)
attacker deferred-epoch payout 2502132714093 vs fair 2499999999999 -> excess over fair:
2132714094  (the deferred-window harvest)
rebate assessed/paid/waived: 2627362189 2627362189 0
  (payment leg: full accrual returned from trader-claims-only free cash; juniorPrincipal
   unchanged across the close)
pure junior-first shortfall absorb: 2663227533; sentinel redeems at 991.54/1000 fair vs
attacker 1000.36  (the cohort export)
coalition net USDG (deferred window): 656988129

Run: variant and control (fork block 324710693)

From packages/perps/:

Bash
export HUNT_FORK_URL=https://arbitrum-sepolia.gateway.tenderly.co
forge test --match-path test/VpiSameEpochPoc.sol --match-test testInsideWindowHarvest -vvvv
# Control: the identical cycle with the redemption request moved past the epoch cutoff:
forge test --match-path test/VpiSameEpochPoc.sol --match-test testAfterCloseOrdering -vvvv

Expected: both PASS, with these logged witnesses (identical at fork blocks 324710693, 324975351 and 325012936):

Text
VPI charge V collected at open: 3360646912                    (returnable charge, micro-USDG)
junior revenue booked at the in-window settle: 3699816272     (V + mark drift banked to juniors)
attacker inside-window payout: 2502312663249                  (fair at pre-window principal: 2499999999999)
excess over fair: 2312663250                                  (the harvest, $2,312.66; expected f*V = 2100656907)
junior-first absorbed at post-close settle: 502329728358      (net of the sentinel's funded 499,528.49
                                                               redemption = $2,801.24 absorbed from remaining juniors)
sentinel after-window payout: 499528485548                    (identical stake, -$471.51 vs deposit;
                                                               per-share 998.567468e6 vs attacker 1000.434647e6)
coalition net USDG (inside window): 660248977                 (+$660.25 per ~3h cycle, repeatable)
---- control ----
attacker after-close payout: 2500562621507                    (excess +$562.62 ~= f x ~$920 retained
                                                               execution fees, NOT of V)
coalition net USDG (after-close ordering): -1091305371        (-$1,091.31: the identical cycle without
                                                               the in-window exit loses the fees and nothing else)

Revalidation

The primary-path PoC was run at four fork blocks spanning 2026-10-31 to 2026-11-01 (324710693, 324975465, 324979289 and 325012936; the last is 302,243 blocks, about 21 hours, after the first) with byte-identical logged witnesses and unchanged deployed code hashes for the engine, settlement sidecar, HousePool and router. The variant PoC and its control were re-run at blocks 324710693, 324975351 and 325012936 with identical results. On-chain bytecode was re-verified against the audit-pin source at every block (non-proxy, no upgrade during the window).

Full sources (comments stripped to fit the size limit; semantics and logged output unchanged)

test/Ticks.sol (shared by both tests)

Solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
library Ticks {
/// pt=1793386811 block=324428454 tx=0x7f3bbd78d529e2a737fb603640245850cb78fd2efcc646970c7f0299c0c10c9f - epoch 498163 B-open mark
bytes internal constant T1_B_OPEN_163 = hex"504e41550100000001240100000001030124bea331b91ab114b581426c029c920816b92e8108c96fe830b64d927b39f4ff672a80ae32ef7c0677609f25dc665bef2811fcdafcdc80d0ef01d2111bf36e75010206390b58c28df971a9b338efb02515040326e249ee1be8ab9ca02aa0fc273d7f0f76a20eefaba709d967ccafe18b2d033be21af36bee9763813b43e72d6e87ea0104171ee574785dcd91674c6c950dd12dd6b9abeff0fc439580ffe24823353bad5c428cbb00fdc29b6069fe3183869be77e2054d10ac1c6a6d2bc66e5694847b84f006ae4e93b00000000001a507974686e6574507974686e6574507974686e6574507974686e6574507974680000000859e2389c0041555756000000000859e2389c000000009e97bb7eb86bfa8c59b625ef418790f7e5636fd506005500a995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b000000000001b42c0000000000000002fffffffb000000006ae4e93b000000006ae4e93a000000000001b3ff00000000000000020c4396095a2dbc7d79b81fc14cbe0928a894e7d5b732d44ab2458b3117f1296dbca89487ab5e68a095c597ae859048868c3d548762d4500d2c79fa30414fdc18d2b9dd704f7e11ebb1883e3c77dca91392425822bb0d4dedbc148b3709ce283cfccd321bdfe67df69b00b2f89a236b59ca0c60bb7571648ee993a207e317d6508ae45f0694355537d493ee633232b1da8b58b4dcb633fa4fdcb3bdbf45327816002a10bf4c641f811454266e86baf6a530975d0831455c846b13ed3821b1c65c1a9cab11bd4fb26836b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf72172005500ef2c98c804ba503c6a707e38be4dfbb16683775f195b091252bf24693042fd5200000000000266bf0000000000000006fffffffd000000006ae4e93b000000006ae4e93a00000000000266db00000000000000050c189909c5ad7175733d4066aaff1faea36bb59b92bcbe697bb2566e198034b79dd2d2fb434cfab75a478ac5115588bc77c422b40c7909140a345726df9f53ea9360adce68518169839cfa7f262c62fba5425822bb0d4dedbc148b3709ce283cfccd321bdfe67df69b00b2f89a236b59ca0c60bb7571648ee993a207e317d6508ae45f0694355537d493ee633232b1da8b58b4dcb633fa4fdcb3bdbf45327816002a10bf4c641f811454266e86baf6a530975d0831455c846b13ed3821b1c65c1a9cab11bd4fb26836b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf7217200550084c2dde9633d93d1bcad84e7dc41c9d56578b7ec52fabedc1f335d673df0a7c10000000000020b2c0000000000000004fffffffb000000006ae4e93b000000006ae4e93a0000000000020b2600000000000000040c5c7a189f046d216fe14bf215e7bf6949a474e3c532d44ab2458b3117f1296dbca89487ab5e68a095c597ae859048868c3d548762d4500d2c79fa30414fdc18d2b9dd704f7e11ebb1883e3c77dca91392425822bb0d4dedbc148b3709ce283cfccd321bdfe67df69b00b2f89a236b59ca0c60bb7571648ee993a207e317d6508ae45f0694355537d493ee633232b1da8b58b4dcb633fa4fdcb3bdbf45327816002a10bf4c641f811454266e86baf6a530975d0831455c846b13ed3821b1c65c1a9cab11bd4fb26836b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf721720055003112b03a41c910ed446852aacf67118cb1bec67b2cd0b9a214c58cc0eaa2ecca00000000000221330000000000000004fffffffb000000006ae4e93b000000006ae4e93a000000000002212a00000000000000040c534346ec281a69c906676e1c86279f32d4e70cd968320eec395a73855803f8e98ad585c0d95c2e4d478ac5115588bc77c422b40c7909140a345726df9f53ea9360adce68518169839cfa7f262c62fba5425822bb0d4dedbc148b3709ce283cfccd321bdfe67df69b00b2f89a236b59ca0c60bb7571648ee993a207e317d6508ae45f0694355537d493ee633232b1da8b58b4dcb633fa4fdcb3bdbf45327816002a10bf4c641f811454266e86baf6a530975d0831455c846b13ed3821b1c65c1a9cab11bd4fb26836b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf721720055008ccb376aa871517e807358d4e3cf0bc7fe4950474dbe6c9ffc21ef64e43fc67600000000000efb1e000000000000005ffffffffb000000006ae4e93b000000006ae4e93a00000000000efc9000000000000000690ceaf23aa3c120fba093d44d3f4f01788b92a0946a73cc0b43371db5e36ea54fabbeed7c98a45066b32e7d2a6db720e50419bf2b0a2f9650eb774ce7788abd90fc392a9e913282f32d9244251a71465b29375a0e2b502093dd72b5d2fe08b665253c2fed4ec07c7a37c1a1c0230d2ec6e459a3afb6c36dd7d2ec45b2a374c414076664d6a5cbdcd1b063b901f79243ce541566948b16ce0f222e76b1b101a3e0f6c92e0c31b4fab6bfc7154192a28136f92031619854c877af85ba5bd99fbee568e6574cafa8feeef9b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf721720055000b1e3297e69f162877b577b0d6a47a0d63b2392bc8499e6540da4187a63e28f800000000000141bc0000000000000003fffffffb000000006ae4e93b000000006ae4e93a00000000000141c400000000000000030c62a937aba308f8bd0741c5edcdb0328c287e80ccbcbe697bb2566e198034b79dd2d2fb434cfab75a478ac5115588bc77c422b40c7909140a345726df9f53ea9360adce68518169839cfa7f262c62fba5425822bb0d4dedbc148b3709ce283cfccd321bdfe67df69b00b2f89a236b59ca0c60bb7571648ee993a207e317d6508ae45f0694355537d493ee633232b1da8b58b4dcb633fa4fdcb3bdbf45327816002a10bf4c641f811454266e86baf6a530975d0831455c846b13ed3821b1c65c1a9cab11bd4fb26836b952e857d5b3d27e3c931197a6461a16ffbcac84731140c2eb617b22210af60763a3bc2eccf72172";
/// pt=1793386919 block=324428839 tx=0x87ee6102f7c650186e23fa80d25b0aca9b8794b6129478226d38060b39762edc - epoch 498163 victim-settle mark (108s after B's open)
bytes internal constant T3_SETTLE_163 = hex"504e4155010000000124010000000103018084b2f542ce6090526b4b7da5d5f60c1053b7986d1c0db4caec6f7a1a7bcdee61325a03b188cfdc76a28ec2c820fd6f7245d2cf

The original report as published on Immunefi, by pizzalover337. 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 positive VPI charge is credited to pool equity on open without any escrow or reserve for the trader's right to reclaim it on close, unlike the negative side which uses vpiRebateReserve.

Impact

The redeeming cohort could exit with more than its fair share while the remaining junior LPs absorb the shortfall, netting the attacker a small profit per cycle; the pool as a whole stays solvent within a cycle and the loss compounds toward junior insolvency.

What the attacker needed

Attacker controls both trader and LP; capital to park as junior LP; redemption timed inside VPI window; no privileged role needed

The fix

Positive VPI charges should be booked into a reserve (or pending revenue) until the skew-reducing leg settles, and LP deposits and redemptions inside a live window should be priced off reserve-adjusted principal.

How it was found

  1. The attacker LP deposits junior capital and a sentinel LP deposits at the fair pre-window price.
  2. The trader opens a large long position, so the whole VPI charge lands as pool revenue with no reserve set aside.
  3. The attacker requests full redemption after the epoch cutoff so it matures a later epoch.
  4. The banking settle banks the VPI as junior revenue and prices zero redemptions.
  5. A later settle funds the attacker's redemption at the inflated principal, paying more than fair value.
  6. The trader closes the position, the rebate is paid from pool cash, and the next reconcile charges the shortfall to the remaining juniors.

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 a trader opens a position, the pool charges a fee called VPI and adds it to the pool's assets. But the trader can get that fee back when they close, so the money was never really the pool's to hand out. Because the pool treats it as profit straight away, someone who withdraws their share before the close takes money the pool still owes, and the LPs left behind 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 pizzalover337

View all

3 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.