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

Out-of-range Burve ranges strand collected fees; attacker deposits, pushes Uniswap price back into range to trigger compounding, then withdraws to capture accumulated fees.

- Payout: Audit contest
- Severity: high
- Program: Burve
- Found by: Aamirusmani1552
- Disclosed: 2025-04-17
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-04-burve-judging/issues/288
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-04-burve%3AH-5
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:chained vuln:business-logic vuln:oracle-manipulation

**Target:** Burve single-range vault / Uniswap V3 pool
**Root cause:** collectAndCalcCompound() cannot compound when only the wrong-side token is collected out of range, so fees sit idle until price re-enters range; a depositor just before re-entry captures them.
**Steps:**
1. Set Uniswap V3 tick at 100, Burve range 50-90 (out of range), fees: token0=0, token1=1000.
2. Attacker deposits into Burve while range still out of bounds.
3. Attacker swaps in underlying pool to push tick from 100 to ~85, re-entering Burve range.
4. Next collectAndCalcCompound() (triggered by withdraw) compounds the idle 1000 token1 into liquidity.
5. Attacker withdraws shares, inflated by the newly compounded fees.
**How found:** Observed that out-of-range positions hold only one token, so collectAndCalcCompound() computes near-zero liquidity from the wrong-side token; reasoned that fees accumulate idle until price re-enters range, creating a sniping window.
**Exploitation:** Attacker deposits before re-entry, manipulates Uniswap V3 price via swap to bring tick into Burve range, triggers compounding on withdraw, then exits with inflated share of previously idle fees.
**Insight:** When a vault only compounds fees conditionally (e.g. in-range), deposits made just before the condition flips capture all stranded fees; check whether range re-entry can be forced by swapping the underlying pool.

