Wrong usage of positionId in ConcentratedLiquidityPoolManager
The ConcentratedLiquidityPoolManager contract uses positionId instead of incentiveId when looking up incentives in the subscribe, getReward, and claimReward functions. This causes the wrong incentive to be used or the transaction to revert because the incentive is not found.
Submitted by broccoli, also found by 0xsanson, cmichel, hickuphh3, and pauliax
Impact
In the subscribe function of ConcentratedLiquidityPoolManager, the incentive to subscribed is determined as follows:
Incentive memory incentive = incentives[pool][positionId];
However, positionId should be incentiveId, a counter that increases by one whenever a new incentive is added to the pool. The usage of positionId could cause the wrong incentive to be used, and in general, the incentive is not found, and the transaction reverts (the condition block.timestamp < incentive.endTime is not met). The getReward and claimReward functions have the bug of misusing positionId as the index of incentives.
Proof of Concept
Referenced code:
- ConcentratedLiquidityPoolManager.sol#L68
- ConcentratedLiquidityPoolManager.sol#L87
- ConcentratedLiquidityPoolManager.sol#L105
Recommended Mitigation Steps
Change positionId to incentiveId in the referenced lines of code.
sarangparikh22 (Sushi) confirmed but disagreed with severity
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 code uses positionId as the index for the incentives mapping instead of the correct incentiveId counter.
Impact
The wrong incentive could be used, or the transaction reverts because the incentive is not found, affecting subscribe, getReward, and claimReward.
What the attacker needed
None
The fix
Change positionId to incentiveId in the referenced lines of code.
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.
This smart contract manages rewards for liquidity providers. It mistakenly uses the position identifier to find the reward instead of the reward's own identifier, so users may get the wrong reward or the transaction fails.
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.