Flash Loan Attack Mechanics
Flash loan attack mechanics involve the exploitation of a protocol's logic by taking out a massive, uncollateralized loan that must be repaid within the same transaction block. Because the loan is instantaneous and requires no upfront collateral, attackers can use the borrowed capital to manipulate prices on decentralized exchanges or trigger liquidations in lending protocols.
If the profit from the exploit exceeds the cost of the loan and the transaction fees, the attacker can successfully drain funds from the target protocol. These attacks highlight the importance of using decentralized, time-weighted average prices instead of spot prices for protocol operations.
They also demonstrate the vulnerability of protocols that do not account for the possibility of large, instantaneous capital shifts. Defending against these attacks requires robust code design and the implementation of safeguards that prevent price manipulation.
It is a prominent example of how programmable money creates new, unique attack vectors that traditional financial systems do not face.