Smart Contract Reentrancy
Smart Contract Reentrancy is a vulnerability occurring when a contract calls an external, untrusted contract before it updates its own internal state, such as a user balance. An attacker can exploit this by creating a malicious contract that repeatedly calls back into the original function before the first execution completes.
This allows the attacker to drain funds by withdrawing more assets than they are entitled to because the original contract still believes the balance is unchanged. This flaw is a classic example of a logic error in state management.
It highlights the importance of using reentrancy guards and following the checks-effects-interactions pattern. It remains a significant threat in decentralized finance protocols handling asset transfers.