What Is a Reentrancy Attack in Smart Contract Security?
A reentrancy attack occurs when a malicious contract repeatedly calls a function in a vulnerable contract before the first function call has completed its state update. This allows the attacker to drain funds by continuously withdrawing assets before the contract's balance is correctly debited.
It is a critical security flaw often mitigated by using the Checks-Effects-Interactions pattern.