Reproduced Exploit
Yearn yBOLD — Steal 25% of first depositor funds via share inflation
1. Fresh strategy has totalSupply = 0 and no burned dead shares. 2. Attacker deposits 1 wei → 1 share, then donates until totalAssets = 1 + victimDeposit/2. 3. Victim deposits 1e23; convertToShares floors ≈1.999 → 1 share. 4. Attacker redeems 1 of 2 shares for half the pool → ~25% of the victim dep…
Chain
Other
Category
untagged
Date
May 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 57686-h-1-a-malicious-attacker-can-steal-25-of-the-funds-of-the-fi. Standalone Foundry PoC and full write-up: 57686-h-1-a-malicious-attacker-can-steal-25-of-the-funds-of-the-fi_exp in the
evm-hack-registrymirror.
Vulnerability classes: arithmetic/rounding · first-deposit · direct-drain · frontrun-exposure
Reproduction: self-contained Foundry PoC with only
forge-std— no fork. Full trace: output.txt. PoC: test/57686-h-1-a-malicious-attacker-can-steal-25-of-the-funds-of-the-fi_exp.sol.
Key info#
| Impact | HIGH — attacker steals ~25% of the first honest deposit |
| Protocol | Yearn yBOLD / TokenizedStrategy (yv3 Liquity v2 SP strategy) |
| Vulnerable code | TokenizedStrategy._convertToSharesFromTotals — no dead-share floor; StrategyFactory seeds no deposit |
| Bug class | First-depositor / ERC4626 inflation |
| Finding | Sherlock 2025-05-yearn-ybold · #57686 · H-1 · reporter Obsidian |
| Report | sherlock-audit/2025-05-yearn-ybold-judging |
| Source | AuditVault |
| Status | Valid high; mitigate with dead shares / min first deposit / deposit slippage |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Fresh strategy has
totalSupply = 0and no burned dead shares. - Attacker deposits 1 wei → 1 share, then donates until
totalAssets = 1 + victimDeposit/2. - Victim deposits
1e23;convertToSharesfloors ≈1.999 → 1 share. - Attacker redeems 1 of 2 shares for half the pool → ~25% of the victim deposit stolen.
The vulnerable code#
// Yearn TokenizedStrategy._convertToSharesFromTotals (simplified)
if (supply == 0) return assets;
// @> VULN: pure round-down, no dead-share floor / min first deposit
return assets.mulDiv(supply, totalAssets_, Math.Rounding.Down);
Strategy construction does not seed an initial deposit, so the empty vault is fully inflatable.
Root cause#
Share minting is classic ERC4626 round-down against totalAssets with no minimum liquidity. Donating assets (or the finding's deposit/redeem inflation loop) raises PPS so the next depositor's share count floors hard, while their full asset amount is still transferred in.
Preconditions#
- Newly deployed strategy (via
StrategyFactory) with zero supply. - Attacker can frontrun the first real deposit in the mempool.
- Optional: management sets
profitMaxUnlockTime = 0so a 1-wei report is instant (not required if the attacker waits for unlock).
Attack walkthrough#
deposit(1)→ 1 share.- Donate
USER_DEPOSIT/2andreport()→ PPS ≈ half the pending deposit (terminal state of the finding's inflation loop). - Victim
deposit(1e23)→ 1 share (rounded down). - Attacker
redeem(1)→ ~7.5e22 assets; net profit ≈ 2.5e22 (25% of the deposit).
Diagrams#
Impact#
Direct theft of approximately one quarter of the first depositor's funds. Subsequent depositors are safer once supply is non-trivial, but every new strategy deployment is a fresh attack surface.
Taxonomy#
genome: arithmetic/rounding,first-deposit,direct-drain,frontrun-exposureseverity/high·sector/vault·sector/yield-aggregator·platform/sherlock
Sources#
- AuditVault finding #57686
- Sherlock judging issue #154
- Vulnerable source:
sherlock-audit/2025-05-yearn-ybold→ strategy inherits YearnTokenizedStrategyconvert/deposit; factory does not seed deposit - Yearn
tokenized-strategy_convertToSharesFromTotals(assets.mulDiv(supply, totalAssets_, Down))
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 57686-h-1-a-malicious-attacker-can-steal-25-of-the-funds-of-the-fi_exp (evm-hack-registry mirror).
- AuditVault finding: 57686-h-1-a-malicious-attacker-can-steal-25-of-the-funds-of-the-fi.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.