Lack of deadline for uniswap AMM #932
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
M-04
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
Lines of code
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L83-L102
Vulnerability details
Lack of deadline for uniswap AMM
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L83-L102
Proof of Concept
The ISwapRouter.exactInputSingle params (used in the rocketpool derivative) does not include a deadline currently.
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L83-L102
The following scenario can happen:
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.
Tools Used
Manual review.
Recommended Mitigation Steps
The
Reth.deposit()
function should accept a user-inputdeadline
param that should be passed along to Reth.swapExactInputSingleHop() and ISwapRouter.exactInputSingle().The text was updated successfully, but these errors were encountered: