Skip to content
Business logic Audit finding Advanced

Attacker captures unclaimed fees by timing deposit with range re-entry and price manipulation

When Burve ranges are out of bounds relative to the Uniswap V3 pool, collected fees in the wrong-side token cannot be compounded, so they sit idle. An attacker can deposit just before the price re-enters the range, then withdraw after compounding, capturing a disproportionate share of those accumulated fees.

Aamirusmani1552 Follow with bladeee, cccz and 2 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-burve-judging/issues/288

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

Aamirusmani1552, bladeee, cccz, future, mstpr-brainbot

Summary

Whenever users deposit into or withdraw from Burve, the associated fees are collected and redistributed back into the ranges according to their weights. However, if the current Burve ranges are out of bounds relative to the underlying Uniswap V3 pool—and the collected amounts don't meet the minimum liquidity criteria for out-of-range deposits—then no liquidity is compounded. This state persists until the market moves back within the Burve-defined ranges.

An attacker can exploit this by depositing into Burve just before the market re-enters the Burve ranges, then withdrawing shortly after. By sandwiching this moment, the attacker effectively collects a disproportionate share of the accumulated fees.

Root Cause

Assume Burve has a single range that is currently out of range in the underlying Uniswap V3 pool. In this case, only one token—either token0 or token1, depending on the direction the range is out of—will be needed to add liquidity.

In the function collectAndCalcCompound(), if only one token is collected, or if the collected token amount is small enough that dividing it by amountInUnitLiqX64 results in 0 or a very low value, then the nominal liquidity to be compounded will also be very small—since it's based on the lesser of the two token-derived values.

Once the price in the underlying pool moves back into the Burve-defined range, the other token becomes usable for liquidity provision. An attacker can front-run this moment by depositing into Burve shortly before the range comes back into play—potentially even forcing this through swaps in the underlying pool.

As a result, when collectAndCalcCompound() is triggered again(by the withdraw function) and both token amounts are usable, the compounded liquidity will be much higher. The attacker can then immediately withdraw, capturing a disproportionate share of the previously accumulated fees.

Internal Pre-conditions

None needed

External Pre-conditions

  1. Underlying pool tick is out of range for all Burve ranges and there are accumulated fees on the other token (the token that is not wanted to add liquidity at current out of range position)

Attack Path

Assume the current Uniswap V3 pool tick is at 100, while Burve has a single active range set between ticks 50–90. Since the range is out of bounds, the position is not earning any liquidity fees. As a result, all of the position's value is held in a single token. In this scenario, only token0 is required to add liquidity.

Now, assume the following state in Burve’s vault in fees:

  • token0 collected: 0
  • token1 collected: 1000

Because the Burve range is currently out of range, any deposit or withdrawal will not trigger fee compounding. This happens for reasons explained earlier: the collectAndCalcCompound() function cannot add liquidity when it only has the wrong-side token (here, token1) available.

This creates a situation where 1000 token1 is effectively "stuck" in the contract—it won't be converted into liquidity until the underlying pool's price moves back into Burve's specified range (50–90).

An attacker can exploit this by:

  1. Depositing liquidity into Burve while the range is still out of bounds.
  2. Pushing the Uniswap V3 price down into Burve’s tick range (e.g., from tick 100 to 85) by initiating a large swap.
  3. Once the pool price re-enters the Burve range, the next collectAndCalcCompound() call will succeed. This time, the previously idle 1000 token1 will be used to add real liquidity.
  4. The attacker then withdraws their shares from Burve. Because they entered just before compounding occurred, and now more liquidity was added, their share of the vault is inflated—they effectively captured the full benefit of the previously unclaimed 1000 token1.

This results in the attacker siphoning off previously accumulated fees that should have been distributed across all participants proportionally. It’s a type of fee-sniping sandwich attack.

Impact

As long as burve ranges are out of range and their accumulated fees on the other token which is always likely, the above attack is possible. Even it's not an attack, users depositing or withdrawing when the range is out of order will not receive fair results.

Additional note, burve ranges can not be changed. Its immutable so it makes the attack more viable and inevitable.

PoC

Described in attack path.

Mitigation

The best mitigation is to make sure the burve ranges are always in range. This can be achieved by adding a small weighted big range.

The original report as published on Sherlock, by Aamirusmani1552. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 fee compounding logic only uses the lesser of the two token amounts, so when only one token is available (out-of-range), compounding is skipped and fees accumulate until the range re-enters, allowing a depositor to capture them by timing.

Impact

The attacker could siphon off accumulated fees that should have been distributed proportionally, and even without an attack, users depositing or withdrawing when out of range may not receive fair results.

What the attacker needed

Burve ranges out of range; accumulated fees in wrong token; attacker can swap in underlying pool

The fix

The best mitigation is to ensure Burve ranges are always in range by adding a small weighted big range.

How it was found

  1. Deposit into Burve while the range is out of bounds.
  2. Push the Uniswap V3 price into Burve's tick range with a large swap.
  3. Trigger collectAndCalcCompound (e.g., via a withdrawal) so the idle fees are compounded.
  4. Withdraw shares to capture the inflated value.

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.

Burve is a system that manages liquidity in a Uniswap V3 pool. When its price range is outside the current market price, fees collected in the other token cannot be turned into liquidity and just sit in the contract. An attacker can time a deposit and withdrawal around the moment the price comes back into range to grab more than their fair share of those fees.

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 Aamirusmani1552

View all

3 more disclosed reports, best first.

More from Burve

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.