In-depth lesson · technique
Reentrancy
What every disclosed Reentrancy report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- reports cited in this lesson
- 99
- median public bounty
- None
Learning Smart contracts, step 2
Overview
What it is and why programs pay for it.
Reentrancy is a smart contract flaw where an external call hands control to another contract before the caller has finished updating its own state. The callee can call back into the original contract, or into a related one, and act on balances, shares or indexes that are still stale. The evidence covers a hundred reports across many codebases, so this is not a niche issue: it appears wherever contracts hold value and call out to tokens, receivers or other protocols.
Programs care because the consequences are usually direct loss or corruption of funds: inflated balances, shares minted twice, withdrawals paid more than once, collateral taken twice, or pools left short. It also shows up as griefing, blocked withdrawals, frozen rewards and bypassed fees or timelocks. Because the flaw sits in ordinary value-moving flows, it is found in baskets, reward mines, lending and borrower operations, vaults, liquid staking, auctions, NFT rentals, governance and cross-chain message proxies.
The most common places are functions that transfer ETH or tokens and update accounting afterwards, contracts that trust hookable tokens such as ERC777 or safe mint callbacks, initialisers, and cross-contract or read-only variants where one contract reads another mid-transaction. Beginners should expect to find it in deposit, withdraw, claim, settle, mint and liquidation paths rather than in exotic code.
Seen in these reports8
-
High -
High -
Medium
Show all 8 reportsShow fewer
-
High -
Medium -
Medium
-
High
-
High
How it works
The mechanics, as the reports show them.
The pattern starts with a state-changing function that makes an external call, for example sending ETH or transferring a token. The call gives the recipient contract a chance to run its own code before the original function resumes. If the recipient calls back into the same contract, it sees the state as it was before the transfer was accounted for.
The callback then repeats the value-moving action using the stale state. A balance that should have been reduced is still full, so it can be withdrawn again; shares that should have been recorded are still absent, so they can be minted again; a claim that should be marked as paid is still open, so it can be claimed again. The result is that the attacker receives more than their entitlement or leaves the contract short.
What makes it possible is ordering: state is updated after the external call instead of before it, or a state-changing function that calls out has no non-reentrant modifier. Hookable tokens make this easy because a token transfer itself is an external call into attacker-controlled code. Initialisers are a special case where the initializer modifier does not block reentry during setup.
Variants widen the surface. Cross-function reentrancy calls a different function than the one that made the transfer. Cross-contract reentrancy moves between related contracts, such as a treasury module or a lending pair. Read-only reentrancy reads a view of a contract while its state is temporarily inconsistent during a callback, and the stale value is then used elsewhere, for example in an oracle or pricing path.
Defences exist but are not always complete. A guard can be missing on one user-facing function, bypassable in a specific flow, or absent from an initialiser. The fix is consistent: update balances, shares and indexes before any external call, and add a non-reentrant modifier to every state-changing function that makes one.
Seen in these reports12
-
Medium -
High
-
Medium
Show 5 moreShow fewer
-
High
-
High -
Medium
-
Medium
-
High
Year by year
6 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2018 | 1 |
|---|---|
| 2021 | 3 |
| 2022 | 33 |
| 2023 | 12 |
| 2024 | 10 |
| 2025 | 14 |
| 2026 | 4 |
-
2026
New this year1
- Reentrancy across services in the staking and liquidation flows first appears in the disclosed reports.
Kept working4
- Staking withdrawal was re-entered across services to check whether it could cause insolvency, as in the disclosed reports.
- The staking flow was re-entered from a token callback to check whether state was settled first, as in the disclosed reports.
-
2025
New this year1
- Cross-contract reentrancy becomes a common label in the 2025 and 2026 reports, as in the disclosed reports.
Kept working1
- Promoter payment distribution was re-entered to check whether promoter and venue funds could be taken, as in the disclosed reports.
-
2024
Kept working2
- Hunters re-entered reward, vesting and fee claim paths to check whether funds could be drained or claimed without holding tokens, as in the disclosed reports.
- The reentrancy check in the account contract was circumvented in the disclosed reports.
Earlier years3
Where it is found
7The features and places the reports found it in, most-reported first.
-
Reward mines, reward pools, fee distribution and bribe deposits.
Seen in 4 reports
-
Liquid staking managers, vault pools, vault deposits and vesting claims.
Seen in 3 reports
-
Basket-style contracts, including basket creation, settlement, burn and mint, and initialisation.
-
Any flow that moves an ERC777 token, including swaps, buys, auctions and withdrawals.
-
Borrower operations, loan requests, collateral withdrawal and liquidation.
Seen in 2 reports
Technologies in these reports1
Root causes
5The mistakes in the code or configuration behind the reports.
-
State such as balances, shares or indexes is updated after the external call instead of before it.
Seen in 6 reports
-
A state-changing function that makes an external call has no non-reentrant modifier.
Seen in 3 reports
-
One contract reads another's state mid-transaction before it is updated.
Seen in 3 reports
-
Hookable or callback-capable tokens (ERC777, safe mint, NFT received) are trusted to return without re-entering.
-
The initializer modifier does not prevent reentrancy during initialisation.
Seen in 1 report
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Vault and share accounting
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
Staking and reward claims
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
Token callbacks and hookable tokens
of 3 ticked-
Seen in 1 report
Bypasses and variations
2How reports got past filters, encoders and other defences.
-
The reentrancy check in the account contract can be circumvented.
Seen in 1 report
-
Reentrancy is used to bypass checks that should stop new modules being added.
Seen in 1 report
Payouts
Public bounties in US dollars, from the data. 0 of 80 reports show an amount.
None of these reports shows a public amount yet.
Typical fixes
3How programs fixed it, as the reports describe.
-
Update balances, shares and indexes before making any external call.
Seen in 4 reports
-
Add a non-reentrant modifier to every state-changing function that makes an external call.
Seen in 3 reports
-
Update the initializer modifier so it also blocks reentrancy during initialisation.
Seen in 1 report
Tips for beginners
11Advice for a first hunt, drawn from the reports.
-
Test the value-moving flows first: deposits, withdrawals, claims, settlements, mints, liquidations and reward distributions. These are where the evidence concentrates and where impact is easiest to show.
Seen in 4 reports
-
Start with functions that send ETH or transfer tokens and then write state. Read the order of operations: if a balance, share or index is written after the external call, that is the first thing to test.
Seen in 3 reports
-
Keep the report focused on the root cause and the fix: state updated after the external call, or a missing non-reentrant modifier. Explain the sequence in plain steps and cite the affected function, without including exploit code.
Seen in 3 reports
-
Look for state-changing functions that make external calls without a non-reentrant modifier. A single missing guard on a user-facing deposit or withdraw function is a common finding.
Seen in 2 reports
-
Watch for guards that exist but can be bypassed. A reentrancy check in one function does not protect another, and a guard in a rage quit or account contract may be circumventable.
Guides and techniques
The best explainers, cheat sheets and technique posts on Reentrancy, from around the web.
-
The Potential Impact Of Erc 777 Tokens On Defi ProtocolsExplains how ERC-777 token hooks can enable reentrancy and other risks in DeFi protocols, helping auditors spot integration flaws.
Explainer immunefi.com
-
Classic Vulnerabilities Part 1: Reentrancy, Access Control & Integer BugsReviews classic smart contract flaws including reentrancy, access control mistakes and integer bugs.
Explainer medium.com
-
Advanced Vulnerabilities Part 2: Cross-Chain, Signatures & Upgradeable PitfallsCovers cross chain replay, signature malleability and upgradeable contract storage pitfalls with Foundry proof of concept examples.
Technique medium.com
Keep learning
Where this lesson fits, and what to read next.
Learning paths
The whole class
Related techniques
How this is made: our model read every listed Reentrancy report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 27 Nov 2026 from 100 reports. All Reentrancy reports.