OrderBook

First Flight #43
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Owner Can Blacklist Sell Tokens at Any Time, Disrupting Order Creation

Summary

The setAllowedSellToken function allows the contract owner to blacklist any sell token at any time. While this does not freeze user funds (since users can always cancel their orders and withdraw tokens), it does prevent new orders from being created with the blacklisted token, disrupting user experience and market activity for that asset.

Vulnerability Details

function setAllowedSellToken(address \_token, bool \_isAllowed) external onlyOwner {
if (\_token == address(0) || \_token == address(iUSDC)) revert InvalidToken(); // Cannot allow null or USDC itself
allowedSellToken\[\_token] = \_isAllowed;
emit TokenAllowed(\_token, \_isAllowed);
}

lets the owner set any token as not allowed (_isAllowed = false). After blacklisting, users cannot create new sell orders for that token. However, users with existing orders can still cancel and withdraw their tokens, so funds are not permanently frozen.

Impact

  • Users cannot create new orders for a blacklisted token.

  • Existing orders for blacklisted tokens can still be cancelled, allowing users to withdraw their tokens.

  • No permanent loss or freezing of user funds, but trading for the blacklisted token is disrupted.

Proof of Concept (PoC)

  1. User creates a sell order for token X (e.g., wETH).

  2. Owner calls setAllowedSellToken(tokenX, false).

  3. User tries to create a new order for token X: transaction reverts.

  4. User with an existing order for token X can still call cancelSellOrder and withdraw their tokens.

Recommended Mitigation

  • Consider implementing a time delay or grace period before a token is blacklisted, allowing users to react.

  • Notify users of upcoming blacklists via events or off-chain services.

  • Consider using a decentralized governance process for blacklisting tokens, rather than a single owner.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 5 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.