# User can redeem more tokens by artificially increasing the chi accrual

Yield's chi oracle reads Compound exchangeRateStored, which a flash borrow inflates, letting a matured fyToken holder redeem more underlying than deserved.

- Payout: Audit contest
- Severity: medium
- Program: Yield
- Disclosed: 2021-07-23
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2021-05-yield-findings/issues/69
- Library page: https://bugbountylibrary.com/r/c4%3A2021-05-yield%3AM-04
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:flash-loan vuln:oracle-manipulation

**Target:** CompoundMultiOracle / FYToken redeem on Compound cToken exchange rate
**Root cause:** The chi oracle derives accrual from Compound's exchangeRateStored, which depends on totalBorrows and can be pushed up within a single transaction by a large borrow, so the oracle value is manipulable rather than time-weighted.
**Steps:**
1. Assume fyToken is matured.
2. In one transaction, deposit large collateral (flash-loaned or not) and borrow a large amount from Compound, inflating totalBorrows and thus exchangeRateStored.
3. Call `redeem` on FYToken to burn fyTokens at the inflated chi accrual.
4. Repay the Compound borrow in the same transaction.
**How found:** Recognized that exchangeRateStored is computed from totalBorrows, which a borrow can inflate, and traced that value into the chi oracle and FYToken redeem path.
**Exploitation:** Single-transaction flash borrow on Compound spikes exchangeRateStored; the inflated chi accrual is consumed by FYToken redeem, yielding more underlying per fyToken; borrow repaid same tx, attacker pays only gas.
**Insight:** When an oracle sources a rate from a lending market's exchangeRateStored, check whether totalBorrows/totalSupply can be moved atomically by borrow/repay or deposit/withdraw in the same tx; time-weight or TWAP such accumulators.

