Burning does not update reserves
The burn function in the ConcentratedLiquidityPool contract sends out tokens but only reduces the reserves by the fee amounts, not the full token amounts. This leaves the pool's recorded reserves higher than its actual balance, causing subsequent mint and swap operations to fail or require users to pay extra tokens.
Submitted by cmichel, also found by 0xsanson, broccoli, and pauliax
The ConcentratedLiquidityPool.burn function sends out amount0/amount1 tokens but only updates the reserves by decreasing it by the fees of these amounts.
unchecked {
// @audit decreases by fees only, not by amount0/amount1
reserve0 -= uint128(amount0fees);
reserve1 -= uint128(amount1fees);
}
This leads to the pool having wrong reserves after any burn action. The pool’s balance will be much lower than the reserve variables.
Impact
As the pool’s actual balance will be much lower than the reserve variables, minting and swaping will not work correctly either. This is because of the amount0Actual + reserve0 <= _balance(token0) check in mint using a much higher reserve0 amount than the actual balance (already including the transferred assets from the user). An LP provider will have to make up for the missing reserve decrease from burn and pay more tokens.
The same holds true for swap which performs the same check in _updateReserves.
The pool essentially becomes unusable after a burn as LPs / traders need to pay more tokens.
Recommended Mitigation Steps
The reserve should be decreased by what is transferred out. In burn’s case this is amount0 / amount1.
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 burn function incorrectly subtracts only the fee amounts from the reserves instead of the full token amounts transferred out.
Impact
The pool's actual balance becomes much lower than the reserve variables, causing mint and swap to fail or require users to pay more tokens, making the pool essentially unusable after a burn.
What the attacker needed
None
The fix
The reserve should be decreased by the full amount transferred out, i.e., amount0 and amount1, not just the fees.
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.
In a liquidity pool, reserves track how many tokens the pool holds. When someone withdraws tokens (burns), the pool should reduce its recorded reserves by the amount withdrawn. Here, it only reduced them by the small fee portion, so the recorded reserves stayed too high. Later, when someone tries to add or swap tokens, the pool thinks it has more than it really does, so the checks fail and the pool becomes unusable.
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.