A third party can plant a zero-value redeem request at the head of any LP's queue, breaking the standard redeem/withdraw claim path for that LP
The redeem request function authorises the share owner rather than the named controller, and a request for the owner's entire balance skips the minimum size check, so anyone can plant a one-atom request at the head of another LP's queue. Because the standard ERC-4626 claim functions and their max views only read the queue head, the victim's later funded redemptions become invisible and redeem/withdraw revert until the victim clears the plant.
- Disclosed after under an hour
#99329 [SC-Low] A third party can plant a zero-value redeem request at the head of any LP's queue, breaking the standard redeem/withdraw claim path for that LP
Submitted on Nov 13th 2026 at 07:14:37 UTC by @tomX0 for Audit Competition | Plether
- Report ID: #99329
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/audit-comp-plether/tree/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src
- Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
Description
Summary
Each tranche vault keeps a per-controller queue of redeem requests, and the ERC-4626 claim functions (redeem, withdraw) and their views (maxRedeem, maxWithdraw) only ever look at the head of that queue. Two other rules make the head attackable:
requestRedeem(shares, controller, owner)authorises the owner of the shares, not the controller, so anyone can open a request in someone else's name.- A request for the owner's entire balance is exempt from the 1 USDG minimum request size.
Together they let anyone holding one share atom send it to a fresh address and call requestRedeem(1, victim, fresh). That 1-share request becomes the victim's queue head. It is worth nothing, so settlement refunds it instead of funding it. From then on the victim's funded redemptions are invisible to maxRedeem/maxWithdraw, and redeem/withdraw revert, until the victim clears the planted request themselves.
It costs the attacker 1 share atom (worth 0 USDG) and about 190k gas per victim. It needs nothing from the victim, hits many LPs in one transaction, and can be repeated after every clean-up. Junior and Senior use the same code. No funds are lost: the explicit-id claimRedeem(requestId, ...) still pays.
Severity
Low: Contract fails to deliver promised returns, but doesn't lose value.
The docs promise this claim path. CANONICAL_ENTRYPOINTS.md says funded requests are "claimed through ERC-4626 redeem or withdraw", and ACCOUNTING_SPEC.md says maxWithdraw and maxRedeem "expose only funded claim capacity". After a plant they expose nothing even though the request is funded. I'm not claiming a freeze or a loss, because the explicit-id claim pays at once.
Affected code
Line numbers are for packages/perps/src at commit a82d4fe.
TrancheVault.sol#L606-L632:requestRedeem, controller never checkedTrancheVault.sol#L1611-L1618:_requireMinimumRedeemSize, full-balance exemptionTrancheVault.sol#L1783-L1797:_appendControllerRedeem, first entry becomes the headTrancheVault.sol#L998-L1012and#L1299-L1311:withdraw/redeemandmaxWithdraw/maxRedeemact on the head onlyTrancheVault.sol#L916-L947:claimRedeemRefund, controller-only, restarts the receiver's cooldownHousePool.sol#L960-L986: zero-value epoch refund
Root cause
1. The controller is never checked, and a full-balance request skips the minimum.
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); // any controller
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 queue becomes the head (#L1789-L1791):
uint256 tail = controllerRedeemTail[controller];
if (tail == 0) {
controllerRedeemHead[controller] = requestId;
3. Standard claims and views only read the head (#L1003, #L1011, #L1302, #L1309):
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. An hourly epoch that holds only zero-value requests takes the fullHeadAssets == 0 branch in HousePool and is refunded, so fundedShares stays 0 and both claimableRedeemRequest and claimableRedeemAssets return 0. _claimRedeem and _claimWithdraw then revert with ERC4626ExceededMaxRedeem(controller, x, 0) and ERC4626ExceededMaxWithdraw(controller, x, 0). If an honest redeemer happens to share the window, the plant is funded instead, but its assets floor to 0, so withdraw stays blocked and redeem(1) burns it for nothing.
5. Only the victim can clear it, and doing so restarts the victim's cooldown. A refunded position leaves the queue only after claimRedeemRefund (#L1222-L1225). That function 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
- 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. - After its 1-hour cooldown, the attacker moves one atom to a fresh address (or a helper contract), which inherits the elapsed cooldown (
#L329-L331). - The fresh address calls
requestRedeem(1, victim, fresh). A helper contract can repeat this for a list of victims in one transaction. - Settlement refunds the plant.
- The victim later requests a redemption as usual, and the next settlement funds it.
maxRedeem(victim)andmaxWithdraw(victim)return 0, andredeem/withdrawrevert.
The plant has to land in an earlier hourly window than the victim's next request (in the same window it just merges into the victim's position as a 1-share gift). If the victim already has queued requests, the plant sits behind them and becomes the head once they're claimed. It persists until cleared, so it can be placed long in advance.
Impact
Figures are from the PoC at release parameters.
An LP using an EOA
- 4,999,999,999 USDG atoms (about 5,000 USDG) are funded and sitting in escrow, but
maxRedeemandmaxWithdrawreturn 0,redeemreverts withERC4626ExceededMaxRedeem(victim, reqShares, 0)andwithdrawwithERC4626ExceededMaxWithdraw(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 it with
claimRedeemRefundwhile 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.transferreverts at +3,599 s and the wallet unlocks at +3,600 s. Funded USDG claims aren't affected. - The victim can avoid the lock by requesting the whole wallet first, then reclaiming, then calling
redeem. That pays 9,999,999,999 in one block, and the cooldown then only covers the refunded atom. - After a clean-up, one more share atom hides the next funded request again. A plant behind an existing request leaves that request alone, then hides the next one.
Many LPs at once. One helper contract planted 50 addresses in a single transaction at 189,536 gas per plant (measured inside the contract, with no test overhead). One real LP among them later had its funded 4,999,999,999 atoms hidden in the same way. The attacker's 1 USDG deposit holds enough atoms for about a billion plants, so gas is the only limit.
A holder that claims only through the standard surface (illustration only). A small contract written for this report claims with redeem(maxRedeem) / withdraw(maxWithdraw). Its 9,999,999,999 funded atoms stay unreachable through all four standard functions at 1 h, 24 h and 365 days. An identical control contract with no plant is paid in full by the same code, and no third party can clear the head. No first-party contract claims this way, so I'm not counting this toward severity.
Cost. One share atom per victim (convertToAssets(1) == 0) plus gas. No attacker profit and no victim loss. What breaks is the documented claim path, max*-based tooling, and the victim's ability to undo the plant without an unsolicited share and a cooldown restart.
What is intended and what isn't
Some pieces of this are by design, and they aren't what I'm reporting:
- Naming another controller is allowed by ERC-7540, and the interface NatSpec says request authorisation "follows ERC-7540 owner approval rules". On its own that only lets someone hand an LP a redeem request, which is harmless if the request is claimable.
- Head-only standard claims, and the need to reclaim a refundable head before they advance, are documented in
IAsyncTrancheVault. That text describes a controller's own refunded request. - The full-balance dust exit is documented in
SECURITY.mdand the interface ("redeeming this owner's entire available balance permits dust exits") as a way for an owner to leave with its own dust.
The bug is the combination. The dust exemption lets a stranger create a request that is guaranteed to be non-claimable, and head-only claims let that request block another account's later, real redemptions. No doc says a third party can do this. Clearing it also hands the victim an unsolicited share and restarts its cooldown, which the same NatSpec says the receiver == controller rule exists to prevent ("share delivery cannot impose another account's cooldown").
Plether's own app claims by request id, so its users can still withdraw. They would see an unexplained 1-share refundable request, and reclaiming it from the app restarts their cooldown. The direct breakage is for anything that uses the standard ERC-7540 surface the integration guide documents, such as integrators, aggregators and tooling that reads max*.
Relationship to known issues
- 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 uncheckedcontrolleronrequestRedeem. - Cecuro LOW-67 (accepted). A dust holder's own shares burned for 0 assets. Same rounding, but it only affects the holder's own request, not another account's queue.
- Cecuro MED-24 (known). Zero-payout epochs using up the settlement work budget. Same 1-share primitive, different harm: global settlement progress versus one controller's claim path.
- 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. The AI scan report has no matching entry. - No repository test makes a redeem request with
controller != owner, and no upstream commit discusses it.
Recommended fix
The smallest change gives the full-balance exemption only to self-controlled requests:
// 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. ERC-7540's controller semantics are unchanged.
I applied this change locally. Every plant in the PoC, including the batched one, 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 built 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. After setUp only fresh addresses act, 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:
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 tests:
test_eoaVictim_standardClaimsRevert_explicitIdClaimPays: standard claims revert for a planted EOA, and the explicit-id claim still pays.test_eoaVictim_reclaimRestartsWalletCooldown_andPlantRepeats: clearing the plant locks the wallet for 1 hour, and a second plant hides the next request.test_plantBehindExistingRequest_blocksNextRequest: a plant behind a queued request takes over once that request is claimed.test_documentedRecovery_requestWholeWalletThenReclaim: the recovery order that avoids the lock.test_massPlant_oneTransactionBlindsManyLps: 50 plants in one transaction, then a real LP's funded request is hidden.test_refundedPlantedHead_blocksStandardOnlyIntegrator: the standard-surface holder illustration, against an identical control.
Expected output (trimmed):
[PASS] test_documentedRecovery_requestWholeWalletThenReclaim()
recovery: paid via reclaim + standard redeem in one block 9999999999
[PASS] test_eoaVictim_reclaimRestartsWalletCooldown_andPlantRepeats()
victim wallet share atoms locked by the cooldown 5003472406423
[PASS] test_eoaVictim_standardClaimsRevert_explicitIdClaimPays()
EOA explicit claimRedeem(requestId) USDG atoms 4999999999
[PASS] test_massPlant_oneTransactionBlindsManyLps()
addresses planted in one transaction 50
gas per plant inside the helper (no cheatcodes) 189536
victim funded USDG atoms hidden after the mass plant 4999999999
[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
// 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");
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 combination of an unchecked controller parameter on requestRedeem and a full-balance exemption from the minimum request size, which together let a stranger create a guaranteed non-claimable head that head-only standard claims then treat as the only claimable position.
Impact
The victim's funded redemption is hidden from the standard claim path and max views, and redeem/withdraw revert, though the explicit-id claimRedeem still pays and no funds are lost; clearing the plant hands the victim an unsolicited share and restarts their cooldown.
What the attacker needed
Attacker holds one share atom; plant lands before victim's next request; victim uses standard redeem/withdraw
The fix
The full-balance minimum-size exemption should apply only when the controller is the owner, so a third-party request must meet the minimum and arrives as a claimable gift.
How it was found
- The attacker deposits the minimum into the Junior vault and claims share atoms after settlement.
- After the cooldown, the attacker moves one share atom to a fresh address.
- The fresh address calls requestRedeem naming the victim as controller.
- Settlement refunds the zero-value plant.
- The victim requests a redemption as usual and the next settlement funds it.
- The victim's maxRedeem and maxWithdraw return 0 and redeem/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 up a request to take their money out, and it handles these requests one at a time, oldest first. The code that lets you name whose queue a request goes into never checks that you are that person, and a tiny request for someone's whole balance is allowed through a minimum-size exemption. So an attacker can slip a worthless request to the front of a stranger's queue, and the normal 'take my money out' buttons then look at that worthless entry and refuse to pay.
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.