In a decentralized marketplace, a buyer typically reads order details (including price) off-chain and then submits a transaction to execute the trade. The expected behavior is that the trade executes at the exact price the buyer agreed to.
However, in the original buyOrder()
implementation, there was no check to validate the current on-chain price against what the buyer expected. This opens up a critical vulnerability: the seller can front-run the buyer by updating the price via amendSellOrder()
right before the buyer’s transaction is mined — causing the buyer to unknowingly pay more (or receive less).
Likelihood:
This happens when:
A buyer reads order data off-chain
Then the seller updates the price before the buyer's tx is mined
It is easier in a low-liquidity environment where one party controls both ends or monitors mempool activity.
Impact:
Buyers may overpay or get worse terms than expected
Loss of trust in the protocol
Potential financial losses to users
Cannot defend against mempool sniping or sandwiching
Add a price check in buyOrder()
:
This ensures that the price seen by the buyer off-chain matches the price stored on-chain at the time of trade execution.
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.