Skip to content
Business logic Audit finding Intermediate

Rewards get diluted because totalAllocPoint can only increase.

The MasterChef contract lacks a way to remove pools or reduce their allocation points, so totalAllocPoint only increases. This dilutes rewards for active pools, causing stakers to receive less than expected while unused pools still accrue rewards.

throttle Follow

Originally disclosed on Code4rena

Submitted by throttle

MasterChef.sol

There is no functionality for removing pools/setting pool’s allocPoints. Therefore totalAllocPoint only increases and rewards for pool decreases.

Proof of Concept

Scenario:

  1. Owner adds new pool (first pool) for staking with points = 900 (totalAllocPoint=900).
  2. 1 week passes.
  3. First pool staking period ends (or for other reasons that pool is not meaningfully anymore).
  4. Owner adds new pool (second pool) for staking with points = 100 (totalAllocPoint=1000).
  5. 1 block later Alice stake 10 tokens there (at the same time).
  6. 1 week passes.
  7. After some time Alice claims rewards. But she is eligible only for 10% of the rewards. 90% goes to unused pool.

Recommended Mitigation Steps

Add functionality for removing pool or functionality for setting pool’s totalAllocPoint param.

ryuheimat (Concur) confirmed

Alex the Entreprenerd (judge) decreased severity to Medium and commented:

While the problem can seem trivial, the warden has proven that the contract can over time end up leaking excess value as any additional pool will dilute the totalAllocPoint and old pools cannot be retired.

The sponsor also confirms.

I believe the finding to be valid, but because the leak is contingent on settings, I believe Medium Severity to be more appropriate.


The original report as published on Code4rena, by throttle. 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 contract has no function to remove pools or decrease their allocation points, so totalAllocPoint can only grow.

Impact

Over time, rewards can be diluted for active pools, causing stakers to receive less than expected; the judge noted the leak is contingent on settings and rated it Medium.

What the attacker needed

Owner adds multiple pools over time; No pool removal or point adjustment

The fix

Add functionality to remove pools or to set a pool's allocation points so totalAllocPoint can be adjusted.

How it was found

  1. Owner adds first pool with 900 points (totalAllocPoint=900).
  2. One week passes.
  3. First pool's staking period ends or becomes unused.
  4. Owner adds second pool with 100 points (totalAllocPoint=1000).
  5. One block later Alice stakes 10 tokens in the second pool.
  6. One week passes, Alice claims rewards but gets only 10% because 90% goes to the unused first pool.

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 staking contract, rewards are split between pools based on points. If you can only add points and never remove them, old unused pools keep getting a share, so new stakers get less. This report shows that missing a way to reduce points leads to unfair reward distribution.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by throttle

View all

5 more disclosed reports, best first.

More from Concur Finance contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.