Skip to content
Business logic Audit finding Intermediate

ConcentratedLiquidityPosition.sol#burn() Wrong implementation allows attackers to steal yield

WatchPug Follow

Originally disclosed on Code4rena

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

  1. Alice minted $10000 worth of liquidity with lower and upper tick set to 99 and 199;
  2. Alice accumulated $1000 worth of fee in token0 and token1;
  3. The attacker can mint a small amount ($1 worth) of liquidity using the same lower and upper tick;
  4. 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.

sarangparikh22 (Sushi) confirmed

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

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.

More by WatchPug

View all

197 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.