How Did the DAO Hack Use a Reentrancy Vulnerability?

In the 2016 DAO hack, the attacker exploited a reentrancy vulnerability in the withdrawal function. The attacker called the function to withdraw funds, and before the DAO's ledger was updated to reflect the withdrawal, the attacker's contract "re-entered" the withdrawal function, calling it again.

This process was repeated, allowing the attacker to drain a large amount of Ether from the DAO before the contract could update the balance. The vulnerability lay in the order of operations: the contract sent the funds before updating the internal state, a critical design flaw.

What Is a Reentrancy Attack in Smart Contract Security?
What Is Reentrancy and Why Is It a Critical Smart Contract Vulnerability?
How Did the DAO Hack Relate to Integer Overflow?
How Does a Reentrancy Attack Specifically Exploit Smart Contract Logic?
How Does a Reentrancy Attack Relate to the DAO Hack?
Could Modern DeFi Security Tools Have Prevented the DAO Hack?
Define a “Reentrancy Attack” in Smart Contracts
What Is a ‘Front-Running’ Attack in the Context of an Oracle Price Update?

Glossar