Skip to content
Access control Audit finding Beginner

CRITICAL: Access Control Bypass in Fee Management

Several administrative functions in the market controller were guarded by the matcher role rather than the owner role, so any authorised matcher could change the fee rate, redirect the treasury address or pause trading globally. A malicious matcher could therefore take effective control of key system parameters.

0xsupremedev Follow with 0xv1bh4, 8olidity and 47 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-10-index-fun-order-book-contest-judging/issues/2

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

0xsupremedev, 0xv1bh4, 8olidity, Almanax, AzeezMH, Bbash, DharkArtz, ExtraCaterpillar, Harsh, Ibukun, JuggerNaut, Marketer7, Meta_Bug, Olugbenga-ayo, PUSH0, PowPowPow, PratRed, RajeshKotaru, SiddiqX7860, Sir_Shades, SuperDevFavour, TECHFUND-inc, Valy001, Waydou, Whiterabbit, Wojack, aguamonkey, al0x23, axelot, bughunter442, coin2own, dray, engineer, fresh, gneiss, grigorovv17, kkkkkk, la-arana-inteligente, makeWeb3safe, nodesemesta, peazzycole, richi, rj_eth26, sabby, slavina, theholymarvycodes, tinnohofficial, udo, vivekd, watsonclyde

Vulnerability Summary

File: MarketController.sol
Lines: 212, 226, 241, 263, 278, 302, 313
CVSS Score: 9.1
Severity: CRITICAL

Description

Critical administrative functions use onlyAuthorizedMatcher instead of onlyOwner, allowing any authorized matcher to manipulate system parameters.

Code Snippet

Solidity
function setFeeRate(uint256 _feeRate) external onlyAuthorizedMatcher { // WRONG MODIFIER
    require(_feeRate <= MAX_FEE_RATE, "Fee rate exceeds maximum");
    uint256 oldRate = feeRate;
    feeRate = _feeRate;
    emit FeeRateUpdated(oldRate, _feeRate);
}

function setTreasury(address _treasury) external onlyAuthorizedMatcher { // WRONG MODIFIER
    require(_treasury != address(0), "Invalid treasury address");
    address oldTreasury = treasury;
    treasury = _treasury;
    emit TreasuryUpdated(oldTreasury, _treasury);
}

function setGlobalTradingPaused(bool paused) external onlyAuthorizedMatcher { // WRONG MODIFIER
    globalTradingPaused = paused;
    emit GlobalTradingPauseChanged(paused);
}

Impact

  • Matchers can set fees up to 10% maximum
  • Matchers can redirect treasury funds to any address
  • Matchers can pause/resume all trading globally
  • Complete system control by malicious matchers

Recommended Fix

Solidity
function setFeeRate(uint256 _feeRate) external onlyOwner { // CORRECT MODIFIER
    require(_feeRate <= MAX_FEE_RATE, "Fee rate exceeds maximum");
    uint256 oldRate = feeRate;
    feeRate = _feeRate;
    emit FeeRateUpdated(oldRate, _feeRate);
}

function setTreasury(address _treasury) external onlyOwner { // CORRECT MODIFIER
    require(_treasury != address(0), "Invalid treasury address");
    address oldTreasury = treasury;
    treasury = _treasury;
    emit TreasuryUpdated(oldTreasury, _treasury);
}

function setGlobalTradingPaused(bool paused) external onlyOwner { // CORRECT MODIFIER
    globalTradingPaused = paused;
    emit GlobalTradingPauseChanged(paused);
}

Verification

This vulnerability was confirmed through manual code review and automated static analysis.

The original report as published on Sherlock, by 0xsupremedev. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The administrative setter functions were declared with the matcher authorisation modifier instead of the owner modifier.

Impact

A malicious matcher could raise fees up to the 10% cap, redirect treasury funds to any address and pause or resume all trading, giving them complete system control.

What the attacker needed

An authorised matcher role

The fix

The functions should be restricted with the owner modifier instead of the matcher modifier, though the team has said it will not be fixed at this time.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract has roles that decide who may call which function. Here, functions meant only for the top-level owner were left open to a lower role, the matchers, so those users could change fees, send collected fees to a different address, or stop all trading. The team acknowledged the issue but chose not to fix it.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Index Fun Order Book

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.