How Did the DAO Hack in 2016 Utilize a Reentrancy Attack?

The DAO (Decentralized Autonomous Organization) was a complex smart contract that allowed users to withdraw their funds. The attacker exploited a reentrancy vulnerability in the withdrawal function.

The function sent Ether to the user's address before updating their internal token balance. The attacker's contract, upon receiving the Ether, used its fallback function to recursively call the withdrawal function again.

Because the DAO's internal balance had not yet been updated, it repeatedly sent Ether for the same initial request, allowing the attacker to drain millions of dollars worth of ETH.

How Does a Reentrancy Attack Relate to the DAO Hack?
What Would Be the Vulnerable Code Structure That Violates the CEI Pattern?
Provide an Example of How Two Functions Might Share a State That Could Be Exploited
Why Is Updating State before an External Call the Critical Part of the CEI Pattern?
What Specific Code Vulnerability in the DAO Contract Allowed the Reentrancy?
What Is a “Re-Entrancy Attack” in Smart Contracts?
What Is a Reentrancy Attack in Smart Contract Security?
How Did the Ethereum Community Respond to the DAO Hack?

Glossar