Skip to content
Access control Audit finding Intermediate

Centralisation Risk: Owner may abuse the tax rate to claim 99.9% of pools

The contract owner can set the global tax rate up to 99.9%, and can front-run pool creation transactions so new pools are created with that high tax rate. This lets the owner claim nearly all rewards from future pools.

AuditsAreUS Follow

Originally disclosed on Code4rena

Submitted by AuditsAreUS, also found by leastwood, pedroais, and reassor

It is possible for the owner to increase the tax rate to 99.9% in setGlobalTax().

The impact of this is that any future pools will be required to pay 99.9% of their rewards in tax to the globalBeneficiary.

It is possible for the globalBeneficiary to modify this and front-run any transactions in the mem-pool which call addPool(). These transactions will succeed and create pools with the 99.9% tax rate.

Proof of Concept

The cap for the tax rate is 1000 = 100%.

    function setGlobalTax(uint newTaxPerCapita) external {
        require(msg.sender == globalBeneficiary, 'Only globalBeneficiary can set tax');
        require(newTaxPerCapita < 1000, 'Tax too high');
        globalTaxPerCapita = newTaxPerCapita;
    }

Recommended Mitigation Steps

It is recommended to put some reasonable upper bounds on the tax rate. Consider setting the upper bounds for the tax rate to 5%.

illuzen (FactoryDAO) confirmed and resolved:

https://github.com/code-423n4/2022-05-factorydao/pull/2


The original report as published on Code4rena, by AuditsAreUS. 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 tax rate has no reasonable upper bound, allowing the owner to set it to 99.9%.

Impact

Future pools could be forced to pay 99.9% of their rewards as tax to the globalBeneficiary.

What the attacker needed

Owner is the globalBeneficiary; owner can front-run transactions

The fix

The tax rate should have a reasonable upper bound, such as 5%.

How it was found

  1. The owner calls setGlobalTax with a value just below 1000 (99.9%).
  2. The owner front-runs any addPool transaction in the mempool.
  3. The addPool transaction succeeds and creates a pool with the 99.9% tax rate.

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 an owner who can change a tax setting. The code only checks that the tax is below 100%, so the owner can set it to 99.9%. Because the owner can see pending transactions, they can change the tax just before a new pool is created, so that pool pays almost all its rewards to the owner.

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 AuditsAreUS

View all

9 more disclosed reports, best first.

More from FactoryDAO 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.