Users can use the buyOrder()
function to fulfil sell orders, however, sell orders can be edited while the order is still active, this allows the seller to front-run a buy call for their sell order, editing their order so that the buyer ends up overpaying.
Likelihood:
This can happen whenever a malicious seller's order is being fulfilled
Impact:
Loss of funds for the buyer
Append the following test to TestOrderBook.t.sol
and run forge test --mt test_frontRun
Consider allowing buyers to set a slippage, reverting the transaction if the order is too unfavorable.
A malicious seller can front-run a buy order for their order, and decrease the amount of assets to be sold. If the price is unchanged, the buy transaction fulfills, but the buyer gets lesser amount than expected.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.