The OrderBook::buyOrder
function lacks a check for OrderBook::allowedSellToken[order.tokenToSell]
, allowing buyers to purchase orders for tokens that have been disabled via OrderBook::setAllowedSellToken(_token, false)
. While OrderBook::createSellOrder
enforce the OrderBook::allowedSellToken
check, OrderBook::buyOrder
does not, enabling the fulfillment of existing orders for disabled tokens.
Buyers can purchase orders for COMPROMISED tokens ALREADY marked as disallowed, violating intended token restrictions. This undermines the Orderbook's integrity, potentially leading to invalid trades and risking user funds when compromised tokens are no longer supported.
Deploy the OrderBook contract with valid addresses for wETH, wBTC, wSOL, and USDC.
Alice creates a sell order for wETH via createSellOrder(address(iWETH), 1e18, 2500e6, 1 days), transferring 1 wETH to the contract.
Owner disables wETH by calling setAllowedSellToken(address(iWETH), false).
Dan calls buyOrder(orderId) to purchase Alice’s wETH order, which succeeds, transferring wETH to Dan and USDC to Alice.
Add this to test/TestOrderBook.t.sol
Add a check in OrderBook::buyOrder
to ensure the token is still allowed in OrderBook::allowedSellToken
.
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.