Deadline in IV3SwapRouter::ExactOutputParams is not set, any market swings could keep this transaction pending #133
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
duplicate-24
insufficient quality report
This report is not of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/swappers/UniSwapper.sol#L143-L169
Vulnerability details
Impact
In ExactOutputParams of Uniswap, the deadline parameter tells uniswap the deadline before which the swap should get executed. Incase, the swap could not be executed, the transaction should be retired.
Not passing deadline leaves the swap order pending and will be execute when market meets the parameter conditions again.
Proof of Concept
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/swappers/UniSwapper.sol#L143-L169
Since the deadline is no set, if there was a market swing leading to change in circumstances not matching the parameter conditions, the swap order will live as pending order to be executed.
hence, there is a potential that the order will be executed at some other time when it was assumed as cancelled.
This is not recommended.
Tools Used
Manual review
Recommended Mitigation Steps
Set the deadline to some time line on top of block.timestamp, say 10 minutes or one hour.
Assessed type
Uniswap
The text was updated successfully, but these errors were encountered: