This guide provides a comprehensive analysis of reentrancy vulnerabilities with examples. Learn how reentrancy works and how to identify it in real protocols.
Glossary definition
Reentrancy occurs when an external interaction transfers control and execution enters the calling system again before its earlier operation is safely resolved.
The classic case sends value before reducing a balance, allowing a recipient to call the withdrawal function repeatedly against stale state. The broader class includes re-entry through another function or contract, token receiver hooks, cross-chain callbacks, and view functions that expose temporarily inconsistent values.
A mutex can stop some same-contract paths, but it does not repair every shared state or cross-contract interaction. Reviewers trace external control transfer, the state visible at that moment, and every callable route back into the system. The complete reentrancy guide and its linked executable examples cover each major variant without making this definition page compete with the tutorial.
Used in context
This guide provides a comprehensive analysis of reentrancy vulnerabilities with examples. Learn how reentrancy works and how to identify it in real protocols.
Learn how attackers can exploit reentrancy vulnerabilities in ERC-1155 implementations to drain vault contracts, with an example real-world attack scenario.
In this article, we'll examine how attackers can manipulate the _safeMint function's external call to bypass minting limits and drain NFT collections.
This analysis examines the 42M attack on the GMX protocol. We provide details of the vulnerability with a working reproduction of the attack scenario.
In this blog, we describe reentrancy attacks in the ERC-777 standard. ERC-777 is a standard for fungible tokens with a hook for transferring – learn more here.
Flash loans enable borrowing without collateral and repaying within a single transaction. While effective, they also introduce security risks – learn more here.
A cross-chain reentrancy attack is an exploit that targets smart contract function calls. Learn about this vulnerability to keep your code safe from attackers.
A read-only reentrancy attack manipulate a smart contracts to extract value. Let's take a closer look at this vulnerability and how to prevent it.
Safe Smart Accounts are the most audited and battle-tested smart contracts on Ethereum securing over $100 billion in assets. The Safe Social Recovery Module is a…
This research article reviews how cross contract reentrancy attacks work, an attack example, and guidance on how to prevent cross contract reentrancy attacks.…
What is a cross function reentrancy attack? Cross-function reentrancy attacks use multiple functions to execute the attack, which can occur when inappropriate…
What is a reentrancy attack? A reentrancy attack is very specific to smart contracts due to the nature of external calls. When a contract interacts with another…
Building projects on top of cross-chain solutions may lead to security issues in the code. Open-source tools can automatically detect many issues or help test the…