How Does a Reentrancy Attack Specifically Exploit Smart Contract Logic?

A reentrancy attack occurs when an external call from Contract A to Contract B is made, and Contract B then calls back into Contract A before A has finished updating its state, specifically the balance. This allows the attacker to recursively withdraw funds multiple times from the victim contract before the initial withdrawal transaction completes and the balance is properly reduced.

The classic defense involves using the Checks-Effects-Interactions pattern to update the state before making external calls.

What Is a “Read-Only” Reentrancy Attack?
What Is a “Sandwich Attack” and How Does It Exploit the AMM Structure?
What Is Reentrancy and Why Is It a Critical Smart Contract Vulnerability?
What Is a “Re-Entrancy Attack” and Why Is It a Common Smart Contract Vulnerability?
How Do Gas Limitations Prevent Reentrancy in Some Cases?
What Are the Differences between Single-Function and Cross-Function Reentrancy Attacks?
What Is a ‘Reentrancy Attack’ and How Does It Exploit Smart Contract Logic?
What Is a Reentrancy Attack in Smart Contract Security?

Glossar