Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: high
Invalid

Deadline Not Set Before Swap Execution

Summary

The executeSwapExactInput function is called from FeeDistributionBranch and CreditDelegationBranch to swap assets. This function relies on a deadline for Uniswap swaps, but no call to BaseAdapter::setDeadline is made before execution. If the deadline is not explicitly set, swaps will fail in Uniswap V2/V3 due to expired transactions, leading to unexpected failures.


Vulnerability Details

FeeDistributionBranch and CreditDelegationBranch has swap functionality. It calls executeSwapExactInput functions from the adapters. When the swap target is uniswap, the executeSwapExactInput and executeSwapExactInputSingle function passes a deadline parameter with swap data when calling uniswap router:

uint256[] memory amountsOut = IUniswapV2Router02(uniswapV2SwapStrategyRouterCache).swapExactTokensForTokens({
amountIn: swapPayload.amountIn,
amountOutMin: amountOutMinimum,
path: tokens,
to: swapPayload.recipient,
deadline: deadline // @audit - deadline is used but not explicitly set before execution
});

This deadline is taken from BaseAdapter. If deadline is zero or outdated, Uniswap will reject the swap


Impact

Swaps will fail, causing keepers unable to convert assets to WETH in FeeDistributionBranch. convertMarketsCreditDepositsToUsdc, settleVaultsDebt and rebalanceVaultsAssets in CreditDelegationBranch will fail when swap is required. The protocol will not be able to balance vaults and reward users.


Recommendations

Call BaseAdapter::setDeadline to set deadline for new swap before calling adapter for swap and change it's owner restriction to allowed engines such that only allowed engines can call that function

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!