In-depth lesson · bug class
Smart contract vulnerabilities
What every disclosed Smart contracts 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.
- disclosed reports read
- 1,035
- reports cited in this lesson
- 586
- median public bounty
- None
Learning Smart contracts reading list Smart contracts, step 1
Overview
What it is and why programs pay for it.
Smart contract vulnerabilities are flaws in on-chain code that let someone act outside the rules the contract was meant to enforce. For bug bounty hunters they are a broad and rewarding class of target, because the code is public, the state is observable and the impact is usually measurable in tokens or in broken protocol behaviour. Programs care because a single flaw can drain a pool, freeze deposits or let an attacker take control of a freshly deployed contract, and because these bugs often survive audits when they sit in edge cases such as unusual tokens, callbacks or initialisation order.
Seen in these reports1
-
Medium
How it works
The mechanics, as the reports show them.
A second pattern is state updated after an external call. A function sends tokens, native currency or an NFT, or calls a receiver callback, and only then writes the new balances. If the recipient is a contract, it can re-enter the function before the write lands and act on the old state. Variants include a guard that covers the direct entry point but not a callback path, a read-only reentrancy where a dependent contract trusts a price that is mid-update, and re-entry through token hooks such as ERC777. The fix is always the same shape: update state first and guard every entry point, including callbacks.
A fifth pattern is a price source that can be moved within a single transaction or that returns stale data. Spot prices from a pool, pool share weights and Curve or Balancer pool oracles can be shifted with a flash loan before a lending or vault operation reads them. Oracles that time out may return a huge but valid high price instead of reverting. Slippage bounds computed from manipulable pool state, or with division before multiplication, can be far looser than intended. The common thread is that the contract trusts a number it did not verify against a manipulation-resistant source with a freshness check.
Seen in these reports4
-
Medium -
Medium
-
High
Show all 4 reportsShow fewer
-
Medium
Year by year
6 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2017 | 2 |
|---|---|
| 2018 | 1 |
| 2019 | 1 |
| 2021 | 52 |
| 2022 | 220 |
| 2023 | 206 |
| 2024 | 171 |
| 2025 | 269 |
| 2026 | 61 |
-
2026
Kept working1
- Cross-contract and cross-service reentrancy recurred in staking withdraw, service creation and liquidation paths, in the disclosed reports.
Turned up less1
- Vault deposit, withdraw and redeem slippage findings, common in 2024 and 2025, are rarer in this year's reports.
-
2025
New this year2
- Cross-contract or cross-service reentrancy rather than simple single-function reentrancy appears clearly in this year's reports.
- DEX aggregator integrations and their leftover approval handling appear as a target in the disclosed reports.
Turned up less1
- Simple single-function reentrancy, the largest group in 2022 and 2023, is rarer in this year's reports as findings shift to cross-contract forms.
-
2024
New this year1
- Deploying a contract to an address that collides with a precompile and checking whether deployment succeeds appears in the disclosed reports.
Kept working3
- Reentrancy appeared throughout withdrawals, claims, flash loans, mints and cross contract calls, in the disclosed reports.
- Missing or incorrect slippage control remained dominant across swaps, vaults, staking, bridging and reward claims, in the disclosed reports.
Earlier years3
Where it is found
15The features and places the reports found it in, most-reported first.
-
Functions that make external calls to tokens, native currency or NFTs before updating state.
Seen in 18 reports
-
Any contract that calls transfer or transferFrom directly on an arbitrary token.
Seen in 6 reports
-
Price feeds, pool share weights and Curve or Balancer pool oracles used for lending and vaults.
Seen in 6 reports
-
Strategy allocation and deallocation functions in vaults.
Seen in 5 reports
-
Contracts that accept arbitrary ERC20 tokens as assets, collateral or rewards.
Seen in 3 reports
Technologies in these reports6
Root causes
31The mistakes in the code or configuration behind the reports.
-
State is updated after an external call, or a function with a callback lacks a reentrancy guard.
Seen in 18 reports
-
State is updated after an external call, or the reentrancy guard can be bypassed, in withdraw, claim, swap and mint paths.
Seen in 11 reports
-
Return values from transfer and transferFrom are ignored, so failed transfers are treated as successful.
Seen in 6 reports
-
The price source can be moved within a single transaction or returns stale data.
Seen in 6 reports
-
Functions that swap, mint, redeem or provide liquidity do not enforce a minimum output or maximum input.
Seen in 5 reports
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
Reentrancy in withdrawals and redemptions
of 3 ticked-
Seen in 3 reports
-
Seen in 3 reports
Reward and harvest distribution
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
Minimum output and slippage bounds
of 3 ticked-
Seen in 1 report
Bypasses and variations
3How reports got past filters, encoders and other defences.
-
Re-enter through a token callback or a read-only call rather than the main function.
-
Make the oracle revert so the code falls back to a path with no slippage check.
Seen in 1 report
-
Re-enter through a token or receiver callback to get past a guard that only covers the direct entry point.
Seen in 1 report
Payouts
Public bounties in US dollars, from the data. 0 of 1,035 reports show an amount.
None of these reports shows a public amount yet.
Typical fixes
11How programs fixed it, as the reports describe.
-
Add a non-reentrancy modifier and update state before external calls.
Seen in 18 reports
-
Update state before external calls and apply a reentrancy guard across all entry points including callbacks.
Seen in 11 reports
-
Use a safe transfer helper that checks the return value and reverts on failure.
Seen in 6 reports
-
Require a caller-supplied minimum output, maximum input and deadline on every swap, mint, redeem and liquidity operation.
Seen in 5 reports
-
Enforce a minimum output or slippage bound on every strategy allocation and redemption.
Seen in 5 reports
Tips for beginners
3Advice for a first hunt, drawn from the reports.
-
For price dependent code, identify the exact source and ask whether it can be moved inside one transaction. Spot pool prices, pool share weights and pool oracles are the usual suspects. Also check what happens on timeout: a stale or huge but valid price is often worse than a revert.
-
Check the order of operations in every function that makes an external call. If state is written after the call, or if a callback path exists without the guard used on the main path, you have a candidate. Confirm it by tracing what the recipient can do before the write lands.
Seen in 1 report
-
Test with unusual tokens rather than the standard one. A token that returns false or no value, one with decimals other than eighteen, one that charges a fee on transfer, and one that rejects non-zero-to-non-zero approvals will each expose a different assumption. Report the specific token behaviour that breaks the contract, not a generic complaint about token support.
Seen in 1 report
Guides and techniques
View allThe best explainers, cheat sheets and technique posts on Smart contracts, from around the web.
-
Classic Vulnerabilities Part 2: Oracle Manipulation, Flash Loans & Price AttacksExplains oracle manipulation, flash loans and price attacks in smart contracts with examples for auditors.
Explainer medium.com
-
Mutation testing comes to DAMLTrail of Bits brings mutation testing to DAML smart contracts to surface gaps in test suites.
blog.trailofbits.com
-
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
Lessons on single techniques in Smart contracts
Lessons to read next
How this is made: our model read every listed Smart contracts 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 594 reports. All Smart contracts reports.