OrderBook

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

Owner Can Arbitrarily Control Token Allowances `OrderBook::setAllowedSellToken` function

Root + Impact

Description

The `setAllowedSellToken()` function allows the owner to arbitrarily enable or disable any token for trading without restrictions or governance mechanisms. This creates a single point of failure where the owner can manipulate the market by controlling which tokens can be traded.
//@audit Owner can disable WETH trading at any time
@> function setAllowedSellToken(address _token, bool _isAllowed) external onlyOwner {
allowedSellToken[_token] = _isAllowed;
emit TokenAllowed(_token, _isAllowed);
}

Risk

Likelihood:

  • Owner can immediately disable trading for any token, potentially causing

Impact:

- **High**: Owner can immediately disable trading for any token, potentially causing:
- Trapped liquidity for existing orders
- Market manipulation by selective token blocking
- Loss of user funds if tokens are disabled while orders are active
- Disruption of trading operations at any time

Proof of Concept

- Scenario: Users have active WETH orders worth millions
- Owner calls: `setAllowedSellToken(WETH_ADDRESS, false)`
- Result: No new WETH orders can be created, existing orders become harder to manage
//@audit Owner can disable WETH trading at any time
function setAllowedSellToken(address _token, bool _isAllowed) external onlyOwner {
allowedSellToken[_token] = _isAllowed;
emit TokenAllowed(_token, _isAllowed);
}

Recommended Mitigation

Implement a governance mechanism with voting for token allowance changes
Add a timelock for token allowance modifications
Require multi-signature approval for critical token operations
Consider making core tokens (WETH, WBTC, WSOL) permanently allowed and non-modifiable
Updates

Lead Judging Commences

yeahchibyke Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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