Overview
A reentrancy attack is an exploit where a contract re-enters itself before state updates complete, draining funds. It was the vector of the famous DAO hack. It exploits the order of state changes in contract execution.
How It Works
A malicious contract calls an external function that re-enters the victim contract before the victim updates its state. Repeated calls drain funds because balances are not updated until the end. Checks-effects-interactions and reentrancy guards prevent it.
Why It Matters
Reentrancy is one of the most dangerous smart contract vulnerabilities, causing major losses. Understanding it is essential for developers and auditors. Modern frameworks include built-in protections.
Related Concepts
Reentrancy Attacks relate to Smart Contract vulnerabilities and Audits. They are countered by coding patterns and guards.