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

  • Verifiable Randomness

    Verifiable Randomness: Provably Fair Random NumbersVerifiable randomness provides cryptographically secure random numbers that can be independently verified for fairness. It's like having dice that everyone can mathematically confirm are not loaded.Verifiable randomness refers to random number generation systems that produce unpredictable outputs while providing cryptographic proofs that the randomness is fair and unbiased. This enables trustless…

  • Rarity

    Rarity: Scarcity-Based Value AssessmentRarity refers to how uncommon or scarce particular traits, items, or attributes are within collections or ecosystems. It's like having a rare baseball card that's valuable because few others like it exist.Rarity describes the relative scarcity of digital assets, particularly NFT traits or characteristics, that affects their perceived value and market pricing. Rarer…

  • Protocol Revenue

    Protocol Revenue: Earning from Network ActivityProtocol revenue refers to income generated by blockchain protocols through transaction fees, service charges, or other value capture mechanisms. It's like toll roads that collect fees from everyone who uses the infrastructure.Protocol revenue encompasses all income streams generated by blockchain protocols including transaction fees, service charges, governance fees, and other…

  • Session Keys

    Session Keys: Temporary Wallet Permissions Session keys provide temporary, limited permissions for applications to perform specific actions without exposing main wallet private keys. It’s like giving valet keys instead of your full car keys. Session keys are temporary cryptographic keys that grant limited permissions to applications for specific time periods or transaction types. They enable…

  • 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…

  • Dusting Attack

    Dusting Attack: Tracking Through Tiny Transactions Dusting attacks send tiny amounts of cryptocurrency to addresses to track user behavior and deanonymize transactions. It’s like sprinkling digital breadcrumbs to follow where people go. A dusting attack sends small amounts of cryptocurrency (dust) to many addresses to track users’ transaction patterns and potentially identify wallet owners. Attackers…