# CrvDepositorWrapper.sol relies on oracle that isn't frequently updated

CrvDepositorWrapper prices LP via a low-activity 20/80 WETH/BAL Balancer TWAP that updates rarely, causing stale pricing, failed distributes, and sandwich exposure.

- Payout: Contest reward
- Severity: medium
- Program: Aura Finance
- Credited: 0x52
- Disclosed: 2022-07-26
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-05-aura-findings/issues/115
- Library page: https://bugbountylibrary.com/r/c4%3A2022-05-aura%3AM-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** CrvDepositorWrapper.sol / Balancer OracleWeightedPool TWAP
**Root cause:** The wrapper derives LP value from a 20/80 WETH/BAL Balancer pool TWAP that only snapshots on state changes; with ~15 tx/day the oracle is frequently over an hour stale. Combined with a 2% pool fee, this yields inaccurate pricing and high slippage.
**Steps:**
1. Observe CrvDepositorWrapper.sol L56-L65 reads the 20/80 WETH/BAL pool TWAP for LP valuation.
2. Note Balancer OracleWeightedPool snapshots pool state only on state-changing ops (L156-L161).
3. Measure pool activity: ~15 transactions/day over 30 days, so oracle often stale >1 hour.
4. Because outputBps must be set low to avoid reverts from stale price + 2% fee, call `distribute` becomes sandwichable or reverts.
**How found:** Reading the wrapper's oracle dependency, then checking on-chain pool transaction frequency to establish the TWAP update cadence, and reasoning about the interaction between stale price, the 2% fee, and the required low outputBps slippage tolerance.
**Exploitation:** Attacker sandwiches the keeper's `distribute` call: with outputBps forced low to tolerate stale oracle pricing, the attacker moves the pool price around the distribute transaction to capture the slippage. Mitigated operationally via keeper + flashbots and minOut.
**Insight:** When a contract prices assets from a Balancer/Uniswap TWAP, check the source pool's actual on-chain tx frequency: low-activity pools make the oracle stale, and any slippage tolerance widened to accommodate that staleness becomes a sandwich surface.
