UniSwapper.swapExactOut allows Sandwich attacks (front-run and back-run) #38
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
edited-by-warden
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/main/src/swappers/UniSwapper.sol#L143
Vulnerability details
Impact
Loss of funds.
Proof of Concept
UniSwapper.swapExactOut
The function
swapExactOut
tries to do the swap in the same block that it is initiated considering that thedeadline
isblock.timestamp
, as shown at[1]
, this approach carries a lot of Sandwich attacks (front-run and back-run).This is mainly possible because the lack of a
timelock
to protect against front-runs and also anexpiration time
to protect against back-runs. Important to note that the system uses UniSwap V2 and the timelock is a mechanism used by UniSwap V2.Tools Used
Manual review
Recommended Mitigation Steps
Patch
Assessed type
Other
The text was updated successfully, but these errors were encountered: