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.
Originally disclosed on Code4rena
Submitted by csanuragjain, also found by cccz
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
- Owner call add function and uses lpToken as A
- Owner again call add function and mistakenly provides lpToken as A
- Now 2 pools will be created with lpToken as A
- 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.
I’m going to let this one stand. Multisigs make mistakes and it would be trivial to prevent this one.
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
- Owner calls add function with lpToken A.
- Owner calls add function again with the same lpToken A.
- Two pools are created with lpToken A.
- 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.