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

  • Token Allocation

    Token Allocation: Distributing Digital AssetsToken allocation determines how cryptocurrency tokens are distributed among different stakeholders like teams, investors, and communities. It's the blueprint for who gets what in crypto projects.Token allocation refers to the distribution plan for cryptocurrency tokens among various stakeholder groups including development teams, early investors, community members, and ecosystem development funds. This distribution…

  • Token Approval

    Token Approval: Granting Spending PermissionToken approval allows smart contracts to spend tokens on behalf of users through explicit permission mechanisms. It's like giving someone permission to use your credit card with specific spending limits.Token approval is a mechanism that grants smart contracts permission to transfer specific amounts of tokens from user wallets without requiring signatures…

  • Cryptographic Proof

    Cryptographic Proof: Mathematical VerificationCryptographic proof provides mathematical certainty about the validity of information without revealing sensitive details. It's like proving you know a secret without actually telling anyone what the secret is.Cryptographic proof refers to mathematical techniques that verify the authenticity, integrity, or validity of information using cryptographic methods. These proofs enable trust and verification without…

  • Light Node

    Light Node: Efficient Blockchain ParticipationA light node participates in blockchain networks without storing the complete blockchain history. It's like having a summary of the news instead of keeping every newspaper ever published.A light node is a type of blockchain node that maintains network connectivity and basic verification capabilities without storing the complete blockchain history or…

  • Verifiable Credentials

    Verifiable Credentials: Tamper-Proof Digital DocumentsVerifiable credentials are digital documents that can be cryptographically verified without contacting the issuing authority. They're like diplomas that anyone can authenticate instantly.Verifiable credentials are digital documents that use cryptographic techniques to enable instant verification of authenticity without requiring contact with the issuing organization. These credentials enable trusted digital identity and qualification…

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