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

  • Zero-Knowledge Proof (ZKP)

    Zero-Knowledge Proof (ZKP): Proving Without Revealing Zero-knowledge proofs let you prove you know something without revealing what you know. It’s like proving you’re over 21 without showing your birth date, address, or any other personal information. A zero-knowledge proof (ZKP) is a cryptographic method that allows one party to prove they possess certain information without…

  • Trading Pairs

    Trading Pairs: Currency Exchange MarketsTrading pairs represent the exchange rate between two different cryptocurrencies or assets. They're like forex pairs but for digital currencies.A trading pair consists of two assets that can be traded against each other, showing the exchange rate between them. Trading pairs enable price discovery and liquidity for cryptocurrency markets.How Trading Pairs WorkBase…

  • Payment Channel

    Payment Channel: Off-Chain Transaction RoutingPayment channels enable fast, cheap cryptocurrency transactions between parties without recording every transaction on the blockchain. They're like running a tab at a restaurant instead of paying for each item separately.A payment channel is an off-chain mechanism that allows two parties to conduct multiple cryptocurrency transactions without broadcasting each one to…

  • Secondary Market

    Secondary Market: Resale Trading VenuesSecondary markets enable trading of assets after their initial issuance, providing liquidity and price discovery for existing holdings. They're like used car lots for digital assets.A secondary market is where previously issued assets are bought and sold between investors rather than being purchased directly from the original issuer. These markets provide liquidity…

  • ZK Proof Aggregation

    ZK Proof Aggregation: Scaling Zero-Knowledge Systems ZK proof aggregation combines multiple zero-knowledge proofs into single, more efficient proofs. It’s like having one master key that proves you have access to multiple locked boxes. ZK proof aggregation is a technique that combines multiple zero-knowledge proofs into a single proof that verifies all the original statements simultaneously….

  • Public Key

    Public Key: Your Crypto Receiving Address Your public key is like your email address for crypto – you can share it freely without security concerns. A public key is cryptographically derived from your private key and generates your wallet addresses where others can send you cryptocurrency. It’s mathematically linked to your private key but reveals…