Reentrancy Attack Vectors
Reentrancy attack vectors occur when a smart contract makes an external call to an untrusted contract before it has finished updating its own state. The malicious contract can then recursively call back into the original function, repeatedly executing it before the first execution has completed.
This can be used to drain funds, manipulate balances, or bypass security checks. This specific vulnerability became famous following the DAO hack, which resulted in a massive loss of funds.
To prevent reentrancy, developers use patterns such as the checks-effects-interactions model, which ensures that all internal state changes occur before any external calls are made. Additionally, mutex locks or reentrancy guards are commonly implemented to prevent a function from being re-entered while it is already in progress.
Understanding these attack vectors is fundamental to smart contract security, as they represent one of the most common and damaging ways that protocols are exploited.