The OrderBook contract is vulnerable to Denial of Service (DoS) attacks where malicious sellers can create orders that appear valid but cannot be purchased. By deploying a contract that reverts when receiving USDC payments, attackers can create "zombie orders" that waste buyers' gas and pollute the order book with unbuyable orders.
The buyOrder
function transfers USDC to the seller without validating that the seller can receive the payment:
If order.seller
is a malicious contract that reverts on token receipt, the entire transaction fails.
Order must be created by a malicious contract address
Order must pass all validation checks (valid token, amount, price, deadline)
Order must appear attractive to potential buyers
Malicious seller contract must revert when receiving USDC
Attacker deploys a malicious contract that reverts on token receipt
Attacker creates orders using the malicious contract as seller
Legitimate buyers attempt to purchase the malicious orders
Market conditions make the malicious orders appear attractive
Deploy Malicious Contract: Attacker creates a contract that reverts on USDC receipt
Create Attractive Orders: Use malicious contract to create orders with appealing prices
Lock Tokens: Malicious contract deposits tokens to create seemingly valid orders
DoS Buyers: When buyers attempt to purchase, transactions fail due to seller revert
Waste Gas: Buyers lose gas fees on failed transactions
Pollute Order Book: Multiple unbuyable orders clutter the trading interface
Market Manipulation: Fake attractive prices may influence market perception
Gas Waste: Buyers lose gas fees on failed purchase attempts
Order Book Pollution: Unbuyable orders clutter the trading interface
User Experience Degradation: Frustration from failed transactions
Market Manipulation: Fake orders may distort price discovery
Protocol Reputation: Users may lose trust in the platform
Economic Attack: Systematic creation of fake orders can disrupt trading
Deploy malicious contract
Create order: 1 wETH for 800 USDC (attractive price)
Buyers see attractive order and attempt to purchase
All purchase attempts fail when trying to send USDC to malicious seller
Order remains active but unbuyable
Order creation succeeds (malicious contract can deposit wETH)
Order appears valid and attractive to buyers
All purchase attempts fail with revert
Order remains active, continuing to mislead buyers
Buyers waste gas on failed transactions
Implement Option 2 (Pull Payment Pattern) as it completely eliminates the DoS vector while ensuring sellers can always claim their payments.
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.