Skip to content
Access control Audit finding Beginner

Owner should be allowed to change feeManager

The setFeeManager function only allows the current feeManager to change itself, so once set, the owner cannot replace a malicious feeManager. A malicious feeManager could funnel funds away, and the owner would have no way to revoke that power.

Anurag Jain Follow

Originally disclosed on Code4rena

Submitted by csanuragjain

Once Fee Manager has been set initially by owner, then owner has no power to change it. Owner should be allowed to change fees manager in case if he feels current fee manager is behaving maliciously

Proof of Concept

  1. Observe the setFeeManager function and see that only feeManager is allowed to change it once set initially
function setFeeManager(address _feeM) external {
        require(msg.sender == feeManager, "!auth");
        feeManager = _feeM;
        emit FeeManagerUpdated(_feeM);
    }

Recommended Mitigation Steps

Change the setFeeManager function like below. Same can be done with other important functionality involving setArbitrator and setVoteDelegate

require(msg.sender == owner, "!auth");

jetbrain10 (veToken Finance) confirmed, but disagreed with severity

Alex the Entreprenerd (judge) commented:

I agree with the finding, the feeManager can also potentially funnel funds away so it’s best to allow governance to replace them if need be.

Due to the finding being tied to admin privilege, I agree with Medium Severity.


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

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 access control check in setFeeManager requires the caller to be the current feeManager instead of the owner, preventing the owner from updating the role after initial assignment.

Impact

A malicious feeManager could funnel funds away, and the owner would be unable to replace them.

What the attacker needed

FeeManager role already set; feeManager becomes malicious

The fix

The setFeeManager function should require the caller to be the owner instead of the feeManager, and the same change should be applied to setArbitrator and setVoteDelegate.

How it was found

  1. Observe the setFeeManager function and see that only feeManager is allowed to change it once set initially

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.

In a smart contract, certain roles control important actions. Here, the fee manager role can be set only by the fee manager itself after the first assignment, so the owner loses control. If that role turns malicious, it could redirect funds and the owner cannot replace 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 by Anurag Jain

View all

63 more disclosed reports, best first.

More from veToken Finance contest

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.