Missing slippage/min-return check in UniswapHandler
#256
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
This issue or pull request already exists
Handle
cmichel
Vulnerability details
The contracts are missing slippage checks which can lead to being vulnerable to sandwich attacks.
See
UniswapHandler.buyMalt
:Impact
Trades can happen at a bad price and lead to receiving fewer Malt tokens than at a fair market price.
The attacker's profit is the protocol's loss.
Recommended Mitigation Steps
Add minimum return amount checks.
Accept a function parameter that can be chosen by the transaction sender, then check that the actually received amount is above this parameter.
Alternatively, check if it's feasible to send these transactions directly to a miner (flashbots) such that they are not visible in the public mempool.
The text was updated successfully, but these errors were encountered: