Reproduced Exploit
Ammplify — H-6: First-deposit share inflation steals compounded maker deposits
1. Each compounded segment acts as a vault with shares = liq * totalShares / totalLiq (floor). 2. Attacker seeds min liquidity, donates, shrinks to 1 share, donates again. 3. Victim’s large deposit mints 0 shares; Uniswap/vault liq still increases. 4. Attacker redeems the sole share and steals the…
Chain
Other
Category
untagged
Date
Sep 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: 63172-h-6-user-can-lose-all-funds-when-creating-or-increasing-comp. Standalone Foundry PoC and full write-up: 63172-h-6-user-can-lose-all-funds-when-creating-or-increasing-comp_exp in the
evm-hack-registrymirror.
Vulnerability classes: rounding-direction · frontrun · first-deposit · integer-bounds
Reproduction: self-contained Foundry PoC with only
forge-std. Full trace: output.txt. PoC: test/63172-h-6-user-can-lose-all-funds-when-creating-or-increasing-comp_exp.sol.
AuditVault taxonomy: severity/high · sector/dex · sector/lending · platform/sherlock · rounding-direction · frontrun · first-deposit
Key info#
| Impact | HIGH — victim mints 0 shares; attacker redeems their full deposit |
| Protocol | Ammplify (itos-finance) |
| Vulnerable code | Compound share mint rounds down; only min liquidity enforced, not min shares |
| Bug class | ERC-4626-style first depositor inflation on per-segment vaults |
| Finding | Sherlock 2025-09-ammplify · #63172 / issue 417 · panprog (+ others) |
| Report | sherlock-audit/2025-09-ammplify-judging |
| Status | Audit finding. Reproduced as a standalone local PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Each compounded segment acts as a vault with
shares = liq * totalShares / totalLiq(floor). - Attacker seeds min liquidity, donates, shrinks to 1 share, donates again.
- Victim’s large deposit mints 0 shares; Uniswap/vault liq still increases.
- Attacker redeems the sole share and steals the victim’s assets.
The vulnerable code#
shares = (liq * totalShares) / totalLiq; // @> VULN: rounds down after inflation
// min check only on target liquidity, not shares
Root cause#
Floor division on share mint plus donation-inflatable total liquidity. Minimum liquidity is not a minimum-share guard.
Preconditions#
- Empty (or attacker-controlled) segment the victim is about to enter.
Attack walkthrough#
- Attacker deposits
MIN_LIQ, donates, shrinks to 1 share. - Second donation ≈ victim size → 1 share worth ≫ deposit.
- Victim deposits 300e18 → 0 shares.
- Attacker
redeemAlltakes vault including victim funds.
Diagrams#
Impact#
Full loss of victim deposit on any empty compounded segment (many segments → many attack surfaces).
Sources#
- AuditVault finding #63172
- Sherlock judging #417
- Reduced source:
src/walkers/Liq.solshare mint;src/facets/Maker.solmin liq
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 63172-h-6-user-can-lose-all-funds-when-creating-or-increasing-comp_exp (evm-hack-registry mirror).
- AuditVault finding: 63172-h-6-user-can-lose-all-funds-when-creating-or-increasing-comp.
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.