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.
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:
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
- The owner calls setGlobalTax with a value just below 1000 (99.9%).
- The owner front-runs any addPool transaction in the mempool.
- 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.