Reentrancy Attack

Mechanism

A reentrancy attack occurs when a malicious contract exploits a flaw in the execution flow of a target smart contract. By initiating an external call to an untrusted contract before updating its internal state, the vulnerable protocol allows the attacker to repeatedly trigger a function, such as a withdrawal, within a single transaction. This iterative process drains funds from liquidity pools or collateral vaults before the initial balance reflects the depletion.