Oracle Attack
What Is an Oracle Attack?
An oracle attack targets the data feeds that bring real-world information, typically asset prices, into a blockchain protocol.
Smart contracts cannot access external data on their own, so they rely on oracles to supply price information from exchanges. That price determines things like loan collateral values, liquidation thresholds, and trade execution.
When the feed is manipulated, the smart contract acts on false information. An attacker can then exploit this to borrow far more than their collateral is worth, trigger unfair liquidations, or drain a protocol’s reserves.
How Does an Oracle Attack Work?
The most common method is flash-loan-based price manipulation. An attacker borrows a large amount of capital without collateral, distorts the price of an asset on a thinly traded exchange, and then interacts with a protocol that reads from that same exchange.
The manipulated price lets the attacker extract value, and the flash loan is repaid in the same transaction. Some attacks work similarly on onchain automated market makers (AMMs), manipulating a liquidity pool price that a protocol uses as its oracle.
In most cases, the root failure is the same: a protocol trusts a data source that can be economically manipulated, or uses an onchain price that does not reflect a robust market value.
What Makes a Protocol Vulnerable?
Protocols that rely on a single, low-liquidity price source are most at risk. If an oracle draws its price from one exchange with limited trading volume, that price can be moved cheaply and quickly. Protocols without a time-weighted average price (TWAP) mechanism, which smooths prices over time to resist sudden spikes, are especially exposed.
A related but separate risk is governance compromise: a protocol that allows high-value configuration changes via a single key or weak multisig can be taken over before anyone responds. This is a distinct class of vulnerability, but both reduce to a single point of failure.