Lack of deadline for uniswap AMM
The Uniswap swap call in the Reth derivative lacks a deadline parameter, so a transaction can be held by a validator and executed later when market conditions cause maximum slippage. An attacker could front-run or delay the swap to profit at the user's expense.
Submitted by brgltd, also found by rbserver, 0xepley, Breeje, BPZ, eyexploit, SadBase, peanuts, 0xbepresent, ladboy233, Polaris_tow, SaeedAlipoor01988, latt1ce, and 0xnev
Proof of Concept
The ISwapRouter.exactInputSingle params (used in the rocketpool derivative) does not include a deadline currently.
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _tokenIn,
tokenOut: _tokenOut,
fee: _poolFee,
recipient: address(this),
amountIn: _amountIn,
amountOutMinimum: _minOut,
sqrtPriceLimitX96: 0
});
The following scenario can happen:
- User is staking and some/all the weight is in Reth.
- The pool can’t deposit eth, so uniswap will be used to convert eth to weth.
- A validator holds the tx until it becomes advantageous due to some market condition (e.g. slippage or running his tx before and frontrun the original user stake).
- This could potentially happen to a large amount of stakes, due to widespread usage of bots and MEV.
Impact
Because Front-running is a key aspect of AMM design, deadline is a useful tool to ensure that your tx cannot be “saved for later”.
Due to the removal of the check, it may be more profitable for a validator to deny the transaction from being added until the transaction incurs the maximum amount of slippage.
Recommended Mitigation Steps
The Reth.deposit() function should accept a user-input deadline param that should be passed along to Reth.swapExactInputSingleHop() and ISwapRouter.exactInputSingle().
Using swapTo/swapFrom directly from rocketpool.
Status: Not mitigated. Full details in reports from d3e4, adriro, and 0x52 - and also shared below in the Mitigation Review section.
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
Impact
A validator could delay the swap until it incurs maximum slippage, potentially affecting a large amount of stakes due to widespread bots and MEV.
What the attacker needed
User stakes with Reth weight; pool cannot deposit ETH; validator can delay transactions
The fix
The deposit function should accept a user-supplied deadline and pass it to the swap call; the mitigation was not accepted.
How it was found
- A user stakes and some or all weight is in Reth.
- The pool cannot deposit ETH, so Uniswap is used to convert ETH to WETH.
- A validator holds the transaction until it becomes advantageous due to market conditions.
- The validator front-runs the original user stake or delays it to incur maximum slippage.
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.
When you swap tokens on a decentralised exchange, you can set a deadline so the trade fails if it is not processed in time. Here that deadline is missing, so a miner or validator can keep the trade pending and execute it later when the price is worse for you, making a profit for themselves.
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.