Skip to content
Business logic Audit finding Advanced

An extra permissionless settlement pass lets Senior exit with HousePool Junior principal

The two halves of the tranche waterfall (revenue restoration and loss absorption) are not inverses, so an unprivileged caller can run extra permissionless settlement passes over a price round trip to move value from the Junior tranche into Senior principal. The caller then redeems Senior shares at the inflated price, taking Junior's principal.

ChaseTheLight Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#99735 [SC-High] An extra permissionless settlement pass lets Senior exit with HousePool Junior principal

Submitted on Nov 15th 2026 at 02:07:08 UTC by @ChaseTheLight for Audit Competition | Plether

Description

Brief/Intro

HousePoolWaterfallAccountingLib applies the two halves of the tranche waterfall in orders that are not inverses of each other. distributeRevenue restores impaired Senior principal up to its high-water mark before Junior receives anything (:147-151, then :158). absorbLoss charges a shortfall to Junior first and reaches Senior only once Junior is zero (:172-183), and it never writes the high-water mark, which the function's own comment calls deliberate (:162-163). Each half on its own is the first-loss ordering the project documents. Their composition is not. Whenever seniorPrincipal < seniorHighWaterMark and juniorPrincipal > 0, reconciling once more over a closed round trip of the pool's distributable value is not the identity: the upward leg credits Senior and the downward leg debits Junior, so each extra observation moves min(senior deficit, junior principal, swing) across the tranche boundary. It moves back only if the pool later earns enough to fill the whole deficit, and value Senior has redeemed in the meantime does not come back. seniorPrincipal falls at exactly two sites in the whole package and neither of them pays Junior.

How many times the value is observed is the caller's choice. OrderRouter.settleLpEpoch(bytes[]) is external payable nonReentrant with no caller check, and its own comment reads "Permissionless and available while the router admin is paused" (OrderRouter.sol:475-484). It validates a caller-supplied PoolReconcile basket, installs that exact mark on the Engine, and invokes the pool's Router-only settlement callback in the same frame, so the pool's authorization branch is satisfied by construction (OrderLiquidationBatchLogic.sol:549-581 against HousePool.sol:810-815). An address with no role, holding Senior tranche shares it bought with an ordinary deposit request while the pool was healthy, takes one settlement pass at a displaced mark and a second after the mark returns to where it started. On the reproduction's arming the Junior tranche ends empty: juniorPrincipal ends at zero, seniorPrincipal ends higher by the same amount net of whatever the holder's own queued redemption realized along the way, on an arming whose tranche is around 30,000 USDG, and the pool's assets are reported at the end of both branches. The control, one pass over the same basket history from the same state, leaves the split essentially where the arming put it, moved only by the senior coupon and the redemption that pass funded. Both are valid executions of the same economic history and they disagree, and the caller of settlement decides which one the books record. This report files at High on "theft of unclaimed yield": a transfer of up to the whole Junior tranche into Senior principal, forced by an unprivileged caller and made final when Senior redeems at the raised price, with the Critical case set out under Impact Details.

The state this needs is seniorPrincipal < seniorHighWaterMark with juniorPrincipal > 0. Of the five sites in packages/perps/src that increase juniorPrincipal, four cannot leave the pool in that state. The fifth is the junior branch of assignUnassignedAssets, and it is a bare juniorPrincipal += amount with no gate of any kind (HousePool.sol:699), while the senior branch of the same call raises the high-water mark by the same amount as the principal (:695-696) and so cannot open a deficit. That call is one of the owner's documented immediate actions and the code compels it: unassignedAssets > 0 makes trancheDepositsAllowed return false (HousePoolTrancheGateLib.sol:28), so it is the only operation that clears the unassigned-assets block on tranche deposits, and the function's own comment calls the assignment the remedy that "Prevents later LPs from implicitly capturing previously ownerless value" (:657). Two legitimate, documented owner operations put the pool in the state; the subject of this report is what an unprivileged caller then takes out of it, and the owner is on the defending side throughout. The proof of concept runs locally and offline, in process in the repository's own Foundry suite inside a network namespace whose only interface is loopback, with no fork URL and nothing dialled, signed or sent anywhere (Proof of Concept).

Vulnerability Details

Root cause

A reconcile pass compares the pool's distributable value against total claimed principal and routes the difference through one of two rules. The comparison is in HousePoolWaterfallAccountingLib.planReconcile (:98-110), and the quantity it compares against is the pair the pass is about to rewrite:

Solidity
    function planReconcile(
        uint256 seniorPrincipal,
        uint256 juniorPrincipal,
        uint256 distributableAssets
    ) internal pure returns (ReconcilePlan memory plan) {
        uint256 claimedEquity = seniorPrincipal + juniorPrincipal;
        if (distributableAssets > claimedEquity) {
            plan.isRevenue = true;
            plan.deltaAssets = distributableAssets - claimedEquity;
        } else if (distributableAssets < claimedEquity) {
            plan.deltaAssets = claimedEquity - distributableAssets;
        }
    }

The two routing rules are the defect. Revenue fills the senior deficit first:

Solidity
    function distributeRevenue(
        WaterfallState memory state,
        uint256 revenueAssets
    ) internal pure returns (WaterfallState memory nextState) {
        nextState = state;
        uint256 remaining = revenueAssets;

        if (remaining > 0 && nextState.seniorPrincipal < nextState.seniorHighWaterMark) {
            uint256 deficit = nextState.seniorHighWaterMark - nextState.seniorPrincipal;
            uint256 restore = remaining < deficit ? remaining : deficit;
            nextState.seniorPrincipal += restore;
            remaining -= restore;
        }

        if (nextState.seniorPrincipal > nextState.seniorHighWaterMark) {
            nextState.seniorHighWaterMark = nextState.seniorPrincipal;
        }

        nextState.juniorPrincipal += remaining;
    }

A loss empties Junior first, and leaves the mark where it stands:

Solidity
    function absorbLoss(
        WaterfallState memory state,
        uint256 lossAssets
    ) internal pure returns (WaterfallState memory nextState) {
        nextState = state;
        if (lossAssets <= nextState.juniorPrincipal) {
            nextState.juniorPrincipal -= lossAssets;
            return nextState;
        }

        uint256 seniorLoss = lossAssets - nextState.juniorPrincipal;
        nextState.juniorPrincipal = 0;
        if (nextState.seniorPrincipal > seniorLoss) {
            nextState.seniorPrincipal -= seniorLoss;
        } else {
            nextState.seniorPrincipal = 0;
        }
    }

Each rule is correct for a senior tranche read on its own, and each one matches a numbered step in the project's own specification. What no rule, comment or specification line states is that the pair composes to the identity, and it does not. The upward leg routes the delta to Senior because a deficit stands; the downward leg routes the same delta out of Junior because Junior is non-empty. The anchor both legs measure against is seniorPrincipal + juniorPrincipal, which the previous leg just rewrote, so the split a pass produces becomes an input to the next pass's comparison. The result is a function of the sequence of observations rather than of the value observed.

Start from seniorPrincipal 50,000, seniorHighWaterMark 100,000, juniorPrincipal 30,000, with distributable value at 80,000 USDG, and take the pool's distributable value through 80,000 to 110,000 and back to 80,000.

Branch Pass Comparison Routed by End state
Control one pass at 80,000 80,000 against 50,000 + 30,000 neither rule, the delta is zero S = 50,000 / J = 30,000
Attack first pass at 110,000 110,000 against 50,000 + 30,000, revenue 30,000 distributeRevenue:147-151, deficit is 50,000, so the whole 30,000 restores Senior S = 80,000 / J = 30,000
Attack second pass at 80,000 80,000 against 80,000 + 30,000, loss 30,000 absorbLoss:172-173, the loss is at or below Junior, so Junior pays all of it S = 80,000 / J = 0

The pool holds the same 80,000 USDG at the end of both branches and seniorPrincipal + juniorPrincipal is the same in both. What differs is who owns it. Senior is 30,000 USDG richer and Junior is 30,000 USDG poorer, exactly, and 30,000 USDG is the entire Junior tranche. The closed form over one round trip is min(senior deficit, junior principal, swing), so no price peak is required: a dip and recovery of the same size produces the same transfer in the other order, which means the caller needs no price influence and no directional position of its own.

The transfer is written to pool storage. HousePool._reconcile (:1549-1599) builds the plan at :1568-1575 and writes it at :1584 with no condition on the write. The lines after it touch only unassignedAssets (:1585), and then, behind markFresh, terminalDeficitAssets, lastReconcileTime and the ownerless-junior-revenue adjustment (:1587-1596), which is zero while junior share supply is non-zero. :1598 applies pending claimant buckets, of which there are none on this path. Nothing between the plan and storage can undo the split.

When the loss becomes final

The state transition a recovery would need is a decrease of seniorPrincipal paired with an increase of juniorPrincipal. seniorPrincipal decreases at exactly two sites in packages/perps/src:

  • scaleSeniorOnWithdraw (:119-131), which funds a senior redemption and reduces the high-water mark with the principal, floor(HWM * fundedAssets / seniorPrincipal), so it pays the redeeming Senior holder rather than Junior and cannot widen the deficit; and
  • absorbLoss's senior branch (:180-182), which is reached only once juniorPrincipal is already zero.

Neither credits Junior. absorbLoss never writes seniorHighWaterMark, so later revenue fills the remaining senior deficit before Junior sees anything. Because the attack shrank that deficit by exactly the amount moved, a recovery that fills the whole deficit brings the two branches back together: with no Senior exit the reproduction measures the same Junior value in both, 56,098.64 USDG at the release risk parameters. Until that recovery arrives the moved principal is exposed, because Senior redemptions are priced on the raised seniorPrincipal (HousePool.sol:845-848) and pay it out of the pool. With the caller exiting 80% of its Senior position between the transfer and the same recovery, at the release risk parameters, its cash is 75,150.81 USDG against 51,153.73 in the control branch, and Junior's value after the recovery is 60,948.49 against 84,945.57. The caller's gain and Junior's shortfall are asserted equal, 23,997.08 USDG, and that amount does not return. The caller's total of 95,150.98 USDG is still below its 99,999 USDG deposit, because Senior was impaired before the attack: the gain is measured against not taking the extra pass. Recapitalization is explicitly excluded as a cure by its own documentation: HousePoolPendingPreviewLib.sol:103-107 states that it never accrues to junior principal. No owner action, vault callback or keeper action moves principal from Senior back to Junior; only revenue that fills the whole remaining senior deficit closes the gap, and it closes it fully only where no Senior holder has redeemed in between.

Trigger and preconditions

The entry point, and that it is permissionless. OrderRouter.settleLpEpoch(bytes[]) (:479-484) delegates to OrderLiquidationBatchLogic.settleLpEpoch (:549-581), which quotes the Pyth fee, obtains a price snapshot in PriceMode.PoolReconcile from the caller's own update data (:561-562), installs that snapshot's mark on the Engine (:563), and then calls HousePool.settleLpEpoch(markPrice, publishTime) with that exact mark and publish time (:566-578). The pool's authorization branch requires msg.sender == ENGINE.orderRouter(), ENGINE.lastMarkPrice() == expectedMarkPrice and lastMarkTime == expectedPublishTime (HousePool.sol:810-815), and the delegate frame supplies all three. So an unprivileged caller gets a mark-fresh reconcile pass while positions are open, which is what makes a real swing in distributable value available. The project documents this route itself, at SECURITY.md:1135-1136 and ACCOUNTING_SPEC.md:296-298.

The cost of a pass. _emitLpEpochSettled reverts HousePool__NoLpEpochProgress when no senior, junior or deposit epoch advanced (HousePool.sol:1183-1185), and that revert rolls back the whole pass, the write at :1584 included, so each harmful pass has to advance a real queue item. That raises the caller's outlay from nothing to dust and does not bound it, and neither harmful pass funds a senior redemption, which matters for the duplicate analysis below. Which queued item each pass advances, and the refund branch that lets the second pass clear the guard against an emptied tranche, are in the Proof of Concept.

The object attacked, and how the caller comes to hold a position in it. The object is the Junior tranche of the deployed HousePool, in the state the owner's own remedy leaves it: a tranche whose NAV has just been credited out of previously ownerless pool value while Senior still carries a deficit. The position the attack needs is Senior tranche shares, and the caller acquires them the ordinary way, with a permissionless TrancheVault.requestDeposit (:562 or :569) while the pool is healthy, activated by any settlement pass. That is the caller's own act: no role, no counterparty, no transfer of anybody else's shares, and the position can be held long before the state it exploits exists (Proof of Concept).

Reaching the state. juniorPrincipal increases at exactly five sites in packages/perps/src, and four of them cannot leave the pool with seniorPrincipal < seniorHighWaterMark and juniorPrincipal > 0:

Site Why it cannot arm the state
HousePool.sol:1090, deposit activation Deposit phases are gated at :908 on _entriesMaySettle (:1100-1118), which passes the then-current seniorPrincipal and seniorHighWaterMark (:1115-1116) to HousePoolTrancheGateLib.trancheDepositsAllowed, which returns false at :36-38 while Senior is impaired. The same predicate also runs at request admission, through TrancheVault._requireRequestDepositPreflight (TrancheVault.sol:1574-1601, called from _requestDeposit at :582), where maxRequestDeposit(controller) reads zero and the request reverts TrancheVault__DepositsUnavailable, or TrancheVault__TerminallyWiped first when the tranche has shares and no assets (:1585-1586). The gate runs at admission and again at settlement, so a request queued while healthy still cannot land while impaired
HousePoolWaterfallAccountingLib.sol:158, revenue Junior is reached only after the senior deficit is filled (:147-151), so any revenue pass that raises juniorPrincipal exits with seniorPrincipal == seniorHighWaterMark
HousePoolPendingPreviewLib.sol:181, the pending revenue bucket Same senior-gap-first ordering at :169-178, skipped only when senior share supply is zero, which the permanent senior seed share floor makes unreachable once seeded: the seed call configures it at HousePool.sol:760, TrancheVault.configureSeedPosition (TrancheVault.sol:1557-1572) writes seedShareFloor, and the transfer guard at TrancheVault.sol:322 refuses to let the seed receiver fall below it
HousePool.sol:756, the tranche seed onlyOwner, once per tranche, refused on a second call at :730, and performed at bootstrap before any impairment exists
HousePool.sol:699, the junior branch of assignUnassignedAssets No gate of any kind. The senior branch raises seniorHighWaterMark by the same amount as the principal (:695-696), so it cannot open a deficit, and it is capacity-checked besides (:677-679). The junior branch is a bare juniorPrincipal += amount. The specification states the asymmetry itself: assigning ownerless unassignedAssets to senior "does create new senior shares and goes through the same admission checks" (ACCOUNTING_SPEC.md:452-453), and it is silent on junior

A loss cannot produce the state either: absorbLoss zeroes Junior before touching Senior (:172-178), so at the moment Senior falls below its mark, Junior is already empty. A senior redemption cannot produce it, because scaleSeniorOnWithdraw removes mark and principal together (:127-130). An unsolicited donation cannot produce it, because accountExcess (HousePool.sol:568-579) raises accountedAssets only and the resulting surplus reconciles as revenue, which fills the senior deficit first.

So the state is reached through the junior branch of the assignment, and the two owner steps that lead there are both on the programme's list of documented immediate owner actions, "recapitalize the pool" and "assign ownerless pool assets". A recapitalization above the standing senior deficit restores the deficit and leaves the remainder quarantined in unassignedAssets (HousePoolPendingPreviewLib.sol:111-137, the gap fill at :124-131 and the remainder at :134-136), which is the allocation the specification itself names: "Normal reconciliation allocates the queued amount to senior restoration or unassigned assets" (ACCOUNTING_SPEC.md:642). Ordinary trader profit then wipes Junior and impairs Senior again, at which point the quarantine blocks every tranche deposit and the assignment is the only operation that clears that block, which is why the second step is not discretionary (Brief). The senior branch of the assignment is not available in that state: with Junior principal at zero the release share limit leaves no senior capacity and the call reverts HousePool__ExceedsSeniorDepositCapacity (HousePool.sol:677-679, :1515), which the reproduction asserts, so crediting Junior is the only assignment the code accepts. The assignment leaves the senior deficit standing, so deposits remain refused on the independent impairment clause at HousePoolTrancheGateLib.sol:36-38 afterwards; what the assignment changes is who owns the quarantined value. The full sequence, with the production validator that accepts each step, is in the Proof of Concept section.

The mechanism's own firing predicate reads no configuration value, and the reproduction runs at the release risk parameters. The mark must be fresh for the pass, which the caller's own Pyth update supplies. maxSeniorShareBps is 8_000 at release (DEPLOYMENT.md:155), which is what sets the junior realization throttle discussed under the loss mechanism, and the code refuses to activate trading at the constructor's 10_000 placeholder: HousePool.sol:536 reverts HousePool__SeniorCapacityNotConfigured while maxSeniorShareBps >= 10_000. seniorRateBps is 800 at release (HousePool.sol:251, ACCOUNTING_SPEC.md:352), and the reproduction also drives the sequence with it at zero. One end-to-end contract holds all five release risk parameters, read back from the engine: vpiFactor 0.01e18, maxSkewRatio 0.4e18, maintMarginBps 10, initMarginBps 20 and baseCarryBps 500 (DEPLOYMENT.md:131-137). It opens a 59,200-unit short at a basket level of 0.85, a notional of 50,320 USDG against a 50,400 USDG skew limit on 126,001 USDG of depth, and the armed 30,000 USDG Junior tranche ends empty as it does elsewhere. The other two end-to-end contracts open a larger position with maxSkewRatio at 1e18, carry off and the harness's price impact and margin values; the project's own test/perps/accounting/waterfall/TrancheRecoveryBehavior.t.sol:98-99 and test/perps/shared/SourceBoundBountyFixture.sol:25-27 carry the same price impact and skew values. No liquidation path runs in any branch: the short is in profit for the whole sequence.

Recommended fix

The invariant to restore is that two sequences of observations ending at the same distributable value must produce the same split. The structural fix is to stop feeding the reconcile's output back into its own comparison. Keep a senior and a junior principal basis, written only by capital events (deposits, redemptions, assignments, seeds, coupon, recapitalization), and derive the split on each mark-fresh pass as a pure function of the distributable value and those bases rather than by routing a delta against the pair the previous pass wrote:

Text
claimed = seniorBasis + juniorBasis
if distributable >= claimed:
    surplus        = distributable - claimed
    seniorRestore  = min(surplus, seniorHighWaterMark - seniorBasis)
    seniorPrincipal = seniorBasis + seniorRestore
    juniorPrincipal = juniorBasis + (surplus - seniorRestore)
else:
    shortfall       = claimed - distributable
    juniorPrincipal = juniorBasis - min(shortfall, juniorBasis)
    seniorPrincipal = seniorBasis - (shortfall - min(shortfall, juniorBasis))

Both declared rules survive unchanged: a shortfall is still charged to Junior first and then Senior, surplus still restores Senior to its high-water mark before reaching Junior, and losses still do not reduce the mark. What goes away is the dependence on how many times the comparison ran, because seniorBasis and juniorBasis do not move when the split does. On every case in this report the fix makes both branches agree, which is the point: the control's answer is the one the specification's own step 2 prescribes, a comparison of terminal equity against total principal.

If a basis pair is too large a change for a patch release, a narrower change closes the peak path only. It is one additional field on WaterfallState, persisted in one new HousePool storage slot, recording senior principal restored out of revenue, incremented by restore at distributeRevenue:150 and consumed by absorbLoss before it reaches Junior:

Solidity
        uint256 unwind =
            lossAssets < nextState.seniorRevenueRestored ? lossAssets : nextState.seniorRevenueRestored;
        if (unwind > 0) {
            nextState.seniorPrincipal -= unwind;
            nextState.seniorRevenueRestored -= unwind;
            lossAssets -= unwind;
            if (lossAssets == 0) {
                return nextState;
            }
        }

A loss then unwinds the restoration it is reversing before it charges the tranche that never received it, and a funded senior redemption reduces the field alongside the principal it pays out, rounded in the protocol's favour. With no restoration outstanding the field is zero and the junior-first waterfall is untouched, so an ordinary first loss behaves exactly as it does today. It does not close the trough path: a dip charges Junior while no restoration is outstanding, and the recovery then restores Senior. The principal basis is the complete fix.

Either way, the regression test that detects this class is a property test over observation sequences: for any list of distributable values ending at D, assert that the resulting (seniorPrincipal, juniorPrincipal) equals the result of a single pass at D from the same starting state. The repository's existing waterfall property file is the natural home for it; it currently asserts nothing about observation count.

Impact Details

The in-scope impact this maps to

The governing rung, quoted byte for byte from the programme's Impacts in Scope list:

Text
High: temporary freezing of funds ≥24h; theft of unclaimed yield; permanent freezing of unclaimed yield.

This report files at High, on "theft of unclaimed yield". The Junior principal the caller takes reached the Junior tranche as previously ownerless pool value, quarantined in unassignedAssets and then vested in the Junior share holders by the owner's assignment. On the conservative reading, that is unclaimed yield. Senior holders receive it pro rata, so the caller's share is its share of the Senior tranche.

The rung above is quoted here with equal care, because the report does not want the reviewer to have to guess which case it is making:

Text
Critical: direct theft of any user funds (at-rest or in-motion) other than unclaimed yield; permanent
freezing of funds; protocol insolvency.

The Critical case is real and worth stating. At the moment the attack fires, the Junior share holders hold minted TrancheVault shares and juniorPrincipal is, in the project's own words, "the current NAV attributed to the two tranches, not immutable records of historical deposits" (ACCOUNTING_SPEC.md:331-332). The assignment exists precisely to vest that NAV in them, which the function's comment states as its purpose (HousePool.sol:657). On that reading what the caller removes is user funds at rest and the entry is Critical.

The report lands at High on one condition and one only: that the carve-out in the Critical entry, "other than unclaimed yield", covers value whose origin is ownerless pool assets even after the owner's assignment has vested it in named share holders. If a reviewer reads that carve-out as not reaching vested tranche NAV, then on the same evidence the entry is "direct theft of any user funds (at-rest or in-motion)" and the rung is Critical. Nothing else about the report changes between the two readings, and the programme's own separation of impact from feasibility, quoted below, means the arming chain does not bear on the choice.

Loss mechanism and its bound

Conservation, stated explicitly. In: nothing. Claimed equity is the same at the end of both branches once each branch's own payouts are added back, which is the asserted form: seniorPrincipal + juniorPrincipal + the junior redemption that branch's passes funded is equal across the two branches, from one snapshot over the same basket history. Each branch can pay a queued redemption out through its own passes, which is why those payouts are in the equation rather than outside it. Pool assets are reported alongside it rather than asserted equal. Out: nothing on the round trip beyond those funded redemptions, which the pool pays into the tranche vault as escrow the holder can then claim (HousePool.sol:1007-1008, TrancheVault.sol:1211). Who is short, and by how much: the Junior share holders, by min(outstanding senior deficit, Junior principal, cumulative swing), which on the reproduction's arming is the armed Junior tranche of around 30,000 USDG net of the dust redemption the holder's own queue work realized, because the arming asserts the senior deficit exceeds the tranche. The tranche itself is asserted to end empty, so what is left for the holder to redeem prices to nothing. Senior redemption carries no corresponding ratio cap and is priced against seniorPrincipal directly (HousePool.sol:845-848), so the caller's own matured senior redeem request pays out strictly more in the attack branch than in the control branch from the same shares, asserted as settlement token received in both. That is where the transferred principal leaves the protocol.

The entitlement that is violated is the project's own. seniorHighWaterMark "records the Senior entitlement that future revenue must restore after a loss" (ACCOUNTING_SPEC.md:332-333). There was no net revenue over the round trip. The caller's first pass restores Senior out of a revenue leg and the second pass charges the reversal of that same leg to Junior, so the restoration is funded by Junior principal rather than by revenue, and the mark stays where the restoration left it.

The harm is realized at the redemption window, not only in an internal ledger. juniorPhase.pricingPrincipal = juniorPrincipal (HousePool.sol:840) and that value is consumed by the redemption-share pricing at :957-959 and :992-999, so a Junior holder's matured redeem request is priced against the reduced principal. In the attack branch juniorPrincipal is zero, so the holder's shares price to zero and the matured request is refunded with nothing (:957-987). In the control branch, over the identical price history from the same snapshot, the holder's remaining position funds. Each branch exits whatever Junior position it still holds, and the reproduction prints both share counts rather than asserting them equal; what the comparison turns on is that one of the two prices to nothing.

The victims cannot step aside, and the reason is a release parameter. Junior realization per pass is capped by _juniorSettlementCapacity (HousePool.sol:1205-1217), which takes min(freeAssets, min(juniorPrincipal, juniorWithdrawalRatioCap)), and HousePoolSeniorCapacityLib.juniorWithdrawalRatioCap (:64-90) leaves juniorPrincipal - ceil(exposure * (BPS - maxSeniorShareBps) / maxSeniorShareBps), where exposure is max(seniorPrincipal, seniorHighWaterMark) (:17-22). With exposure at the 100,000 the release seed and the caller's deposit supply, juniorPrincipal at 30,000 and the release maxSeniorShareBps of 8_000, the covenant reserves 25,000 USDG and leaves a withdrawal capacity of 5,000; the coupon raises the mark the cap reads above that nominal figure while Senior is unimpaired (`HousePool

The original report as published on Immunefi, by ChaseTheLight. 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 reconcile pass routes a delta against the principal pair that the previous pass itself rewrote, so the split depends on how many times the value was observed rather than on the value itself.

Impact

Up to the whole Junior tranche can be moved into Senior principal and cashed out by an unprivileged caller, and the loss is final unless revenue later fills the entire remaining senior deficit with no Senior redemption in between.

What the attacker needed

Senior shares bought via normal deposit; pool has senior deficit and junior principal; caller supplies fresh price data; each pass must advance a queue item

The fix

The report recommends deriving the split on each pass from separate principal bases written only by capital events, so repeated observations of the same value give the same result; a narrower patch that unwinds revenue restoration on loss closes only the peak path.

How it was found

  1. Obtain Senior tranche shares through an ordinary permissionless deposit request while the pool is healthy.
  2. Wait until the pool is in the state where Senior principal is below its high-water mark and Junior principal is above zero.
  3. Call the permissionless settlement entry point with caller-supplied price update data to install a displaced mark and run a reconcile pass.
  4. Call it again once the mark returns to its starting value, so the loss is charged to Junior.
  5. Redeem the Senior shares at the raised principal before any recovery fills the deficit.

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 splits money between two groups: Senior, who are promised to be made whole first, and Junior, who absorb losses first. Normally money coming in tops up Senior before Junior, and money going out is taken from Junior first. The report shows that if someone triggers the accounting twice, once when the pool looks richer and once when it looks poorer again, the two rules do not cancel out: Senior ends up owning money that belonged to Junior. The person who triggered it can then withdraw their Senior share at the higher value.

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 ChaseTheLight

View all

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