Skip to content

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

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.

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.

Year by year

6 years

What each year's disclosed reports show, newest first. A year with few reports says less.

Reports per yearPeak 2022: 33
Reports per year
20181
20213
202233
202312
202410
202514
20264
  1. 2026

    4 reports

    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.
    and 2 more
  2. 2025

    14 reports

    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.
  3. 2024

    10 reports

    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.
Every point, year by year

Where it is found

7

The features and places the reports found it in, most-reported first.

  1. Reward mines, reward pools, fee distribution and bribe deposits.

    Seen in 4 reports
  2. Liquid staking managers, vault pools, vault deposits and vesting claims.

    Seen in 3 reports
  3. Basket-style contracts, including basket creation, settlement, burn and mint, and initialisation.

    Seen in 2 reports
  4. Any flow that moves an ERC777 token, including swaps, buys, auctions and withdrawals.

    Seen in 2 reports
  5. Borrower operations, loan requests, collateral withdrawal and liquidation.

    Seen in 2 reports

Technologies in these reports1

View all 7

Root causes

5

The mistakes in the code or configuration behind the reports.

  1. State such as balances, shares or indexes is updated after the external call instead of before it.

    Seen in 6 reports
  2. A state-changing function that makes an external call has no non-reentrant modifier.

    Seen in 3 reports
  3. One contract reads another's state mid-transaction before it is updated.

    Seen in 3 reports
  4. Hookable or callback-capable tokens (ERC777, safe mint, NFT received) are trusted to return without re-entering.

    Seen in 2 reports
  5. 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
More in Vault and share accounting

Other

of 3 ticked
More in Other

Staking and reward claims

of 3 ticked
More in Staking and reward claims

Token callbacks and hookable tokens

of 3 ticked
More in Token callbacks and hookable tokens
View more things to try

Bypasses and variations

2

How reports got past filters, encoders and other defences.

  1. The reentrancy check in the account contract can be circumvented.

    Seen in 1 report
  2. 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

3

How programs fixed it, as the reports describe.

  1. Update balances, shares and indexes before making any external call.

    Seen in 4 reports
  2. Add a non-reentrant modifier to every state-changing function that makes an external call.

    Seen in 3 reports
  3. Update the initializer modifier so it also blocks reentrancy during initialisation.

    Seen in 1 report

Tips for beginners

11

Advice for a first hunt, drawn from the reports.

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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.

    Seen in 2 reports
View all 11

Guides and techniques

The best explainers, cheat sheets and technique posts on Reentrancy, from around the web.

Keep learning

Where this lesson fits, and what to read next.

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.