Skip to content
Business logic Audit finding Advanced

Incomplete fix of Cecuro LOW-72: three sibling quotes still price a wiped tranche, and assignUnassignedAssets mints at that quote

The fix for an earlier audit item only added a wiped-tranche guard to one quote function, leaving three sibling quote functions reading zero pricing assets and returning wildly inflated share quotes. One of those quotes is used by the owner-only assignUnassignedAssets flow, so a mint into a wiped tranche is priced at that inflated quote, giving the receiver almost the entire surviving supply.

Lester Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#98911 [SC-Critical] Incomplete fix of Cecuro LOW-72: three sibling quotes still price a wiped tranche, and assignUnassignedAssets mints at that quote

Submitted on Nov 10th 2026 at 21:31:25 UTC by @Lester for Audit Competition | Plether

Description

Brief/Intro

Cecuro LOW-72 ("Pending depositor can receive impossible share quotes for a wiped tranche", marked "Addressed") was fixed in commit d757d0b1 by adding a wiped-tranche guard to one function, TrancheVault.estimateDepositShares:

Solidity
// TrancheVault.sol:1361-1370; lines 1364-1369 are the only change d757d0b1 makes to a quote function
// (in this and the next block, multi-line signatures are joined on one line)
function estimateDepositShares(uint256 assets) public view returns (uint256) {
    uint256 pricingAssets = _depositPricingAssets();
    uint256 pricingSupply = accruedTotalSupply();
    if (pricingAssets == 0 && pricingSupply != 0) {
        return 0;
    }
    return quoteDepositFromState(assets, pricingAssets, pricingSupply, 0);
}

Three sibling quotes of the same vault read the same pricing input and did not get the guard. After a terminal Junior wipe (Junior principal 0, share supply still outstanding) they keep quoting against zero pricing assets:

Solidity
// TrancheVault.sol:515-519
function convertToShares(uint256 assets) public view override returns (uint256) {
    return _convertToSharesUsingAssets(assets, _depositPricingAssets(), Math.Rounding.Floor);
}
// TrancheVault.sol:1372-1376
function estimateMintAssets(uint256 shares) external view returns (uint256) {
    return _previewMintAssets(shares);   // :1872 -> _convertToAssetsUsingAssets(shares, _depositPricingAssets(), Ceil)
}
// TrancheVault.sol:1392-1396
function quoteBootstrapDeposit(uint256 assets) external view returns (uint256) {
    return _convertToSharesUsingAssets(assets, _depositPricingAssets(), Math.Rounding.Floor);
}
// TrancheVault.sol:1848-1859, the shared helper pair (untouched by the fix)
function _depositPricingAssets() internal view returns (uint256 assets) {
    (uint256 seniorPrincipalAssets, uint256 juniorPrincipalAssets) = POOL.getPendingDepositTrancheState();
    return IS_SENIOR ? seniorPrincipalAssets : juniorPrincipalAssets;
}
function _convertToSharesUsingAssets(uint256 assets, uint256 totalAssets_, Math.Rounding rounding) internal view returns (uint256) {
    return Math.mulDiv(assets, accruedTotalSupply() + VIRTUAL_SHARES, totalAssets_ + 1, rounding);
}

With pricing assets 0 the denominator is 1, so the share quote is assets x (surviving supply + 1000), and the asset quote for the whole supply rounds to 1 atom.

The helper pair is the code LOW-72 itself pointed at. The audit item lists three locations: TrancheVault.sol:1298-1308, :1344-1348 and :1827-1838. In the file as it stood before the fix (parent of d757d0b1) these are maxRequestDeposit, estimateDepositShares, and exactly _depositPricingAssets (:1827-1830) plus _convertToSharesUsingAssets (:1832-1838). The fix guarded one caller and left the helper pair and its three other callers as they were. git blame at the frozen commit: only :1364-1369 come from d757d0b1 (2026-10-22); convertToShares was last changed on 2026-05-18, estimateMintAssets and quoteBootstrapDeposit on 2026-08-21.

Measured in the wiped state, before any owner action (PoC test 1; Junior share supply 200,317,299,120,011; quote size 10,000 USDG, the size used in LOW-72):

Quote Healthy Wiped, frozen code Wiped, same guard on the siblings
estimateDepositShares(10,000 USDG) (fixed by LOW-72) 10,016,241,826,614 0 0
convertToShares(10,000 USDG) 10,016,241,826,614 2,003,172,991,210,110,000,000,000 0
quoteBootstrapDeposit(10,000 USDG) 10,016,241,826,614 2,003,172,991,210,110,000,000,000 0
estimateMintAssets(whole Junior supply) 199,992,474,811 atoms (199,992.474811 USDG) 1 atom 0

In one state the vault's paired estimates disagree: the deposit estimate says "0 shares", while the mint estimate says the whole Junior supply costs 0.000001 USDG and the two share quotes are about 2 x 10^11 times the healthy quote. These are view calls; they need no role.

The program admits this kind of report: "For findings marked as fixed or Acknowledged in the reports above, a report on the same root cause is valid only if it shows that the fix at commit a82d4fefb02768e5b3bddcc97dee371eee24fea8 is incomplete or introduces a new bug." (program page, Known Issues and Previous Audits).

Not a documented exception. The interface comment of estimateMintAssets says it "does not enforce the deposit-request minimum or other admission/settlement gates" (IAsyncTrancheVault.sol:50-51). The comment of the fixed function names the wipe rule separately from those gates: "Returns zero when projected deposit-pricing assets are zero with surviving shares. The request minimum and other admission/settlement gates are not encoded" (IAsyncTrancheVault.sol:41-43). So in the project's own wording the wipe rule is not one of the gates the mint estimate leaves out, and no comment or document states what convertToShares, estimateMintAssets or quoteBootstrapDeposit return for a wiped tranche.

Vulnerability Details

One of the three quotes is executed on-chain. HousePool.assignUnassignedAssets prices its mint with quoteBootstrapDeposit (pinned commit a82d4fefb02768e5b3bddcc97dee371eee24fea8):

Solidity
// HousePool.sol:685-688 - the quote, then the only check on it
uint256 shares = ITrancheVaultBootstrap(targetVault).quoteBootstrapDeposit(amount);
if (shares == 0) {
    revert HousePool__BootstrapSharesZero();
}
// HousePool.sol:698-702 - principal is credited after the quote, then the quoted shares are minted
} else {
    juniorPrincipal += amount;
}
unassignedAssets = 0;
ITrancheVaultBootstrap(targetVault).bootstrapMint(shares, receiver);
  • The quote reads Junior pricing assets before amount is credited (:685 runs before :699), so in the wiped state it is amount x (surviving supply + 1000).
  • The zero check at :686-688 is the place where a guarded quote would stop the call. With the unguarded quote it passes.
  • bootstrapMint (TrancheVault.sol:1549-1555) mints exactly the quoted number to the receiver.

How the state is reached (PoC test 2, release risk parameters, Senior cap 40M / 80 %). Junior holds 200,000 USDG from one LP plus the 1 USDG seed; Senior holds 800,000 plus its seed. A trader's gain larger than Junior NAV wipes Junior principal to 0 and is realized (the trader closes) before any owner action. The owner recapitalizes with 100,000 USDG through CfdEngine.recapitalizePool. Reconciliation restores Senior to its high-water mark (798,816.211738) and books the remainder, 47,261.138536 USDG, as unassignedAssets. While that bucket is nonzero, deposits are blocked ("unassignedAssets > 0 blocks new tranche-deposit requests and deposit activation", ACCOUNTING_SPEC.md:324). Assigning to Senior reverts HousePool__ExceedsSeniorDepositCapacity (measured), so the Junior target is the only call that clears the bucket.

Measured result of the assignment to Junior (amounts in USDG):

Before the assignment After the assignment After later Junior revenue
Receiver: shares 0 9,467,223,624,915,451,899,379,896 = quoteBootstrapDeposit(unassigned) exactly same
Receiver: share of Junior supply 0 99.9999999978840966 % same
Receiver: redeemable value 0 47,261.138536 (the assigned amount) 52,261.082700
Pre-wipe Junior holders: redeemable value 0 0 0.000001
Senior principal 798,816.211738 798,816.211738 798,424.095611
  • At the assignment no value moves between parties: the receiver's value equals the assigned amount, the pre-wipe Junior holders are at 0 before and after, Senior is unchanged.
  • The effect is on what comes later. The pre-wipe holders keep their shares, but those shares are now about 2.1 x 10^-11 of the supply. Later Junior revenue in the PoC (another trader's realized loss) raises Junior principal by 4,999.944165: the receiver's value grows by 4,999.944164 and the pre-wipe holders' by 0.000001.
  • With the same guard on the siblings, the same owner call reverts HousePool__BootstrapSharesZero while Junior pricing assets are 0 (PoC tests 2 and 3).

Impact Details

Impact (Low): "Contract fails to deliver promised returns, but doesn't lose value"

  • Doesn't lose value. No principal of any user is lost through this. The pre-wipe holders' value is 0 before any owner action (their loss came from the trader's gain) and 0 right after the assignment; the receiver holds exactly the assigned amount; Senior is unchanged.

  • Fails to deliver. (1) In the wiped state the vault returns share and asset quotes that no settlement performs, which is the defect LOW-72 described for "the vault's quote surface" and that the team answered by returning 0. Integrators reading convertToShares or estimateMintAssets still get them. (2) The owner's assignment is minted at such a quote, and afterwards the pre-wipe Junior shares take part in later Junior revenue at about 2.1 x 10^-11 of supply. The accounting spec says of zero-NAV Junior shares that they "participate in a later recovery like ordinary transferable Junior shares" (ACCOUNTING_SPEC.md:400-401; that sentence is written about maintenance-fee shares).

  • Why this is not filed higher. The guard alone does not decide who receives the later Junior revenue. The PoC runs two controls with the guard installed on the siblings:

    • Assignment after the later revenue: the pre-wipe holders end with 5,007.239290 and the receiver with 47,261.138535.
    • Assignment at the first positive Junior NAV (one trade's fees put 7.239290 USDG into Junior, so the guard condition pricingAssets == 0 is false): the receiver gets 99.9846847060703895 % of the supply and the pre-wipe holders end with 8.003938, against 0.000001 on the frozen code.

    So the part of the shift that the missing guard causes, measured against the earliest assignment the guarded code allows, is 8.003937 USDG in this scenario. In the second scenario of the PoC (test 3: the loss is unrealized at the assignment and the mark later returns to 1.00) it is 88.905185 USDG (pre-wipe holders 0.000006 on the frozen code, 88.905191 with the guard; receiver 300,230.655664 and 300,155.769621). The rest of the shift follows from when the owner assigns, which the guard does not control. We therefore map the finding to the Low row and leave the final mapping to triage.

  • Preconditions. For the quotes: a terminal Junior wipe (Junior principal 0 with surviving supply), which the protocol documents and handles as a state (ACCOUNTING_SPEC.md:326). For the assignment: in addition an owner recapitalization larger than the Senior gap, and the assignment made while Junior pricing assets are exactly 0. The price move in the PoC (1.00 to 0.35) is only the way the test reaches the wiped state; any loss larger than Junior NAV does.

Trusted role

The PoC contains owner calls, so this section states exactly what the owner does. It performs two actions, both listed for the role on the program page: "Owner of each perps contract (set by Plether at deployment): [...] Immediately, can pause and unpause, set the treasury, recapitalize the pool, clear degraded mode, seed the tranches and activate trading, admit or sweep unaccounted USDG, assign ownerless pool assets, and rescue tokens other than USDG." In the scenario the owner changes no parameter; the fixture only sets the release Senior cap during setup. The owner does not act "maliciously", is not "compromised", and does not act "outside its documented operational procedures" (the three cases the program page puts out of scope).

The project's documents describe both actions:

  • Recapitalization: "CfdEngine.recapitalizePool(amountAssets) is an immediate, owner-only, non-reentrant recovery action." (SECURITY.md:157); "4. Recapitalize or clear positions." (SECURITY.md:1509, terminal-deficit runbook); "Normal reconciliation allocates the queued amount to senior restoration or unassigned assets" (ACCOUNTING_SPEC.md:642).
  • Assignment: "assign unowned accounted assets through the guarded bootstrap path" (SECURITY.md:244-245, owner powers); "Explicitly bootstraps quarantined LP assets into a tranche by minting matching shares." (HousePool.sol:653); unassigned assets "Require explicit assignment; cannot silently become windfall LP ownership." (INTERNAL_ARCHITECTURE_MAP.md:75); the accounting spec names assignUnassignedAssets as one of the "bootstrap admin flows" (ACCOUNTING_SPEC.md:320).

The program rules for this case: "In scope: a legitimate, documented action by a trusted role that triggers a bug harming users or the protocol." (Trusted Roles and Non-Public Services) and "[...] where an in-scope impact arises from a logic error that a privileged address can trigger, which remains valid." (Attacks Involving Access to Privileged Addresses for Smart Contract Impacts).

Two objections, answered up front:

  • "The owner chooses the receiver." True, and this report does not depend on that choice. Whichever address is named receives amount x (surviving supply + 1000) shares. The report is about the quote the contract computes for the mint, not about whom the owner picks.
  • "No document has a numbered 'assign after a wipe' step." Also true: the assignment is documented as an owner power and as the required explicit path for unassigned value, not as a runbook step for this state. The first part of the report needs no owner at all: the three quotes return the values in the first table to any caller as soon as the tranche is wiped (PoC test 1 makes no owner call after the fixture setup). The assignment only shows where one of those quotes is executed.

Relation to audit items

  • LOW-72 (Cecuro, "Addressed"). Same root cause: wiped-tranche pricing on the vault's quote surface. This report shows the fix at the frozen commit is incomplete: one of four quotes is guarded, and the helper pair named in the item's own locations is unchanged. LOW-72 names neither the three sibling functions nor the assignment.
  • LOW-22 (Cecuro, "Addressed"). A different claim. LOW-22 is about the missing non-dilutive recapitalization entry point and was fixed by adding CfdEngine.recapitalizePool, which the PoC uses as designed. It mentions "bootstrap assignment" only as an "economically different" alternative. We do not dispute LOW-22; it does not say what the vault quotes for a wiped tranche.

Recommended fix

Apply the LOW-72 guard to the three siblings, or once where they share it (the deposit-side pricing built from _depositPricingAssets()):

Solidity
if (_depositPricingAssets() == 0 && accruedTotalSupply() != 0) {
    return 0;
}

The PoC control installs exactly this in convertToShares, estimateMintAssets and quoteBootstrapDeposit (one added statement in each of the three functions; the change is listed in the PoC section). With it, all four quotes return 0 in the wiped state, and assignUnassignedAssets into a wiped tranche reverts at the existing zero check (HousePool.sol:686-688) until Junior pricing assets are positive. If the team wants the assignment to stay available in the wiped state, it needs its own stated price rule for that case; that is a design decision for the team.

References

  • packages/perps/src/TrancheVault.sol#L515-L519, #L1361-L1376, #L1392-L1396, #L1549-L1555, #L1848-L1873
  • packages/perps/src/HousePool.sol#L653-L704 (assignUnassignedAssets), #L1330-L1338 (getPendingDepositTrancheState)
  • packages/perps/src/interfaces/IAsyncTrancheVault.sol#L39-L54
  • Fix commit d757d0b175b5c2154babee946362ff90bd585f22 ("fix(perps): resolve LP vault, tranche, and claim findings (#123)", 2026-10-22); Cecuro's fix link for LOW-72: plether-core 899675594d1e043383e10252a8985bac2e5b6271
  • Cecuro AI audit report (audits/plether-ai-audit-report-2026-10-26.pdf): items LOW-72 and LOW-22
  • packages/perps/ACCOUNTING_SPEC.md l.320, l.324, l.326, l.400-401, l.642; packages/perps/SECURITY.md l.157, l.244-245, l.1509; packages/perps/INTERNAL_ARCHITECTURE_MAP.md l.75

Proof of Concept

Proof of Concept

One runnable Foundry test file in the repository's own perps test suite, at the frozen commit a82d4fefb02768e5b3bddcc97dee371eee24fea8. It is a local test; no fork, RPC or env var is used.

  • Fixture: the repository's BasePerpTest. The only mocks are MockPyth and the USDG mock, both outside the scope (the program page allows mocks for "components outside the scope, such as Pyth price updates and USDG").
  • Parameters: release values (MM 10 bps, IM 20 bps, frozen-market margin 300 bps, Senior cap 40M USDG and 80 % of the pool).
  • In-scope contracts are not modified in any branch that shows the reported behaviour (test 1 up to its control line, and the "FROZEN CODE" branches of tests 2 and 3). These branches run first, before any cheatcode touches a protocol contract.
  • Control: LOW72GuardedTrancheVault.sol is a copy of src/TrancheVault.sol with the LOW-72 guard added to convertToShares, estimateMintAssets and quoteBootstrapDeposit. The control branches install its code at the Junior vault address with vm.etch (storage and immutables unchanged). It is used only to show what the same steps do with the guard in place.
  • No vm.store. No protocol address is impersonated.

Setup and command

Bash
git clone --recurse-submodules https://github.com/immunefi-team/audit-comp-plether.git
cd audit-comp-plether
git checkout --detach a82d4fefb02768e5b3bddcc97dee371eee24fea8
git submodule update --init --recursive

# 1. Save the test code at the end of this section as packages/perps/test/LOW72SiblingQuotes.t.sol

# 2. Create the control copy of the vault (the guard on the three siblings). Four lines change; nothing else.
G='if (_depositPricingAssets() == 0 \&\& accruedTotalSupply() != 0) return 0; '
sed -e 's|^pragma solidity 0.8.35;|& // TEST-ONLY copy of src/TrancheVault.sol: the wiped-tranche guard of estimateDepositShares added to three more quotes|' \
    -e 's/^contract TrancheVault is/contract LOW72GuardedTrancheVault is/' \
    -e "s/return _convertToSharesUsingAssets(assets, _depositPricingAssets(), Math.Rounding.Floor);/${G}&/" \
    -e "s/return _previewMintAssets(shares);/${G}&/" \
    packages/perps/src/TrancheVault.sol > packages/perps/test/LOW72GuardedTrancheVault.sol
git diff --no-index --stat packages/perps/src/TrancheVault.sol packages/perps/test/LOW72GuardedTrancheVault.sol   # 5 insertions, 5 deletions

# 3. Run
FOUNDRY_SPARSE_MODE=true forge test --root packages/perps --match-path test/LOW72SiblingQuotes.t.sol -vv   # Foundry 1.5.1

Expected result: 3 passed; 0 failed. FOUNDRY_SPARSE_MODE=true compiles only this test and its dependencies (195 files, about one minute); without it forge first builds the whole via-IR suite. The compiler prints warnings for lib/forge-std, OpenZeppelin ERC4626.sol and src/CfdEngine.sol; none is in the two PoC files.

The control copy differs from src/TrancheVault.sol in these lines only (the git diff --no-index in step 2 shows the same):

Diff
-pragma solidity 0.8.35;
+pragma solidity 0.8.35; // TEST-ONLY copy of src/TrancheVault.sol: the wiped-tranche guard of estimateDepositShares added to three more quotes
-contract TrancheVault is ERC4626, IAsyncTrancheVaultClaimableRedeem {
+contract LOW72GuardedTrancheVault is ERC4626, IAsyncTrancheVaultClaimableRedeem {
 // convertToShares (:518) and quoteBootstrapDeposit (:1395)
-        return _convertToSharesUsingAssets(assets, _depositPricingAssets(), Math.Rounding.Floor);
+        if (_depositPricingAssets() == 0 && accruedTotalSupply() != 0) return 0; return _convertToSharesUsingAssets(assets, _depositPricingAssets(), Math.Rounding.Floor);
 // estimateMintAssets (:1375)
-        return _previewMintAssets(shares);
+        if (_depositPricingAssets() == 0 && accruedTotalSupply() != 0) return 0; return _previewMintAssets(shares);

Steps (amounts in USDG; the log prints 6-decimal atoms)

Shared start. Junior: one LP deposits 200,000, plus the 1 USDG seed. Senior: one LP deposits 800,000, plus the 1 USDG seed. Healthy quotes for 10,000 USDG: 10,016,241,826,614 shares from all three share quotes; estimateMintAssets(whole supply) = 199,992,474,811 atoms. TRADER_A opens LONG 3,900 lots at 1.00; the basket moves 1.00 to 0.35; settlement reconciles. Junior principal is 0, the Junior share supply (200,317,299,120,011) survives, and maxRequestDeposit is 0.

Test 1, test_1_QuoteTable_WipedJunior_NoOwnerAction. No owner call after the fixture setup; the quote functions are views that any caller can read.

  • Unmodified contracts: estimateDepositShares(10,000) = 0; convertToShares(10,000) = quoteBootstrapDeposit(10,000) = 2,003,172,991,210,110,000,000,000 = 10,000e6 x (supply + 1000) (asserted); estimateMintAssets(whole supply) = 1 atom.
  • Control (guard on the siblings): all four return 0.

Test 2, test_2_AssignmentMintsAtTheUnguardedQuote_RealizedLoss.

  1. TRADER_A closes at 0.35, so the Junior loss is realized before any owner action. Pre-wipe Junior holders: 0.
  2. The owner recapitalizes with 100,000 (CfdEngine.recapitalizePool). After reconciliation Senior is back at its high-water mark, 798,816.211738, and 47,261.138536 is unassigned. The wiped-state quotes are the same as in test 1.
  3. FROZEN CODE (unmodified contracts). The owner calls assignUnassignedAssets(true, receiver): reverts HousePool__ExceedsSeniorDepositCapacity. The owner calls assignUnassignedAssets(false, receiver): the receiver gets 9,467,223,624,915,451,899,379,896 shares, equal to quoteBootstrapDeposit(unassigned) read just before the call and to unassigned x (supply + 1000) (both asserted), which is 99.9999999978840966 % of the Junior supply. Receiver's value 47,261.138536; pre-wipe holders 0; Senior 798,816.211738.
  4. Later Junior revenue: TRADER_B opens LONG 1,000 lots at 0.35, the basket moves to 0.40, TRADER_B closes. Junior principal grows by 4,999.944165; the receiver's value grows by 4,999.944164 to 52,261.082700; the pre-wipe holders' value grows by 0.000001.
  5. GUARD-LATE (control, from the snapshot of step 2). All four quotes are 0; the Junior assignment reverts HousePool__BootstrapSharesZero. After the same TRADER_B round trip the pre-wipe holders hold 5,007.239290. The owner then assigns: receiver 47,261.138535, pre-wipe holders still 5,007.239290.
  6. GUARD-EARLY (control, from the snapshot of step 2). The Junior assignment reverts; TRADER_B opens and its fees put 7.239290 into Junior pricing assets; the owner assigns now: the receiver gets 99.9846847060703895 % of the supply. After TRADER_B closes: pre-wipe holders 8.003938, receiver 52,253.082815. Difference for the pre-wipe holders between GUARD-EARLY and FROZEN CODE: 8.003937.

Test 3, test_3_Sensitivity_UnrealizedLossThenMarkReversal. TRADER_A stays open. The owner recapitalizes with 100,000 (47,273.241241 unassigned).

  • FROZEN CODE: the owner assigns to Junior; the basket returns to 1.00 and TRADER_A closes. Receiver 300,230.655664; pre-wipe holders 0.000006.
  • GUARD-EARLY (control): the assignment reverts; a fee-only TRADER_B round trip puts 14.002184 into Junior pricing assets; the owner assigns; same reversal. Receiver 300,155.769621; pre-wipe holders 88.905191. Difference for the pre-wipe holders: 88.905185.

Every privileged or impersonated call, and the on-chain role it stands for

  • The test contract (address(this)) is the owner of every perps contract: BasePerpTest deploys them, and they are Ownable to the deployer. Owner calls need no prank:
    • in the fixture setup: pool.initializeSeedPosition (Junior and Senior seed, 1 USDG each, held by the test contract), pool.activateTrading, and pool.proposePoolConfig + pool.finalizePoolConfig after the 72-hour delay, which set the release Senior cap (40M USDG, 80 %);
    • engine.recapitalizePool(100,000e6): the owner's "recapitalize the pool";
    • pool.assignUnassignedAssets(true | false, RECEIVER): the owner's "assign ownerless pool assets".
  • vm.prank(KEEPER) (0x0E0E1) = any caller acting as keeper, which the program page defines as untrusted: router.updateMarkPrice, router.settleLpEpoch, pool.settleLpEpoch(0, 0), router.executeOrder.
  • vm.prank(TRADER_A / TRADER_B) = ordinary traders: router.commitOrder; in the fixture's _fundTrader, approve and clearinghouse.deposit from their own wallets.
  • vm.prank / vm.startPrank(JUNIOR_LP / SENIOR_LP) = ordinary LPs acting on their own positions: approve, requestDeposit, claimDeposit, requestRedeem. The Senior LP's small redemption requests (1/2000 of its shares) are only a permissionless way to make settlement reconcile; they run on the same schedule in every branch.
  • RECEIVER (0xB007) = the account the owner names. It makes no call.
  • No protocol address (pool, engine, vault, router) is impersonated. vm.store is not used.
  • Test scaffolding: settlementToken.mint (USDG mock) funds the accounts and the owner; MockPyth supplies prices; vm.warp / vm.roll move time; vm.snapshotState / vm.revertToState start the branches of one test from the same state.
  • vm.etch(juniorVault, LOW72GuardedTrancheVault code): control branches only, after the FROZEN CODE branch of the same test has finished.

Output of the run

Ran 3 tests for test/LOW72SiblingQuotes.t.sol:LOW72SiblingQuotesTest
[PASS] test_1_QuoteTable_WipedJunior_NoOwnerAction() (gas: 10526956)
Logs:
  STEP 0 healthy
    [0 healthy] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 199992474809 199991476431 998378
    [0 healthy] RECEIVER value / RECEIVER shares 0 0
    [0 healthy] Senior principal / Senior high-water mark / Junior principal 800001001588 800001001588 200000998412
    [0 healthy] unassigned assets / Junior share supply 0 200317299120011
    [0 healthy] estimateDepositShares(10,000 USDG)  [guarded by the LOW-72 fix] 10016241826614
    [0 healthy] convertToShares(10,000 USDG) 10016241826614
    [0 healthy] quoteBootstrapDeposit(10,000 USDG) 10016241826614
    [0 healthy] estimateMintAssets(whole Junior supply) (USDG atoms) 199992474811
  STEP 1 TRADER_A opens LONG 3,900 lots at 1.00 (keeper executes); basket 1.00 -> 0.35; reconcile
    [1 after loss] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 0 0 0
    [1 after loss] RECEIVER value / RECEIVER shares 0 0
    [1 after loss] Senior principal / Senior high-water mark / Junior principal 746888867698 799615626457 0
    [1 after loss] unassigned assets / Junior share supply 0 200317299120011
  WIPED STATE, unmodified contracts, no owner action
    [1 wiped, frozen code] estimateDepositShares(10,000 USDG)  [guarded by the LOW-72 fix] 0
    [1 wiped, frozen code] convertToShares(10,000 USDG) 2003172991210110000000000
    [1 wiped, frozen code] quoteBootstrapDeposit(10,000 USDG) 2003172991210110000000000
    [1 wiped, frozen code] estimateMintAssets(whole Junior supply) (USDG atoms) 1
  CONTROL: the same guard on the three siblings
    [1 wiped, guard on siblings] estimateDepositShares(10,000 USDG)  [guarded by the LOW-72 fix] 0
    [1 wiped, guard on siblings] convertToShares(10,000 USDG) 0
    [1 wiped, guard on siblings] quoteBootstrapDeposit(10,000 USDG) 0
    [1 wiped, guard on siblings] estimateMintAssets(whole Junior supply) (USDG atoms) 0

[PASS] test_2_AssignmentMintsAtTheUnguardedQuote_RealizedLoss() (gas: 30014349)
Logs:
  STEP 0 healthy
    [0 healthy] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 199992474809 199991476431 998378
    [0 healthy] RECEIVER value / RECEIVER shares 0 0
    [0 healthy] Senior principal / Senior high-water mark / Junior principal 800001001588 800001001588 200000998412
    [0 healthy] unassigned assets / Junior share supply 0 200317299120011
    [0 healthy] estimateDepositShares(10,000 USDG)  [guarded by the LOW-72 fix] 10016241826614
    [0 healthy] convertToShares(10,000 USDG) 10016241826614
    [0 healthy] quoteBootstrapDeposit(10,000 USDG) 10016241826614
    [0 healthy] estimateMintAssets(whole Junior supply) (USDG atoms) 199992474811
  STEP 1 TRADER_A opens LONG 3,900 lots at 1.00 (keeper executes); basket 1.00 -> 0.35; reconcile
    [1 after loss] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 0 0 0
    [1 after loss] RECEIVER value / RECEIVER shares 0 0
    [1 after loss] Senior principal / Senior high-water mark / Junior principal 746888867698 799615626457 0
    [1 after loss] unassigned assets / Junior share supply 0 200317299120011
  STEP 2 TRADER_A closes at 0.35: the Junior loss is realized before any owner action
    [2 after TRADER_A close] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 0 0 0
    [2 after TRADER_A close] RECEIVER value / RECEIVER shares 0 0
    [2 after TRADER_A close] Senior principal / Senior high-water mark / Junior principal 746476957682 799215819146 0
    [2 after TRADER_A close] unassigned assets / Junior share supply 0 200317299120011
  STEP 3 owner recapitalizes 100,000 USDG (SECURITY.md:1509 step 4); reconcile
    [3 after recap] PRE-WIPE holders value (Junior LP + seed) / Junior LP / seed 0 0 0
    [3 after recap] RECEIVER value / RECEIVER shares 0 0
    [3 after recap] Senior principal / Senior high

The original report as published on Immunefi, by Lester. 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 wiped-tranche guard was added only to estimateDepositShares, leaving the shared pricing helpers and their other callers (convertToShares, estimateMintAssets, quoteBootstrapDeposit) unguarded against zero pricing assets with surviving supply.

Impact

No user principal is lost, but the vault returns quotes no settlement performs and the owner's assignment mints at that quote, so pre-wipe Junior holders later receive a negligible share of Junior revenue (about 8 USDG less in the measured scenario).

What the attacker needed

Terminal Junior wipe with surviving supply; owner recapitalization above Senior gap; assignment made while Junior pricing is 0

The fix

The guard should be applied to the three sibling quotes, or once in the shared deposit-side pricing, so all four quotes return zero in the wiped state and the assignment reverts at the existing zero check.

How it was found

  1. Set up Junior and Senior tranches with LP deposits and seeds, then have a trader open a large long position.
  2. Move the basket price down so the trader's gain exceeds Junior NAV, wiping Junior principal to zero while its share supply survives.
  3. Read the quote functions as any caller: the deposit estimate returns zero while the other three return inflated share quotes and a one-atom asset quote for the whole supply.
  4. Have the owner recapitalize the pool, leaving a nonzero unassigned assets bucket that blocks new deposits.
  5. Have the owner call assignUnassignedAssets targeting Junior, which mints shares at the unguarded quote and gives the receiver almost the entire supply.
  6. Observe that later Junior revenue accrues almost entirely to the receiver while pre-wipe holders gain a negligible amount.

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 vault prices shares by dividing the assets it holds by the shares outstanding. If a tranche loses all its money but its shares still exist, that division goes wrong and the vault can quote absurd numbers. The earlier fix only patched one of four functions that do this division, so the other three still return nonsense, and one of them is used when the owner moves leftover funds into the tranche.

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 Lester

View all

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