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

  • Liquidity Pool

    Liquidity Pool: The Fuel That Powers DEX Trading Liquidity pools are why decentralized exchanges work. They’re shared pots of tokens that enable trading without traditional buyers and sellers. A liquidity pool is a collection of tokens locked in a smart contract that provides liquidity for decentralized trading. Instead of matching buy and sell orders, traders…

  • Proof of History

    Proof of History: Solana’s Time Innovation Proof of History creates a cryptographic timestamp that proves events occurred in a specific sequence. It’s like having an unforgeable clock built into the blockchain. Proof of History (PoH) is a consensus mechanism that creates a historical record proving that events occurred at specific moments in time. It uses…

  • Restaking

    Restaking: Double-Duty for Staked Assets Restaking allows already-staked cryptocurrency to secure additional networks and earn extra rewards. It’s like getting paid twice for the same job, but with twice the risk. Restaking is a mechanism that allows staked cryptocurrency to simultaneously secure multiple networks or protocols, earning additional rewards beyond the base staking yield. Validators…

  • Transaction Privacy

    Transaction Privacy: Protecting Financial InformationTransaction privacy involves keeping cryptocurrency transaction details confidential while maintaining network security and functionality. It's like having a private bank account in a transparent financial system.Transaction privacy refers to techniques and technologies that protect the confidentiality of cryptocurrency transaction details including amounts, participants, and transaction history. This enables financial privacy while maintaining…

  • Fraud Proof

    Fraud Proof: Detecting Invalid TransactionsFraud proofs are cryptographic evidence that demonstrate when invalid transactions or state changes have occurred. They're like mathematical receipts that prove someone broke the rules.Fraud proofs are cryptographic evidence that can demonstrate when invalid state transitions or transactions have occurred in blockchain systems. These proofs enable efficient verification and dispute resolution in…

  • Hash Rate

    Hash Rate: Network Security Measurement Hash rate measures how much computational power secures a blockchain network. Higher hash rates mean stronger security against attacks and manipulation. Hash rate is the total computational power used by miners to process transactions and secure a proof-of-work blockchain network. It’s measured in hashes per second – calculations attempting to…