Skip to content
Business logic Audit finding Advanced

Anyone holding one share atom can plant a zero-value redeem request at another LP's redeem head, so standard redeem/withdraw revert on that LP's funded redemptions

The vault's requestRedeem accepts any controller and exempts full-balance requests from the minimum size, so an attacker holding a single share atom can plant a zero-value redeem request at a victim LP's redeem head. Standard redeem, withdraw, maxRedeem and maxWithdraw then revert or show nothing for the victim's later funded redemptions until the victim clears the planted head.

Naveen0x Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#99225 [SC-Low] Anyone holding one share atom can plant a zero-value redeem request at another LP's redeem head, so standard redeem/withdraw revert on that LP's funded redemptions

Submitted on Nov 12th 2026 at 13:21:55 UTC by @Naveen0x for Audit Competition | Plether

Description

Summary

TrancheVault.requestRedeem(shares, controller, owner) checks the share owner but accepts any controller, and a request for the owner's entire balance skips the 1 USDG minimum. So anyone with one share atom can send it to a fresh address and call requestRedeem(1, victim, fresh). That 1-share position becomes the victim's controllerRedeemHead. At settlement it is refunded as zero-value, or funded at 0 assets if an honest redeemer shares the window. Junior and Senior vaults share this code.

The standard claim functions and views (redeem, withdraw, maxRedeem, maxWithdraw) only look at the head. Until the victim clears it, maxRedeem and maxWithdraw show none of the victim's later funded redemptions, and redeem and withdraw revert. CANONICAL_ENTRYPOINTS.md names exactly this path for LP exits: funded requests are "claimed through ERC-4626 redeem or withdraw".

The attack costs 1 share atom (worth 0 USDG) plus gas, needs nothing from the victim, and can be repeated. No value is lost: the funds stay in escrow and the explicit-id claimRedeem(requestId, ...) still pays them in full.

Affected code

Line numbers are for packages/perps/src at commit a82d4fe.

  • TrancheVault.sol#L606-L632: requestRedeem, no controller check
  • TrancheVault.sol#L1611-L1618: _requireMinimumRedeemSize, full-balance exemption
  • TrancheVault.sol#L1783-L1797: _appendControllerRedeem, first entry becomes the head
  • TrancheVault.sol#L998-L1012 and #L1299-L1311: withdraw/redeem and maxWithdraw/maxRedeem act on the head only
  • TrancheVault.sol#L916-L947: claimRedeemRefund, controller-only, restarts the receiver's cooldown
  • HousePool.sol#L960-L986: zero-value epoch refund

Root cause

1. Any controller is accepted, and a full-balance request skips the minimum. requestRedeem checks the owner's balance, cooldown and allowance, never the controller:

Solidity
uint256 maxShares = maxRequestRedeem(owner);
...
_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); // controller is never checked

The minimum only applies below the whole balance:

Solidity
if (estimateRedeemAssets(shares) < POOL.minTrancheDepositAssets() && shares < maxShares) {
    revert TrancheVault__WithdrawalTooSmall();
}

An address holding exactly 1 share atom has shares == maxShares == 1, so the request goes through for whatever controller it names.

2. The first entry on an empty list becomes the head (TrancheVault.sol#L1789-L1791):

Solidity
uint256 tail = controllerRedeemTail[controller];
if (tail == 0) {
    controllerRedeemHead[controller] = requestId;

3. Standard claims and views only read the head (#L1003, #L1011, #L1302, #L1309):

Solidity
return _claimWithdraw(controllerRedeemHead[controller], assets, receiver, controller);
return _claimRedeem(controllerRedeemHead[controller], shares, receiver, controller);
uint256 requestId = controllerRedeemHead[controller]; // maxWithdraw / maxRedeem

4. The planted head has nothing claimable. If its hourly epoch holds only zero-value requests, HousePool takes the fullHeadAssets == 0 branch and refunds it, so fundedShares stays 0 and both claimableRedeemRequest and claimableRedeemAssets return 0. If an honest redeemer shares the window, the epoch is funded but the plant's assets floor to mulDiv(1, fundedAssets, shares) == 0. Either way _claimWithdraw reverts with ERC4626ExceededMaxWithdraw(controller, x, 0), and in the refund case _claimRedeem does too. (In the funded case maxRedeem is 1, so redeem(1) burns the plant for 0 and moves on.)

5. Only the victim can clear a refunded head, and doing so restarts its cooldown. The position leaves the list only after claimRedeemRefund (#L1222-L1225), which is controller/operator-only and sets lastDepositTime[receiver] = block.timestamp before handing over the refunded share (#L942-L944). Cooldown is per account, so it covers the victim's whole wallet for 1 hour. Cancelling before settlement does the same (#L911).

Attack path

  1. The attacker deposits the 1 USDG minimum into the Junior vault and, after the permissionless HousePool.settleLpEpoch(0, 0), claims 1,000,694,481 share atoms.
  2. After its 1-hour cooldown, the attacker calls transfer(fresh, 1). The fresh address inherits the elapsed cooldown timestamp (#L329-L331).
  3. fresh calls requestRedeem(1, victim, fresh). The victim approves nothing.
  4. Settlement refunds the plant (or funds it at 0 assets).
  5. The victim later requests a redemption as usual, and the next settlement funds it.
  6. maxRedeem(victim) and maxWithdraw(victim) return 0 and redeem/withdraw revert.

The plant must land in an earlier hourly window than the victim's next request (in the same window it merges into the victim's position as a 1-share gift). If the victim already has queued requests, it sits behind them and becomes the head once they're claimed. It persists until cleared, so it can be placed any time beforehand.

Impact

All figures come from the PoC at release parameters.

An LP using an EOA

  • 4,999,999,999 USDG atoms (about 5,000 USDG) are funded and in escrow, but maxRedeem/maxWithdraw return 0, redeem reverts with ERC4626ExceededMaxRedeem(victim, reqShares, 0) and withdraw with ERC4626ExceededMaxWithdraw(victim, funded, 0).
  • claimRedeem(requestId, ...) pays the full amount without touching the cooldown, but the plant stays and the standard views keep showing 0.
  • Clearing the head with claimRedeemRefund while holding wallet shares hands the victim the attacker's share and locks 5,003,472,406,423 share atoms (about 5,000 USDG) for 3,600 s: transfer reverts at +3,599 s and the wallet unlocks at +3,600 s, and requestRedeem reverts in between. Funded USDG claims aren't affected.
  • Requesting the whole wallet first, then reclaiming, then calling redeem avoids that: 9,999,999,999 paid in one block, with the cooldown covering only the refunded atom (worth 0).
  • After the head is cleared, one more share atom hides the next funded request again. A plant behind an existing request leaves that request alone, then becomes the head and hides the next one.

A holder contract that claims only through the standard surface (illustration only)

A small holder written for this report claims with redeem(maxRedeem) / withdraw(maxWithdraw). No first-party contract claims this way, so it isn't counted toward severity. In the refund case its 9,999,999,999 funded atoms stay unreachable through all four standard functions at 1 h, 24 h and 365 days, while an identical control is paid in full, and no third party can clear the head. In the funded-dust case a withdraw holder stays blocked and a redeem holder recovers on its second claim.

Cost

One share atom per plant (convertToAssets(1) == 0) plus about 0.36M gas (measured in-test, cheatcode overhead included). No attacker profit and no victim value lost. The damage is that the documented claim path stops paying, max* tooling shows nothing claimable, and restoring standard claims costs the victim an unsolicited share and a cooldown restart unless it plans a whole-wallet request first.

Why this isn't a known issue or a duplicate

  • Cecuro LOW-39 / LOW-40 (addressed). Dust blocking another controller's share-receiver flows, and share delivery forcing a cooldown on another account. The fix made share-delivering claims require receiver == controller. This report reaches a similar outcome through an entry point that fix didn't touch: the unchecked controller on requestRedeem plus the full-balance minimum exemption.
  • Cecuro LOW-67 (accepted). A dust holder's own shares burned for 0. The funded-dust case shares that rounding, so the refund case is the main claim.
  • Cecuro MED-24 (known). Zero-payout epochs using up the settlement work budget. That's global settlement progress, not one controller's claim surface.
  • Cecuro LOW-43 (which address max* takes) and SC Audit Studio SC-H2 (zero-amount withdraw resetting another LP's cooldown, fixed) are different mechanisms, and no AI scan entry covers this.
  • SECURITY.md "LP claim and allocation limitations". Documents the full-balance dust exit for the owner's own request, not queueing one for another controller.
  • IAsyncTrancheVault NatSpec. Says a refundable head must be reclaimed before standard claims advance, which describes a controller's own refunded request. The same NatSpec says share delivery "cannot impose another account's cooldown", which is exactly what clearing a planted head does.
  • No repository test makes a redeem request with controller != owner, and no upstream commit or audit discusses it.

Recommended fix

The smallest change is to give the full-balance exemption only to self-controlled requests:

Solidity
// TrancheVault.requestRedeem
_requireMinimumRedeemSize(shares, controller == owner ? maxShares : type(uint256).max);

A request for someone else then has to be worth at least minTrancheDepositAssets(), so it can't be refunded as zero-value or floor to 0. It arrives as a claimable gift that redeem(maxRedeem) / withdraw(maxWithdraw) pay out and move past, and it's no longer free.

With this change applied, every PoC plant reverts with TrancheVault__WithdrawalTooSmall, an owner's own 1-share exit and an above-minimum third-party request still work, and all 238 repository LP spec tests pass.

Alternatives: require the controller's consent when controller != owner (msg.sender == controller || isOperator[controller][msg.sender]), or, as defence in depth, have redeem, withdraw, maxRedeem and maxWithdraw skip head positions with nothing claimable.

Proof of Concept

Proof of concept

PocBase.sol is a fixture on the repository's BasePerpTest. It applies the release values through the normal owner timelocks in setUp, funds LPs through the public ERC-7540 path, and re-checks every release value with _assertReleaseParams() in each test. Only fresh addresses are pranked, settlement goes through the public HousePool.settleLpEpoch(0, 0), and there's no vm.store, no deal on protocol contracts and no privileged prank.

Run from the repository root at the commit in scope:

Bash
mkdir -p packages/perps/test/perps/poc
# save both files below into that folder
FOUNDRY_PROFILE=quick forge test --root packages/perps --match-path test/perps/poc/RedeemHeadPlant.t.sol -vvv

The four eoaVictim / plantBehind / documentedRecovery tests carry the claim. The two Integrator tests are the holder-contract illustration, each against an identical control. Expected output (trimmed):

[PASS] test_documentedRecovery_requestWholeWalletThenReclaim()
[PASS] test_eoaVictim_reclaimRestartsWalletCooldown_andPlantRepeats()
[PASS] test_eoaVictim_standardClaimsRevert_explicitIdClaimPays()
  EOA explicit claimRedeem(requestId) USDG atoms 4999999999
[PASS] test_fundedDustPlantedHead_blocksWithdrawIntegrator()
[PASS] test_plantBehindExistingRequest_blocksNextRequest()
[PASS] test_refundedPlantedHead_blocksStandardOnlyIntegrator()
  victim integrator funded USDG atoms unreachable via ERC-7540/4626 9999999999
  control integrator USDG atoms paid through the same code 9999999999
Suite result: ok. 6 passed; 0 failed; 0 skipped
<details> <summary><code>PocBase.sol</code> (click to expand)</summary>
Solidity
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.35;

import {BasePerpTest} from "../BasePerpTest.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {CfdTypes} from "@plether/perps/CfdTypes.sol";
import {PletherOracle} from "@plether/perps/PletherOracle.sol";
import {TrancheVault} from "@plether/perps/TrancheVault.sol";
import {ICfdEngineAdminHost} from "@plether/perps/interfaces/ICfdEngineAdminHost.sol";
import {ICfdEngineRiskParamsView} from "@plether/perps/interfaces/ICfdEngineRiskParamsView.sol";
import {ICfdEngineTypes} from "@plether/perps/interfaces/ICfdEngineTypes.sol";
import {IHousePool} from "@plether/perps/interfaces/IHousePool.sol";
import {IOrderRouterAdminHost} from "@plether/perps/interfaces/IOrderRouterAdminHost.sol";
import {IPletherOracle} from "@plether/perps/interfaces/IPletherOracle.sol";
import {MockPyth} from "@plether/test-utils/MockPyth.sol";

abstract contract PocBase is BasePerpTest {

    uint256 internal constant REL_VPI_FACTOR = 0.01e18;
    uint256 internal constant REL_MAX_SKEW_RATIO = 0.4e18;
    uint256 internal constant REL_MAINT_MARGIN_BPS = 10;
    uint256 internal constant REL_INIT_MARGIN_BPS = 20;
    uint256 internal constant REL_FAD_MARGIN_BPS = 300;
    uint256 internal constant REL_BASE_CARRY_BPS = 500;
    uint256 internal constant REL_MIN_BOUNTY_ASSETS = 1e6;
    uint256 internal constant REL_BOUNTY_BPS = 10;
    uint256 internal constant REL_KEEPER_SHARE_BPS = 5000;
    uint256 internal constant REL_PROTOCOL_SHARE_BPS = 0;

    uint256 internal constant REL_EXECUTION_FEE_BPS = 4;
    uint256 internal constant REL_SETTLEMENT_BUFFER_BPS = 25;
    uint256 internal constant REL_FROZEN_CLOSE_SPREAD_BPS = 50;
    uint256 internal constant REL_CAP_PRICE = 2e8;
    uint256 internal constant REL_SIZE_QUANTUM = 1e20;
    uint256 internal constant REL_FAD_RUNWAY_SECONDS = 1 hours;
    uint256 internal constant REL_FAD_MAX_STALENESS = 3 days;
    uint256 internal constant REL_ENGINE_MARK_STALENESS = 60;

    uint256 internal constant REL_BASKET_MAX_CONF_RATIO_BPS = 10;
    uint256 internal constant REL_ADVERSE_CONF_MULTIPLIER_BPS = 2500;
    uint256 internal constant REL_ORDER_STALENESS = 60;
    uint256 internal constant REL_LIQUIDATION_STALENESS = 15;
    uint256 internal constant REL_ORDER_SETTLEMENT_WINDOW = 15;
    uint256 internal constant REL_MAX_COMPONENT_DIVERGENCE = 5;

    uint256 internal constant REL_MIN_OPEN_NOTIONAL_ASSETS = 1000e6;
    uint256 internal constant REL_MAX_PENDING_ORDERS = 5;
    uint256 internal constant REL_PROTECTION_TRIGGER_BOUNTY_ASSETS = 200_000;
    uint256 internal constant REL_OPEN_BOUNTY_BPS = 1;
    uint256 internal constant REL_MIN_OPEN_BOUNTY_ASSETS = 10_000;
    uint256 internal constant REL_MAX_OPEN_BOUNTY_ASSETS = 200_000;
    uint256 internal constant REL_MAX_EXECUTION_WINDOW_SECONDS = 60;
    uint256 internal constant REL_MIN_ENGINE_GAS = 600_000;
    uint256 internal constant REL_MAX_PRUNE_ORDERS = 64;

    uint256 internal constant REL_MAX_SENIOR_EXPOSURE_ASSETS = 40_000_000e6;
    uint256 internal constant REL_MAX_SENIOR_SHARE_BPS = 8000;
    uint256 internal constant REL_SENIOR_RATE_BPS = 800;
    uint256 internal constant REL_POOL_MARK_STALENESS = 60;
    uint256 internal constant REL_SENIOR_FROZEN_LP_FEE_BPS = 25;
    uint256 internal constant REL_JUNIOR_FROZEN_LP_FEE_BPS = 75;
    uint256 internal constant REL_JUNIOR_MAINTENANCE_FEE_APR_BPS = 0;
    uint256 internal constant REL_SEED_ASSETS = 1e6;

    address internal pocKeeper;
    address internal pocJuniorLp;
    uint256 internal pocPrice;

    mapping(address => mapping(bool => uint256)) internal pocLastDepositRequest;

    function _riskParams() internal pure virtual override returns (CfdTypes.RiskParams memory) {
        return CfdTypes.RiskParams({
            vpiFactor: REL_VPI_FACTOR,
            maxSkewRatio: REL_MAX_SKEW_RATIO,
            maintMarginBps: REL_MAINT_MARGIN_BPS,
            initMarginBps: REL_INIT_MARGIN_BPS,
            fadMarginBps: REL_FAD_MARGIN_BPS,
            baseCarryBps: REL_BASE_CARRY_BPS,
            minBountyAssets: REL_MIN_BOUNTY_ASSETS,
            bountyBps: REL_BOUNTY_BPS,
            keeperShareBps: REL_KEEPER_SHARE_BPS,
            protocolShareBps: REL_PROTOCOL_SHARE_BPS
        });
    }

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

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

    function _initialJuniorSeedDeposit() internal pure virtual override returns (uint256) {
        return REL_SEED_ASSETS;
    }

    function _initialSeniorSeedDeposit() internal pure virtual override returns (uint256) {
        return REL_SEED_ASSETS;
    }

    function _pocInitialJuniorLpAssets() internal pure virtual returns (uint256) {
        return 1_000_000e6;
    }

    function _pocDefaultPrice() internal pure virtual returns (uint256) {
        return 1.2e8;
    }

    function _pocPythFeeWei() internal pure virtual returns (uint256) {
        return 1;
    }

    function setUp() public virtual override {
        super.setUp();

        assertEq(pool.seniorPrincipal(), REL_SEED_ASSETS, "release Senior seed");
        assertEq(pool.juniorPrincipal(), REL_SEED_ASSETS, "release Junior seed");
        assertTrue(pool.isTradingActive(), "trading active after seeds");

        pocKeeper = _pocActor("pocKeeper");
        pocJuniorLp = _pocActor("pocJuniorLp");

        _pocApplyReleaseConfig();

        _pocWarpToWeekdayHourUtc(9);
        baseMockPyth.setFee(_pocPythFeeWei());

        uint256 price = _pocDefaultPrice();
        _setPrice(price);
        _updateMark(pocKeeper, price);

        uint256 juniorAssets = _pocInitialJuniorLpAssets();
        if (juniorAssets > 0) {
            uint256 requestId = _lpRequestDeposit(pocJuniorLp, false, juniorAssets);
            _warpToLpEpoch(requestId);
            _settleLpEpochPublic(pocKeeper);
            assertGt(_lpClaimShares(pocJuniorLp, false), 0, "setUp Junior shares");
        }

        _setPrice(price);
        _updateMark(pocKeeper, price);
        assertFalse(_isFadOrFrozen(), "setUp must end outside FAD / frozen windows");

        _assertReleaseParams();
    }

    function _pocApplyReleaseConfig() internal {
        uint256 readyAt = vm.getBlockTimestamp();

        bool poolChange;
        IHousePool.PoolConfig memory poolConfig = _currentPoolConfig();
        if (
            poolConfig.maxSeniorExposureAssets != REL_MAX_SENIOR_EXPOSURE_ASSETS
                || poolConfig.maxSeniorShareBps != REL_MAX_SENIOR_SHARE_BPS
                || poolConfig.seniorRateBps != REL_SENIOR_RATE_BPS
                || poolConfig.markStalenessLimit != REL_POOL_MARK_STALENESS
                || poolConfig.seniorFrozenLpFeeBps != REL_SENIOR_FROZEN_LP_FEE_BPS
                || poolConfig.juniorFrozenLpFeeBps != REL_JUNIOR_FROZEN_LP_FEE_BPS
        ) {
            poolConfig.maxSeniorExposureAssets = REL_MAX_SENIOR_EXPOSURE_ASSETS;
            poolConfig.maxSeniorShareBps = REL_MAX_SENIOR_SHARE_BPS;
            poolConfig.seniorRateBps = REL_SENIOR_RATE_BPS;
            poolConfig.markStalenessLimit = REL_POOL_MARK_STALENESS;
            poolConfig.seniorFrozenLpFeeBps = REL_SENIOR_FROZEN_LP_FEE_BPS;
            poolConfig.juniorFrozenLpFeeBps = REL_JUNIOR_FROZEN_LP_FEE_BPS;
            pool.proposePoolConfig(poolConfig);
            readyAt = _pocMax(readyAt, pool.poolConfigActivationTime());
            poolChange = true;
        }

        bool routerChange;
        IOrderRouterAdminHost.RouterConfig memory routerConfig = _routerConfig();
        if (
            routerConfig.minOpenNotionalAssets != REL_MIN_OPEN_NOTIONAL_ASSETS
                || routerConfig.adverseConfidenceMultiplierBps != REL_ADVERSE_CONF_MULTIPLIER_BPS
                || routerConfig.basketMaxConfidenceRatioBps != REL_BASKET_MAX_CONF_RATIO_BPS
                || routerConfig.maxPendingOrders != REL_MAX_PENDING_ORDERS
                || routerConfig.positionProtectionTriggerBountyAssets != REL_PROTECTION_TRIGGER_BOUNTY_ASSETS
        ) {
            routerConfig.minOpenNotionalAssets = REL_MIN_OPEN_NOTIONAL_ASSETS;
            routerConfig.adverseConfidenceMultiplierBps = REL_ADVERSE_CONF_MULTIPLIER_BPS;
            routerConfig.basketMaxConfidenceRatioBps = REL_BASKET_MAX_CONF_RATIO_BPS;
            routerConfig.maxPendingOrders = REL_MAX_PENDING_ORDERS;
            routerConfig.positionProtectionTriggerBountyAssets = REL_PROTECTION_TRIGGER_BOUNTY_ASSETS;
            routerAdmin.proposeRouterConfig(routerConfig);
            readyAt = _pocMax(readyAt, routerAdmin.routerConfigActivationTime());
            routerChange = true;
        }

        bool riskChange;
        ICfdEngineAdminHost.EngineRiskConfig memory riskConfig = _engineRiskConfig();
        if (
            riskConfig.executionFeeBps != REL_EXECUTION_FEE_BPS
                || riskConfig.settlementBufferBps != REL_SETTLEMENT_BUFFER_BPS
                || riskConfig.frozenCloseSpreadBps != REL_FROZEN_CLOSE_SPREAD_BPS
                || keccak256(abi.encode(riskConfig.riskParams)) != keccak256(abi.encode(_riskParams()))
        ) {
            riskConfig.riskParams = _riskParams();
            riskConfig.executionFeeBps = REL_EXECUTION_FEE_BPS;
            riskConfig.settlementBufferBps = REL_SETTLEMENT_BUFFER_BPS;
            riskConfig.frozenCloseSpreadBps = REL_FROZEN_CLOSE_SPREAD_BPS;
            engineAdmin.proposeRiskConfig(riskConfig);
            readyAt = _pocMax(readyAt, engineAdmin.riskConfigActivationTime());
            riskChange = true;
        }

        bool calendarChange;
        if (engine.fadRunwaySeconds() != REL_FAD_RUNWAY_SECONDS) {
            ICfdEngineAdminHost.EngineCalendarConfig memory calendarConfig;
            calendarConfig.fadDayTimestamps = new uint256[](0);
            calendarConfig.fadRunwaySeconds = REL_FAD_RUNWAY_SECONDS;
            engineAdmin.proposeCalendarConfig(calendarConfig);
            readyAt = _pocMax(readyAt, engineAdmin.calendarConfigActivationTime());
            calendarChange = true;
        }

        bool maintenanceFeeChange;
        if (juniorVault.maintenanceFeeAprBps() != REL_JUNIOR_MAINTENANCE_FEE_APR_BPS) {
            juniorVault.proposeMaintenanceFeeConfig(REL_JUNIOR_MAINTENANCE_FEE_APR_BPS, engine.protocolTreasury());
            readyAt = _pocMax(readyAt, juniorVault.maintenanceFeeConfigActivationTime());
            maintenanceFeeChange = true;
        }

        if (readyAt > vm.getBlockTimestamp()) {
            vm.warp(readyAt + 1);
            vm.roll(vm.getBlockNumber() + 1);
        }
        if (poolChange) {
            pool.finalizePoolConfig();
        }
        if (routerChange) {
            routerAdmin.finalizeRouterConfig();
        }
        if (riskChange) {
            engineAdmin.finalizeRiskConfig();
        }
        if (calendarChange) {
            engineAdmin.finalizeCalendarConfig();
        }
        if (maintenanceFeeChange) {
            juniorVault.finalizeMaintenanceFeeConfig();
        }
    }

    function _pocWarpToWeekdayHourUtc(
        uint256 hourUtc
    ) internal {
        uint256 nowTs = vm.getBlockTimestamp();
        uint256 day = nowTs / 1 days;
        uint256 target = day * 1 days + hourUtc * 1 hours;
        if (target < nowTs) {
            day += 1;
            target += 1 days;
        }
        while (((day + 4) % 7) == 0 || ((day + 4) % 7) >= 5) {
            day += 1;
            target += 1 days;
        }
        _pocWarpTo(target);
        vm.roll(vm.getBlockNumber() + 1);
    }

    function _assertReleaseParams() internal view {
        CfdTypes.RiskParams memory rp = ICfdEngineRiskParamsView(address(engine)).riskParams();
        assertEq(rp.vpiFactor, REL_VPI_FACTOR, "rel: vpiFactor");
        assertEq(rp.maxSkewRatio, REL_MAX_SKEW_RATIO, "rel: maxSkewRatio");
        assertEq(rp.maintMarginBps, REL_MAINT_MARGIN_BPS, "rel: maintMarginBps");
        assertEq(rp.initMarginBps, REL_INIT_MARGIN_BPS, "rel: initMarginBps");
        assertEq(rp.fadMarginBps, REL_FAD_MARGIN_BPS, "rel: fadMarginBps");
        assertEq(rp.baseCarryBps, REL_BASE_CARRY_BPS, "rel: baseCarryBps");
        assertEq(rp.minBountyAssets, REL_MIN_BOUNTY_ASSETS, "rel: minBountyAssets");
        assertEq(rp.bountyBps, REL_BOUNTY_BPS, "rel: bountyBps");
        assertEq(rp.keeperShareBps, REL_KEEPER_SHARE_BPS, "rel: keeperShareBps");
        assertEq(rp.protocolShareBps, REL_PROTOCOL_SHARE_BPS, "rel: protocolShareBps");

        assertEq(engine.executionFeeBps(), REL_EXECUTION_FEE_BPS, "rel: executionFeeBps");
        assertEq(engine.settlementBufferBps(), REL_SETTLEMENT_BUFFER_BPS, "rel: settlementBufferBps");
        assertEq(engine.frozenCloseSpreadBps(), REL_FROZEN_CLOSE_SPREAD_BPS, "rel: frozenCloseSpreadBps");
        assertEq(engine.fadRunwaySeconds(), REL_FAD_RUNWAY_SECONDS, "rel: fadRunwaySeconds");
        assertEq(engine.fadMaxStaleness(), REL_FAD_MAX_STALENESS, "rel: fadMaxStaleness");
        assertEq(engine.engineMarkStalenessLimit(), REL_ENGINE_MARK_STALENESS, "rel: engineMarkStalenessLimit");
        assertEq(engine.CAP_PRICE(), REL_CAP_PRICE, "rel: engine CAP_PRICE");
        assertEq(uint256(terminalNavBook.CAP_PRICE()), REL_CAP_PRICE, "rel: book CAP_PRICE");
        assertEq(terminalNavBook.SIZE_QUANTUM(), REL_SIZE_QUANTUM, "rel: book SIZE_QUANTUM");
        assertEq(CfdTypes.SIZE_QUANTUM, REL_SIZE_QUANTUM, "rel: CfdTypes.SIZE_QUANTUM");
        assertEq(address(engine.orderRouter()), address(router), "rel: engine router");
        assertEq(address(engine.pool()), address(pool), "rel: engine pool");

        assertEq(router.minOpenNotionalAssets(), REL_MIN_OPEN_NOTIONAL_ASSETS, "rel: minOpenNotionalAssets");
        assertEq(router.maxPendingOrders(), REL_MAX_PENDING_ORDERS, "rel: maxPendingOrders");
        assertEq(
            router.positionProtectionTriggerBountyAssets(),
            REL_PROTECTION_TRIGGER_BOUNTY_ASSETS,
            "rel: positionProtectionTriggerBountyAssets"
        );
        assertEq(router.openOrderExecutionBountyBps(), REL_OPEN_BOUNTY_BPS, "rel: openOrderExecutionBountyBps");
        assertEq(
            router.minOpenOrderExecutionBountyAssets(), REL_MIN_OPEN_BOUNTY_ASSETS, "rel: minOpenOrderExecutionBounty"
        );
        assertEq(
            router.maxOpenOrderExecutionBountyAssets(), REL_MAX_OPEN_BOUNTY_ASSETS, "rel: maxOpenOrderExecutionBounty"
        );
        assertEq(router.maxExecutionWindowSeconds(), REL_MAX_EXECUTION_WINDOW_SECONDS, "rel: maxExecutionWindow");
        assertEq(router.minEngineGas(), REL_MIN_ENGINE_GAS, "rel: minEngineGas");
        assertEq(router.maxPruneOrdersPerCall(), REL_MAX_PRUNE_ORDERS, "rel: maxPruneOrdersPerCall");

        IPletherOracle oracle = router.pletherOracle();
        assertEq(address(oracle), address(pletherOracle), "rel: router oracle");
        assertEq(oracle.adverseConfidenceMultiplierBps(), REL_ADVERSE_CONF_MULTIPLIER_BPS, "rel: adverse multiplier");
        assertEq(oracle.basketMaxConfidenceRatioBps(), REL_BASKET_MAX_CONF_RATIO_BPS, "rel: basket confidence");
        assertEq(oracle.orderExecutionStalenessLimit(), REL_ORDER_STALENESS, "rel: order staleness");
        assertEq(oracle.liquidationStalenessLimit(), REL_LIQUIDATION_STALENESS, "rel: liquidation staleness");
        assertEq(oracle.orderSettlementWindow(), REL_ORDER_SETTLEMENT_WINDOW, "rel: order settlement window");
        assertEq(
            oracle.maxComponentPublishTimeDivergence(), REL_MAX_COMPONENT_DIVERGENCE, "rel: component divergence"
        );
        assertEq(baseMockPyth.mockFee(), _pocPythFeeWei(), "poc: mock Pyth fee");

        assertEq(pool.maxSeniorExposureAssets(), REL_MAX_SENIOR_EXPOSURE_ASSETS, "rel: maxSeniorExposureAssets");
        assertEq(pool.maxSeniorShareBps(), REL_MAX_SENIOR_SHARE_BPS, "rel: maxSeniorShareBps");
        assertEq(pool.seniorRateBps(), REL_SENIOR_RATE_BPS, "rel: seniorRateBps");
        assertEq(pool.markStalenessLimit(), REL_POOL_MARK_STALENESS, "rel: pool markStalenessLimit");
        assertEq(pool.seniorFrozenLpFeeBps(), REL_SENIOR_FROZEN_LP_FEE_BPS, "rel: senior frozen LP fee");
        assertEq(pool.juniorFrozenLpFeeBps(), REL_JUNIOR_FROZEN_LP_FEE_BPS, "rel: junior frozen LP fee");
        assertTrue(pool.isTradingActive(), "rel: trading active");
        assertTrue(pool.isSeedLifecycleComplete(), "rel: seeds initialized");

        assertEq(juniorVault.maintenanceFeeAprBps(), REL_JUNIOR_MAINTENANCE_FEE_APR_BPS, "rel: junior maintenance fee");
        assertEq(seniorVault.maintenanceFeeAprBps(), 0, "rel: senior maintenance fee");
        assertEq(_initialJuniorSeedDeposit(), REL_SEED_ASSETS, "rel: junior seed");
        assertEq(_initialSeniorSeedDeposit(), REL_SEED_ASSETS, "rel: senior seed");
        assertEq(juniorVault.seedReceiver(), address(this), "rel: junior seed receiver");
        assertEq(seniorVault.seedReceiver(), address(this), "rel: senior seed receiver");
        assertGt(juniorVault.seedShareFloor(), 0, "rel: junior seed floor");
        assertGt(seniorVault.seedShareFloor(), 0, "rel: senior seed floor");

        assertEq(pool.poolConfigActivationTime(), 0, "rel: no pending pool proposal");
        assertEq(routerAdmin.routerConfigActivationTime(), 0, "rel: no pending router proposal");
        assertEq(routerAdmin.oracleConfigActivationTime(), 0, "rel: no pending oracle proposal");
        assertEq(engineAdmin.riskConfigActivationTime(), 0, "rel: no pending risk proposal"

The original report as published on Immunefi, by Naveen0x. 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 redeem request function trusts any controller address and skips the minimum-size check when the request equals the owner's whole balance, letting a one-atom request become the head of another account's queue.

Impact

The victim's funded redemptions stay in escrow but the documented redeem and withdraw path reverts and max views show nothing; no value is lost and the explicit-id claimRedeem still pays in full, though clearing the head costs the victim an unsolicited share and a cooldown restart.

What the attacker needed

One share atom (worth 0); gas for the transaction; no action from the victim

The fix

The full-balance minimum exemption should apply only when the controller is the owner, so a third-party request must meet the minimum deposit size and cannot be refunded as zero-value.

How it was found

  1. The attacker deposits the minimum, settles the epoch and claims share atoms.
  2. After the cooldown, the attacker transfers one share atom to a fresh address.
  3. The fresh address calls requestRedeem naming the victim as controller.
  4. Settlement refunds the plant or funds it at zero assets.
  5. The victim later requests a redemption and the next settlement funds it.
  6. The victim's maxRedeem and maxWithdraw return 0 and redeem and withdraw revert.

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 a request to take their money out, and it keeps a list of these requests per account. The first request in that list is the one the normal 'take my money out' buttons look at. The report shows that anyone can add a tiny, worthless request to the front of someone else's list, so the normal buttons get stuck on it and refuse to pay out the real, larger request behind it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Naveen0x

View all

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