Reentrancy Attack

Reentrancy Attack: Exploiting Function Recursion

Reentrancy attacks exploit smart contracts by repeatedly calling functions before previous executions complete. It’s like withdrawing money from an ATM that forgets to update your balance between transactions.

A reentrancy attack is a smart contract exploit where malicious contracts repeatedly call vulnerable functions before state changes are finalized, potentially draining funds or manipulating contract behavior. These attacks exploit the order of operations in smart contract execution.

How Reentrancy Attacks Work

Recursive calling involves malicious contracts that call back into vulnerable functions during the execution of those same functions, before state updates complete.

State manipulation occurs when contracts check balances or conditions that haven’t been updated yet, allowing attackers to perform actions multiple times.

Fund drainage happens when withdrawal functions can be called repeatedly before balance updates, enabling attackers to withdraw more than their actual holdings.

Reentrancy attack flow showing initial call, recursive callback, state inconsistency, and exploit completion

Real-World Examples

  • The DAO hack in 2016 used reentrancy to drain $60 million, leading to Ethereum’s hard fork
  • Various DeFi exploits have used reentrancy to steal millions from poorly secured protocols
  • Cream Finance lost $37 million to a reentrancy attack combined with other vulnerabilities

Why Beginners Should Care

Smart contract risk understanding helps evaluate protocol security and the importance of professional audits before using new platforms.

Prevention awareness shows why established protocols with battle-tested code tend to be safer than new, unaudited projects.

Recovery impossibility since blockchain transactions can’t be reversed, making prevention the only protection against reentrancy exploits.

Related Terms: Smart Contract, Smart Contract Audit, DeFi Security, Exploit

Back to Crypto Glossary

Similar Posts

  • Supply

    Supply: Total Token Quantity AvailableSupply refers to the total amount of cryptocurrency tokens available, including those in circulation, locked up, or held by various parties. It's a fundamental economic factor affecting token value.Supply encompasses all cryptocurrency tokens that exist or will exist, including circulating supply available for trading and locked supply held by teams, investors,…

  • Network Congestion

    Network Congestion: Blockchain Traffic JamsNetwork congestion occurs when cryptocurrency networks become overloaded with transaction requests, causing delays and increased fees. It's like rush hour traffic that slows everyone down and costs more to navigate.Network congestion refers to periods when cryptocurrency networks receive more transaction requests than they can process efficiently, resulting in delayed confirmations and…

  • Self-Custody

    Self-Custody: Direct Asset ControlSelf-custody means personally controlling your cryptocurrency private keys rather than trusting third parties to hold your assets. It's like keeping cash in your own safe instead of depositing it in someone else's bank account.Self-custody refers to the practice of personally maintaining control over cryptocurrency private keys and digital assets without relying on…

  • Lockup Period

    Lockup Period: Temporary Access RestrictionsLockup periods prevent token holders from selling or transferring their holdings for specified time frames. It's like having a certificate of deposit that you can't cash out early.A lockup period is a predetermined time frame during which cryptocurrency holders cannot sell, transfer, or access their tokens. These restrictions are typically enforced through…

  • Bot Trading

    Bot Trading: Automated Market ParticipationBot trading involves using automated software programs to execute cryptocurrency trades based on predetermined strategies and market conditions. It's like having a tireless assistant that trades for you around the clock.Bot trading refers to using automated software to execute cryptocurrency trades, monitor markets, and implement trading strategies without constant human supervision. These…

  • Smart Contract Risk

    Smart Contract Risk: Code-Based VulnerabilitiesSmart contract risk encompasses potential losses from bugs, exploits, or unexpected behavior in automated blockchain programs. It's like the risk that the software controlling your digital money might malfunction or be hacked.Smart contract risk refers to potential vulnerabilities, bugs, exploits, or failures in smart contract code that could result in loss…