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

  • Capital Efficiency

    Capital Efficiency: Maximizing Resource UtilizationCapital efficiency measures how effectively investments generate returns relative to the amount of capital deployed. It's like getting the most miles per gallon from your investment fuel.Capital efficiency refers to maximizing returns or utility from invested capital through optimal allocation, leverage, or innovative strategies that reduce required capital while maintaining or…

  • Persistence

    Persistence: Maintaining Data Across TimePersistence refers to data storage that survives system restarts, crashes, or power failures. In blockchain, it ensures transaction history remains permanently accessible and unalterable.Persistence describes the characteristic of data storage systems that maintain information across system interruptions, ensuring data survives restarts, failures, or other disruptions. Blockchain networks achieve persistence through distributed storage…

  • Security

    Security: Protecting Digital Assets and InformationSecurity in cryptocurrency encompasses all measures taken to protect digital assets, private keys, and personal information from theft or compromise. It's the foundation that makes cryptocurrency ownership safe and reliable.Security refers to the comprehensive protection of cryptocurrency assets, private keys, wallet access, and personal information through technical measures and careful…

  • Launchpad

    Launchpad: The Crypto Startup Accelerator Launchpads are platforms that help new crypto projects raise funds and launch tokens. They’re like Kickstarter for cryptocurrencies, but with more speculation and less product delivery. A launchpad is a platform that facilitates fundraising and token launches for new cryptocurrency projects. They provide infrastructure, marketing, and community access to help…

  • Token Launch

    Token Launch: Cryptocurrency Project DebutA token launch is the initial release of a new cryptocurrency token to the public market. It's like a product launch where a company introduces a new product, but for digital currencies instead of physical goods.Token launch refers to the process of introducing a new cryptocurrency token to the market, including…

  • HTLC

    HTLC: Hash Time-Locked ContractsHTLCs are smart contracts that lock cryptocurrency until specific conditions are met within time limits. They're like escrow services with built-in deadlines that automatically return funds if deals fall through.Hash Time-Locked Contracts (HTLCs) are smart contracts that require both cryptographic proof and time-based conditions to be met before cryptocurrency can be accessed. These…