Flash Loan
A flash loan is a loan without collateral that is borrowed and repaid within one transaction. If the money is not returned by the end, the network reverts everything and the lender loses nothing. The tool is legitimate, but it is also used to attack DeFi protocols with very large sums.
How a flash loan works
A blockchain executes a transaction atomically: either every step succeeds or none does. Flash loans are built on this property and offered by protocols such as Aave. The borrower's smart contract receives the funds, performs a series of actions such as arbitrage between exchanges or swapping collateral, and at the end repays the loan with a small fee. If there is not enough balance to repay, the whole transaction rolls back and no money moves.
Legitimate uses include arbitrage, debt refinancing and liquidations. They let people without capital work with large amounts.
How flash loans are used in attacks
The loan itself does not break a protocol; it gives the attacker temporary capital. With it, they manipulate the price of a token in a pool that serves as a price source for another protocol (oracle manipulation), accumulate voting power in governance, or exploit a flaw in a contract's logic. After the attack the loan is repaid and the profit is kept.
Examples include the April 2022 attack on Beanstalk, where a flash loan gave temporary voting majority and around 182 million dollars were drained, and the March 2023 exploit of Euler Finance for roughly 197 million, much of which was later returned.
What it means for users
A user cannot prevent an attack on a protocol but can manage exposure: avoid holding large sums in little-known protocols without audits, prefer projects with protections against price manipulation and timelocks, and keep an eye on the permissions granted to contracts (approvals).
If your funds were lost to a protocol exploit, tracing is time-critical: part of the stolen money often lands on exchanges or crosses a cross-chain bridge. We perform blockchain analysis in such cases. The wider picture of risk is covered under DeFi.
Frequently Asked Questions
Is a flash loan a hack?
No. It is a legitimate tool. The attack is the use of a flash loan to exploit a flaw or manipulate a protocol.
Why does a flash loan need no collateral?
Because the transaction is atomic. If the amount is not repaid by the end, the whole transaction reverts and the lender does not lose money.
Can money be recovered after a DeFi protocol attack?
Sometimes. There can be negotiations with the hacker and a bounty for return, as well as freezes at exchanges and stablecoin issuers. The chances depend on speed and on tracing the route of the funds.