# flash loan oracle manipulation enables price feed attacks against defi protocols
By atomically borrowing large capital through flash loans, an attacker can skew spot prices that on-chain oracles report, causing downstream protocols to misprice assets within a single transaction. This produced $33.8M in 2024 losses. Protocols relying on single-block spot price calculations (such as Uniswap pair reserves) rather than time-weighted average prices (TWAPs) are most vulnerable.
The most common vector is [[AMM spot prices are manipulable within a single transaction making them unsafe as oracle price feeds without TWAP smoothing|AMM spot price manipulation]] — the attacker borrows a large amount via flash loan, swaps to move the AMM price, then exploits any protocol using that AMM price as an oracle. This is distinct from but complementary to direct oracle feed compromise.
The attack is self-funding — no capital at risk — making the barrier to exploitation extremely low relative to the potential payoff. Since [[frontrunning exploits public mempool visibility to insert competing transactions before profitable pending operations]], flash loan attacks and frontrunning often combine — an attacker can observe a large trade in the mempool, frontrun it with a flash-loan-funded manipulation, and extract value from the price impact.
Flash loan oracle manipulation also enables [[low-participation governance votes enable protocol parameter manipulation through flash loan voting power|flash loan governance attacks]] — borrowing governance tokens to vote on parameter changes within a single transaction. In the lending protocol context, the March 2020 "Black Thursday" event showed how oracle failure during extreme volatility leads to [[bad debt accumulation in lending protocols occurs when liquidations fail to clear underwater positions during extreme market events|bad debt accumulation]] — MakerDAO suffered $4.5M in under-collateralized liquidations when oracle prices failed to keep pace with ETH's 40% crash.
Two named high-value incidents expand the scope of this vulnerability class:
**UwU Lend ($23M, June 2024):** An Aave v2 fork using Curve's `get_p()` spot prices in 5 of 11 sUSDE oracle feeds. The attacker coordinated $3.796 billion in flash loans across seven protocols simultaneously — one of the largest flash loan operations in DeFi history — to suppress and then inflate sUSDE's oracle-reported price, extracting $23M across three transactions in six minutes. Since [[Curve pool spot prices from get_p() are explicitly documented as manipulable and using them as oracle feeds in lending protocols enables median-manipulation attacks via coordinated flash loans]], the Peckshield audit's explicit exclusion of oracle review from scope left this vulnerability unexamined.
**Mango Markets ($114M, October 2022):** An important distinction — the Mango exploit did not use flash loans. Avraham Eisenberg used $4M in actual capital to buy MNGO spot tokens across three exchanges, moving the price from $0.02 to $0.91 (2,300%) in ten minutes on an extremely illiquid token. This demonstrates that flash loans are not required for oracle manipulation when the target token has thin enough liquidity — real capital purchases can be sufficient. Eisenberg then borrowed $116M against the inflated unrealized PnL collateral. For a full analysis see [[the Mango Markets exploit demonstrated that thin-liquidity oracle manipulation combined with unrealized PnL as collateral enables full protocol drain through controlled spot price inflation]].
Flash loan scale has grown dramatically: the UwU Lend $3.796B coordinated flash loan shows that manipulation capital is no longer bounded by attacker resources — only by protocol liquidity.
---
Relevant Notes:
- [[AMM spot prices are manipulable within a single transaction making them unsafe as oracle price feeds without TWAP smoothing]] — the most common oracle being manipulated via flash loans
- [[Curve pool spot prices from get_p() are explicitly documented as manipulable and using them as oracle feeds in lending protocols enables median-manipulation attacks via coordinated flash loans]] — extends: UwU Lend is the canonical Curve oracle manipulation case
- [[the Mango Markets exploit demonstrated that thin-liquidity oracle manipulation combined with unrealized PnL as collateral enables full protocol drain through controlled spot price inflation]] — extends: Mango shows oracle manipulation without flash loans via thin-liquidity spot purchases
- [[read-only reentrancy exploits view functions to cause other protocols to read inconsistent state]] — a related pattern that also exploits stale protocol data
- [[frontrunning exploits public mempool visibility to insert competing transactions before profitable pending operations]] — flash loan manipulation and frontrunning frequently combine as MEV extraction strategies
- [[low-participation governance votes enable protocol parameter manipulation through flash loan voting power]] — flash loans applied to governance token voting
- [[bad debt accumulation in lending protocols occurs when liquidations fail to clear underwater positions during extreme market events]] — Black Thursday demonstrated oracle failure leading to under-collateralized liquidations
- [[oracle manipulation and flash loan attacks are invisible to single-contract analysis tools because the attack surface spans multiple systems and operates at the economic layer]] — extends: no static analysis tool detects that a protocol's oracle can be manipulated within a single transaction because the attack operates at the economic layer, not the code pattern layer
- [[automated security tooling reliably detects code-level flaws but structurally misses design-level economic and cross-system vulnerabilities that dominate high-value exploits]] — extends: flash loan oracle manipulation is the canonical example of a cross-system economic attack that falls outside all automated tooling scope
Topics:
- [[vulnerability-patterns]]
- [[protocol-mechanics]]