Picture this: You walk into a bank, borrow a billion dollars without collateral, use it to manipulate the stock market, profit handsomely, and repay the loan; all within the blink of an eye. This impossible scenario is the real-world equivalent of a Flash Loan attack.
Flash loans are a legitimate DeFi innovation allowing users to borrow massive sums without collateral, provided the loan is repaid within the same blockchain transaction. Attackers can exploit flash loans in four steps:
Fun Fact: The first major flash loan attack happened on the bZx lending platform in February 2020. An attacker brilliantly used a massive, uncollateralized flash loan to manipulate prices and profit $370,000 in a single, lightning-fast transaction.
This is an oldie but a notorious goodie, famously responsible for the infamous DAO hack in 2016. It led to the split of Ethereum into ETH and ETH Classic.
A reentrancy attack occurs when a smart contract calls another external contract before fully updating its own internal state. A loop is created if the external (malicious) contract can then call the original contract again before the first call is finished and balances are updated. The attacker can repeatedly withdraw funds, draining the contract dry before it realizes the money is gone. It's like a faulty ATM that dispenses cash but doesn't deduct from your balance until the end of the day, allowing you to withdraw repeatedly.
Many DeFi protocols rely on "oracles," i.e., third-party services that feed real-world data like asset prices into smart contracts. If an attacker can corrupt this data, they can trick the smart contract into making bad decisions. Attackers might feed incorrect data to a centralized oracle or manipulate a single, low-liquidity DEX pool that a protocol uses as its sole price source.
Once the oracle provides a false price, the attacker can exploit lending platforms to borrow against overvalued collateral, trigger unfair liquidations, or execute trades at manipulated prices, all at the expense of the protocol and its users.
These are perhaps the most heartbreaking, as they directly target unsuspecting investors. A rug pull happens when the developers of a new crypto project suddenly abandon it. They typically withdraw all the liquidity from a decentralized exchange pool and leave investors with worthless tokens.
The most common form of rug pulls is liquidity removal, where developers remove the funds that were paired with their newly created token. Some other forms of exit scams include dumping and malicious code.
In general, these scams often involve aggressive marketing, anonymous teams, and unrealistic promises of sky-high returns.
While not always a "hack" in the traditional sense, Maximal Extractable Value (MEV) allows blockchain validators or sophisticated bots to profit by strategically ordering transactions within a block.
Imagine you place a large buy order for a token, expecting its price to go up. A "front-running" bot might detect your pending transaction, execute its own buy order before yours, wait for your large order to push the price up, and then immediately sell for a profit. This causes slippage for legitimate users and can subtly drain value over time.