In normal operation, a buyer reads an order's amountToSell
and priceInUSDC
off-chain, and expects to buy that exact amount of tokens at that price.
However, the seller can call amendSellOrder()
before buyOrder()
is executed, modifying amountToSell
or priceInUSDC
without buyer consent. This creates a slippage risk, where the buyer may overpay or receive fewer tokens than expected.
Likelihood:
Sellers can amend their orders at any time before a buyer fills it.
Buyers relying on off-chain reads cannot guarantee the state hasn’t changed by the time their transaction is mined.
Impact:
Buyer receives fewer tokens than expected, losing value.
Buyer pays more USDC than intended, enabling a griefing or front-running scenario.
1) User see the order in the website app ui. For example
"500 wETH against 1000 USDC"
2) User submits the transaction on-chain through l'UI
3) While the transaction is on the mempool, the seller changes the amount, for ex. 1 wETH against 1000 USDC"
4) When the first transaction is taken by a validor, the amount in wETH is now 1. As a result, the user will pay 1000 USDC for only 1 wETH.
Add two supplementary paramters in the function buyOrder: uint256 expectedAmountToSell, uint256 expectedPriceInUSDC.
In the function, check if their value match the value inside the order, otherwise revert.
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.