Sellers can arbitrarily change the amount of asset they’re selling. This allows them to frontrun a buyer’s transaction and reduce the amount for sale, effectively scamming the buyer.
When calling the buyOrder
function, buyers only specify the orderId and expect to receive the full amount of the asset listed in the order.
The issue is that the seller can call amendSellOrder
at any time and reduce the amount for sale (_newAmountToSell). If this happens while a buy transaction is already sitting in the mempool, the seller can frontrun it and reduce the amount—causing the buyer to receive less than what was originally listed.
Likelihood:
Can happen on each buyOrder
call.
Impact:
The seller could change the amount to 1 (closest to nothing as possible) so get all of the price fot the initial amount of tokens giving almost nothing in return.
Alice lists an sell offer 1e18 weth for 3000e6 usdc.
Bob wants to buy it so he calls the buyOrder
function.
Alice sees the transaction in the mempool and immediately calls the amendSellOrder
frontruning bob and changing the amountToSell
to 1 (dust amount) and leaves the price to 3000e6 usdc.
The buyOrder
call passes and Bob pays the full price for some dust amount.
Add some coolDown period after the change of the price when no offers are accepted or some slippage protection -> let the buyers specify the amount they are willing to receive and if it doesn't match with the offer, cancel the transaction.
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.