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

  • Rehypothecation

    Rehypothecation: Reusing Collateral Multiple Times Rehypothecation involves using the same collateral to back multiple obligations simultaneously. It’s like using your house as collateral for three different loans at the same time. Rehypothecation is the practice of using customer assets as collateral for the institution’s own borrowing or trading activities. In DeFi, this creates leverage and…

  • Tokenization

    Tokenization: Converting Assets into Digital Tokens Tokenization transforms real-world assets into blockchain-based tokens that can be traded, divided, and managed digitally. It’s like turning everything into tradeable game pieces. Tokenization is the process of converting ownership rights to assets into digital tokens on a blockchain. This enables fractional ownership, easier trading, and programmable functionality for…

  • Token Burn

    Token Burn: Destroying Supply for Value Token burns permanently remove cryptocurrency from circulation by sending it to addresses where it can never be recovered. It’s digital deflation in action. Token burn is the permanent removal of cryptocurrency tokens from circulation by sending them to an unusable address or smart contract that destroys them. This reduces…

  • Decentralized Computing

    Decentralized Computing: Distributed Processing PowerDecentralized computing distributes computational tasks across networks of independent computers rather than relying on centralized data centers. It's like having a supercomputer made of everyone's spare processing power.Decentralized computing refers to distributed systems where computational tasks are processed across multiple independent nodes rather than centralized servers or data centers. This creates more…

  • Team Incentives

    Team Incentives: Aligning Development with SuccessTeam incentives structure compensation and motivation for cryptocurrency project developers and founders. They align team interests with long-term project success rather than short-term gains.Team incentives refer to compensation structures that motivate project teams to work toward long-term success rather than quick profits. These typically include token allocations with vesting schedules and…

  • DeFi Primitives

    DeFi Primitives: Basic Building BlocksDeFi primitives are fundamental financial functions like lending, borrowing, and trading that serve as building blocks for more complex decentralized finance applications. They're like Lego blocks for financial services.DeFi primitives refer to basic financial functions implemented as smart contracts that can be combined to create more complex financial products and services. These…