Normally, when a seller lists an order, the price and token amount are stored and visible to all.
A buyer can submit a transaction to buy at that listed price, assuming it will remain unchanged.
However, the contract allows the seller to call amendSellOrder() without restriction, updating the price or amount even after a buyer has already submitted their buy tx (still pending in the mempool).
This allows the seller to front-run the buyer’s transaction and change the order price, leading to unexpected reverts, DoS, or even user losses if the buyer is using an auto-bot or private RPC.
This shows that there is no lock or protection preventing a seller from updating the price at any time, including right before a buyer’s tx executes.
Likelihood:
This occurs when a seller monitors the mempool and detects a pending buyOrder() transaction.
Since amendSellOrder() has no restriction or lock mechanism, the seller can immediately increase the price or change the order before the buyer’s transaction confirms.
This becomes highly likely in production environments where bots or frontend wallets use public RPCs.
Impact:
Buyers experience unexpected transaction reverts, leading to gas loss and denial-of-service.
Opportunistic sellers can intentionally manipulate the order price after seeing large incoming buys, extracting more USDC or trapping front-running bots.
Creates a toxic market experience and opens the door for griefing attacks or malicious auction strategies.
Explanation:
This test simulates a frontrunning attack where a buyer (Dan) prepares a buyOrder() transaction based on a known order price of 180,000 USDC. While Dan’s transaction is pending in the mempool, the seller (Alice) amends the order and increases the price to 200,000 USDC. Since Dan only approved 190,000 USDC (believing that was more than enough), the transaction reverts unexpectedly.
This illustrates that sellers can manipulate listed orders after buyers have already submitted transactions, causing:
unexpected reverts
DoS for bot traders
potential fund mismanagement for unaware users
The test demonstrates how this vulnerability can be reproduced and the conditions under which it becomes exploitable.
Explanation:
The mitigation introduces a grace period after order creation, during which amendments are disallowed (e.g., 15 minutes). This delay reduces the attack window for frontrunning and helps ensure that once a buyer sees an order and acts on it, the terms remain stable.
Additionally, the following hardening strategies could be considered:
Nonce or signature binding: Require buyers to sign the order price+ID before execution to detect tampering.
Slippage protection on buyer side: Let buyers define acceptable max price changes during buyOrder() to auto-reject if price was amended.
This ensures predictable trading UX, mitigates mempool-based attacks, and aligns with best practices from modern DEXs and NFT marketplaces.
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.