Missing slippage/min-return check in the UniswapHandler
contract
#53
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
defsec
Vulnerability details
Impact
Trades can happen at a bad price and lead to receiving fewer tokens than at a fair market price.
The attacker's profit is the protocol's loss.
Proof of Concept
The contracts are missing slippage checks which can lead to being vulnerable to sandwich attacks.
See UniswapHandler.buyMalt and sellMalt functions:
Tools Used
None
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 such that they are not visible in the public mempool.
The text was updated successfully, but these errors were encountered: