Skip to content
Business logic Audit finding Intermediate

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.

broccoli Follow

Originally disclosed on Code4rena

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:

Recommended Mitigation Steps

Change positionId to incentiveId in the referenced lines of code.

sarangparikh22 (Sushi) confirmed but disagreed with severity

The original report as published on Code4rena, by broccoli. 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 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.

More by broccoli

View all

16 more disclosed reports, best first.

More from Sushi Trident contest phase 2

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.