The reclaimIncentive function of ConcentratedLiquidityPoolManager does not update the rewardsUnclaimed variable after some rewards are reclaimed. Thus, an attacker could add an incentive with a corresponding token, such as DAI, and reclaim the incentive multiple times to drain all the DAI within the manager contract.
Handle
broccoli
Vulnerability details
Impact
The
reclaimIncentive
function ofConcentratedLiquidityPoolManager
does not update therewardsUnclaimed
variable after some rewards are reclaimed. Thus, an attacker could add an incentive with a corresponding token, such as DAI, and reclaim the incentive multiple times to drain all the DAI within the manager contract.Proof of Concept
Referenced code: ConcentratedLiquidityPoolManager.sol#L59-L60
Recommended Mitigation Steps
Subtract
incentive.rewardsUnclaimed
byamount
before the_transfer
(which prevents reentrancy attacks).