ConcentratedLiquidityPosition.sol#burn() Wrong implementation allows attackers to steal yield
Submitted by WatchPug
When a user calls ConcentratedLiquidityPosition.sol#burn() to burn their liquidity, it calls ConcentratedLiquidityPool.sol#burn() -> _updatePosition():
ConcentratedLiquidityPool.sol#L525 L553
The _updatePosition() function will return amount0fees and amount1fees of the whole position with the lower and upper tick and send them to the recipient alongside the burned liquidity amounts.
Proof of Concept
- Alice minted $10000 worth of liquidity with
loweranduppertick set to 99 and 199; - Alice accumulated $1000 worth of fee in token0 and token1;
- The attacker can mint a small amount ($1 worth) of liquidity using the same
loweranduppertick; - The attacker calls
ConcentratedLiquidityPosition.sol#burn()to steal all the unclaimed yield with the ticks of (99, 199) include the $1000 worth of yield from Alice.
Recommended Mitigation Steps
Consider making ConcentratedLiquidityPosition.sol#burn() always use address(this) as recipient in:
position.pool.burn(abi.encode(position.lower, position.upper, amount, recipient, unwrapBento));
and transfer proper amounts to the user.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity business logic bug in Sushi Trident contest phase 2. Code4rena made it public on 30 November 2021. Found in the 2021-09-sushitrident-2 audit contest (finding H-07).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.