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

  • Go

    Go: Programming Language for BlockchainGo is a programming language widely used for building blockchain infrastructure and cryptocurrency applications. It's like the construction language for digital money systems.Go (also called Golang) is a programming language developed by Google that's popular for blockchain development due to its performance, simplicity, and excellent concurrency support. Many major cryptocurrency projects use…

  • Network Upgrade

    Network Upgrade: Blockchain System ImprovementsNetwork upgrades implement improvements, fixes, or new features to blockchain protocols through coordinated changes across all network participants. It's like upgrading an entire city's infrastructure where everyone needs to follow the new traffic rules at the same time.Network upgrade refers to coordinated changes to blockchain protocol rules that enhance functionality, security,…

  • Phishing Attack

    Phishing Attack: How Scammers Steal Your Crypto Phishing attacks are the #1 way people lose crypto. Scammers create fake websites that look identical to real ones, then steal your login credentials and private keys. A phishing attack is a fraudulent attempt to obtain sensitive information by impersonating a trustworthy entity through fake websites, emails, or…

  • Regulation

    Regulation: Government Rules for CryptoCryptocurrency regulation involves government rules and oversight for digital assets, exchanges, and blockchain businesses. It's the ongoing battle between innovation and compliance.Regulation refers to government laws, rules, and oversight mechanisms that govern cryptocurrency activities, including trading, taxation, anti-money laundering compliance, and consumer protection. Regulatory approaches vary significantly between jurisdictions.How Crypto Regulation WorksLicensing…

  • Sybil Attack

    Sybil Attack: Fake Identity Manipulation Sybil attacks involve creating multiple fake identities to gain disproportionate influence in networks that assume one person equals one vote. It’s like stuffing the ballot box with imaginary voters. A Sybil attack is when an individual or entity creates multiple fake identities to gain unfair influence over a network, voting…

  • Chain Reorg (Reorganization)

    Chain Reorg (Reorganization): Blockchain History Changes Chain reorgs occur when a blockchain adopts a different version of transaction history, potentially reversing confirmed transactions. It’s like time travel, but messier and more expensive. A chain reorganization (reorg) happens when a blockchain network adopts an alternative chain of blocks as the canonical history, potentially reversing previously confirmed…