Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 1020

Reentrancy Attack

Reviewed byCybersecurity entrepreneur & security researcher

What is Reentrancy Attack?

Reentrancy AttackA smart-contract exploit where an external call lets the attacker re-enter the calling function before its state is updated, draining funds in a recursive loop.


Reentrancy happens when a contract makes an external call — sending ETH or tokens via call, or triggering an ERC-777/ERC-721 receive hook — before it has updated its own internal accounting. Because the attacker controls the receiving address, the callback re-enters the original function while the contract's stale balance still shows funds as available, and the withdrawal repeats recursively until the contract is emptied.

The canonical case is The DAO (June 2016): recursive splitDAO calls drained roughly 3.6 million ETH, prompting the contentious hard fork that split Ethereum from Ethereum Classic. The class stayed a leading loss category for years. On 30 July 2023, a malfunctioning reentrancy lock in Vyper compiler versions 0.2.15, 0.2.16 and 0.3.0 let attackers drain several Curve Finance-dependent pools (JPEG'd, Alchemix, Metronome and the CRV/ETH pool); gross losses were around $69M before white-hat recoveries cut the net figure to roughly $52M — the root cause was the compiler, not the DeFi code itself.

Variants include single-function, cross-function, cross-contract and read-only reentrancy (a view function returning stale state mid-transaction). Defences: the checks-effects-interactions pattern (update state before any external call), OpenZeppelin's ReentrancyGuard mutex, pull-payment withdrawal designs, and treating every external call as untrusted. The 2300-gas stipend of transfer/send once blunted reentrancy but is now discouraged after the EIP-1884/EIP-2929 gas repricing.

flowchart TD
  A[Attacker contract calls withdraw] --> B[Contract checks balance: funds available]
  B --> C[Contract sends ETH via low-level call]
  C --> D[Attacker fallback / receive triggered]
  D -->|re-enters before balance is updated| B
  B --> E[State updated too late - contract drained]
  D -.recursive loop.-> C

● Examples

  1. 01

    The DAO hack (June 2016) drained about 3.6 million ETH using recursive splitDAO calls.

  2. 02

    The Cream Finance 2021 hot-fix incident exploited cross-function reentrancy via ERC-777 callbacks.

● Frequently asked questions

What is Reentrancy Attack?

A smart-contract exploit where an external call lets the attacker re-enter the calling function before its state is updated, draining funds in a recursive loop. It belongs to the Web3 & Blockchain category of cybersecurity.

What does Reentrancy Attack mean?

A smart-contract exploit where an external call lets the attacker re-enter the calling function before its state is updated, draining funds in a recursive loop.

How do you defend against Reentrancy Attack?

Defences for Reentrancy Attack typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Reentrancy Attack?

Common alternative names include: Recursive call attack.

● Related terms

● See also