#08 SC08:2026 Medium ↓ from #5

Reentrancy Attacks

Reentrancy describes any situation where a smart contract performs an external call (to another contract or address), and the callee can call back into the original contract before the first invocation has completed, allowing repeated withdrawals or state changes from outdated views of contract state.

Official OWASP description, from scs.owasp.org (CC BY-NC-SA 4.0).

Why this rank in 2026

Down from #5 to #8 - the biggest demotion in the 2026 list. OWASP attributes this to mature controls: OpenZeppelin ReentrancyGuard (and the transient-storage variant), reliable detection by Slither and Mythril, and widespread auditor familiarity. Reentrancy still appears in chained exploits like GMX V1 but is rarely the standalone root cause anymore.

The most studied vulnerability in the industry - now down to #8

Reentrancy has been on every smart-contract Top 10 since OWASP started publishing one. It started life as the bug that broke The DAO in 2016 ($60M, $3.6M ETH at the time). In OWASP 2025 it was #5. In 2026 it is #8.

The reason for the demotion is not that reentrancy stopped happening. It's that:

  • OpenZeppelin ReentrancyGuard (and the transient-storage variant introduced with EIP-1153) is a near-default in 2026 codebases.

  • Slither, Mythril, and Aderyn detect classic patterns with high precision.

  • Every senior auditor recognizes the canonical structure on sight.

The result is that reentrancy is now mostly a component of chained exploits (GMX V1 in 2025 is the canonical 2025 example) rather than the standalone root cause it used to be.

The reentrancy zoo

There are five categories worth distinguishing:

  • Single-function (the classic recursive variant).

  • Cross-function (callback into a sibling function).

  • Cross-contract (multi-hop callback through unrelated contracts).

  • Read-only reentrancy (a view function returns stale state during a callback - the cause of the 2023 Curve incident).

  • Callback hooks - ERC-777, ERC-721/1155 receivers, ERC-4626 hooks, flash-loan callbacks.

How AI auditors handle this category

This is the strongest AI category in OWASP 2026 - ~94% detection vs ~96% for human auditors. The reason is straightforward: reentrancy has a recognizable structural signature (external call before state update) and decades of labeled training data. Where AI still loses is read-only reentrancy and obscure callback chains, which are harder to spot from local patterns alone.

See SCH's full walk-through at /attacks/reentrancy.

2025 incidents tied to this category

Pulled live from the SCH hack database, ordered by amount lost. Click any incident for the full post-mortem.

View the full SCH hack dashboard →

Vulnerable vs secure code

✗ Vulnerable solidity
// Vulnerable: external call before state update
mapping(address => uint256) public balance;

function withdraw() external {
    uint256 amt = balance[msg.sender];
    (bool ok, ) = msg.sender.call{value: amt}("");      // reentrancy window
    require(ok, "transfer failed");
    balance[msg.sender] = 0;                            // too late
}
✓ Secure solidity
// Secure: CEI + ReentrancyGuard
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract Vault is ReentrancyGuard {
    mapping(address => uint256) public balance;

    function withdraw() external nonReentrant {
        uint256 amt = balance[msg.sender];
        require(amt > 0, "nothing to withdraw");
        balance[msg.sender] = 0;                        // effect first
        (bool ok, ) = msg.sender.call{value: amt}("");  // interaction
        require(ok, "transfer failed");
    }
}

AI vs human auditor on this category

Each bar is a detection rate: out of 100 known reentrancy bugs, how many that auditor type finds. Higher means more reliable. The gap below is the percentage-point difference - the work senior humans still do that AI does not.

AI auditor (frontier LLM)
94%
Human auditor (senior)
96%

% of SC08 bugs caught - higher is better.

Human advantage on SC08
+2 percentage points
Senior auditors catch 2 more reentrancy bugs per 100 than frontier AI today. That gap is the skill the SCH course teaches.

The single smallest AI vs human gap in OWASP 2026. Reentrancy is the most studied vulnerability class in the industry and AI tooling has effectively closed the detection gap on classic patterns. The remaining ~2-point gap is read-only reentrancy and obscure callback chains.

Methodology: EVMbench, Cecuro purpose-built agent benchmarks, and senior-auditor self-reported catch rates. SCH editorial, not OWASP-authored.

Prevention checklist

  • Apply ReentrancyGuard (or the transient variant) on funds-touching and external-call functions.
  • Use Checks-Effects-Interactions ordering rigorously.
  • Treat every callback mechanism as a reentrancy vector - ERC-777, ERC-721/1155 receivers, ERC-4626, flash-loan callbacks.
  • Fuzz with external-call adversarial scenarios.
  • Review cross-function and multi-contract interactions, not just single functions.

Detection tools

Industry-standard tools that detect this category. Tool mappings are SCH editorial - OWASP's per-category pages do not list specific tools.

Slither
static

reentrancy-eth, reentrancy-no-eth, reentrancy-benign, reentrancy-events, reentrancy-unlimited-gas

Mythril
symbolic

symbolic reentrancy detection

Aderyn
static

state-change-after-ext-call

Echidna
fuzz

reentrancy invariants

Deep dive: related SCH attack pages

FAQ

What is OWASP SC08 Reentrancy?
SC08 covers situations where a smart contract performs an external call, and the callee can call back into the original contract before the first invocation has completed - allowing repeated withdrawals or state changes from outdated views of contract state. It is #8 in OWASP Smart Contract Top 10 2026, demoted from #5 in 2025.
Why did reentrancy drop from #5 to #8 in OWASP 2026?
The biggest demotion in the 2026 list. OWASP attributes this to mature controls: OpenZeppelin ReentrancyGuard (and the transient-storage variant introduced with EIP-1153) is near-default, Slither/Mythril/Aderyn detect classic patterns with high precision, and senior auditors recognize the structure on sight. Reentrancy still appears in chained exploits like GMX V1 in 2025 but is rarely the standalone root cause anymore.
What is read-only reentrancy?
A variant where a view function returns stale state during a callback. A downstream contract reads price or balance data while a withdrawal is in progress, gets inconsistent state, and acts on it. The 2023 Curve incident is the canonical case. It is the hardest reentrancy variant for AI auditors to detect because there is no obvious "external call before state update" pattern at the source level.
What was the DAO hack and how does it relate to reentrancy?
The DAO (June 2016) was the first major reentrancy exploit on Ethereum - approximately $60M drained (3.6M ETH at the time, around $150 each) by recursively calling withdraw before the balance was updated. It triggered the Ethereum / Ethereum Classic fork. Every modern Solidity guide cites it as the canonical example, and ReentrancyGuard was the response.
How do you prevent reentrancy in Solidity?
Apply ReentrancyGuard (or the EIP-1153 transient variant) on funds-touching and external-call functions, use Checks-Effects-Interactions ordering rigorously, treat every callback mechanism as a reentrancy vector (ERC-777, ERC-721/1155 receivers, ERC-4626 hooks, flash-loan callbacks), fuzz with external-call adversarial scenarios, and review cross-function and multi-contract interactions, not just single functions.
Can AI auditors detect reentrancy bugs?
This is the strongest AI category in OWASP 2026 - around 94% catch rate versus 96% for senior humans, the single smallest AI vs human gap. The reason is straightforward: reentrancy has a recognizable structural signature (external call before state update) and decades of labeled training data. The remaining 2-point gap is read-only reentrancy and obscure callback chains.

Master the techniques that make this category exploitable

The SCH Smart Contract Hacking Course teaches the exploit primitives, audit techniques, and tool workflows for reentrancy attacks and every other OWASP 2026 category.