The emergencyWithdrawERC20()
function should only allow withdrawal of accidentally sent tokens that are not part of the core protocol functionality, protecting all tokens that users have legitimately deposited for active trading orders.
The function only protects the four hardcoded immutable tokens (wETH, wBTC, wSOL, USDC) but fails to protect tokens in the dynamic allowedSellToken
mapping. This allows the owner to drain any whitelisted tokens that users have deposited for sell orders, even when those tokens are actively being used in the protocol.
The protection logic creates a mismatch:
Design: Contract supports dynamic token addition via setAllowedSellToken()
Protection: Only protects 4 specific hardcoded tokens
Gap: Whitelisted tokens used in active orders can be drained
Likelihood:
Owner has direct control over both setAllowedSellToken()
and emergencyWithdrawERC20()
Attack requires only standard owner privileges, no special conditions
Could happen accidentally or maliciously
High likelihood because it requires no external dependencies
Impact:
Complete loss of user funds for any newly whitelisted tokens
Orders become unfulfillable, breaking protocol functionality
Users lose deposited tokens with no recovery mechanism
Destroys trust in protocol security
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.