The emergencyWithdrawERC20
function is designed to prevent withdrawal of core order book tokens by checking against a hardcoded list of tokens (wETH, wBTC, wSOL, USDC) to protect funds that are part of active orders.
The function fails to account for newly added tokens that are allowed as sell tokens in the order book system, creating a vulnerability where these tokens can be withdrawn via the emergency function even when they are locked in active orders.
Likelihood:
This vulnerability will occur whenever new tokens are added to the order book system via setAllowedSellToken
and users create sell orders with these tokens
The owner can exploit this immediately after new tokens are added and users deposit funds through sell orders
Impact:
Loss of funds for users with active sell orders using newly added tokens
Broken order fulfillment mechanism preventing buyers from completing purchases
Complete compromise of the order book's integrity and user trust
Potential rug pull scenario enabling systematic extraction of user funds
This test demonstrates how the owner can extract user funds from newly added tokens that are locked in active orders:
Replace the hardcoded token check with a dynamic check using the existing allowedSellToken mapping to protect all tokens that can be part of active orders:
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.