Skip to content
Business logic Audit finding Intermediate

Duplicate LP token could lead to incorrect reward distribution

The add function in ConvexMasterChef does not check for duplicate lpToken addresses, allowing two pools to share the same lpToken. This causes lpSupply to be calculated incorrectly, leading to wrong reward distribution.

Anurag Jain Follow

Originally disclosed on Code4rena

Submitted by csanuragjain, also found by cccz

ConvexMasterChef.sol#L96

It was observed that add function is not checking for duplicate lpToken which allows 2 or more pools to have exact same lpToken. This can cause issue with reward distribution

In case of duplicate lpToken, lpSupply will become incorrect (ConvexMasterChef.sol#L160), hence rewards will be calculated incorrectly

Proof of Concept

  1. Owner call add function and uses lpToken as A
  2. Owner again call add function and mistakenly provides lpToken as A
  3. Now 2 pools will be created with lpToken as A
  4. This becomes a problem while reward calculation or updatePool function which uses pool.lpToken.balanceOf(address(this)). Since both pool have same lpToken so lpSupply will be calculated as same which is wrong. Since lpSupply defines the rewardRate so this directly impact reward calculation

Recommended Mitigation Steps

Add a global variable keeping track of all lpToken added for pool. In case of duplicate lpToken add function should fail.

0xMaharishi (Aura Finance) acknowledged, but disagreed with severity and commented:

Given the result of this would be a net negative to everyone (due to overall increased lp token supply) there doesn’t seem to be any incentive for anyone to do this. Considering that the owner is a distributed 4 of 7 multisig, i think it is an acceptable scenario.

LSDan (judge) commented:

I’m going to let this one stand. Multisigs make mistakes and it would be trivial to prevent this one.


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

Likely the add function lacks a check to prevent the same lpToken from being used in multiple pools.

Impact

Rewards could be distributed incorrectly because lpSupply is miscalculated, though the project team argued there is no incentive to exploit this and the owner is a multisig.

What the attacker needed

Owner privileges (multisig)

The fix

The add function should track all lpTokens in a global variable and reject any duplicate.

How it was found

  1. Owner calls add function with lpToken A.
  2. Owner calls add function again with the same lpToken A.
  3. Two pools are created with lpToken A.
  4. Reward calculation or updatePool uses pool.lpToken.balanceOf(address(this)), so lpSupply is the same for both pools, which is wrong.

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 lets the owner create reward pools, each tied to a token. The code never checks if the same token is added twice, so two pools can point to the same token. When rewards are calculated, the contract reads the token balance for each pool, but because both pools use the same token, the balance is counted twice, giving the wrong reward amounts.

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 Anurag Jain

View all

63 more disclosed reports, best first.

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