In normal behavior, only core order book tokens (WETH, WBTC, WSOL, USDC) are protected from being withdrawn via the emergencyWithdrawERC20
function. Additionally, the contract allows the owner to add any arbitrary ERC20 token to the allowedSellToken
list using setAllowedSellToken
, enabling users to create orders with those tokens.
However, non-core tokens that are added to the allowed list are not protected from emergency withdrawal. This allows the owner to withdraw all user-deposited balances of any non-core allowed token at any time. This violates user expectations, as they may assume that any token marked as "allowed" is also safe from privileged withdrawal.
Likelihood: Low
This can occur when the owner adds a non-core token (e.g., a new ERC20) via setAllowedSellToken
and users begin interacting with it.
It is likely in protocols with active governance, token listings, or upgradability, where the token list changes dynamically.
Impact: Medium
Users may lose funds if they interact with allowed tokens that the owner later withdraws using the emergency function.
It undermines trust in the protocol's asset security, especially if the frontend or docs do not distinguish between core and non-core allowed tokens.
This test demonstrates that the contract owner can withdraw user-deposited funds of a non-core token that was allowed via setAllowedSellToken
, using the emergencyWithdrawERC20
function. Since these tokens are not protected like core tokens (e.g., wETH, wBTC, wSOL, USDC), user funds in such tokens can be drained, violating expected trust and fund safety.
the function should also block emergency withdrawals of any token marked as "allowed" in allowedSellToken
. This ensures that all tradable tokens, whether core or later added, are equally protected against owner misuse.
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.