The OrderBook::emergencyWithdrawERC20
function allows the contract owner
to withdraw any token not explicitly blocked (i.e., not wETH, wBTC, wSOL, or USDC).
Order created using that token will enable owner to maliciously drain the seller’s funds from the contract.
Likelihood:
When the owner adds a new token as sellable and then maliciously withdraws a seller’s deposited tokens from the contract.
Impact:
Undermines the trust model and asset security for participants listing non-core tokens.
Owner can easily withdraw the non-core tokens in emergencies when orders are active for non-core tokens.
Introduce a separate mapping for allowed tokens and only permit emergency withdrawal for tokens not used in active or historical orders.
Make emergency withdrawal time-locked or permanently disabled once any order using a given token is created, ensuring full safety for user assets.
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.