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…

Sep 2025Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Sep 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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.

Loading fork state…

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-registry mirror.


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#

ImpactHIGH — victim mints 0 shares; attacker redeems their full deposit
ProtocolAmmplify (itos-finance)
Vulnerable codeCompound share mint rounds down; only min liquidity enforced, not min shares
Bug classERC-4626-style first depositor inflation on per-segment vaults
FindingSherlock 2025-09-ammplify · #63172 / issue 417 · panprog (+ others)
Reportsherlock-audit/2025-09-ammplify-judging
StatusAudit finding. Reproduced as a standalone local PoC.
Compiler^0.8.24 (PoC)

TL;DR#

  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 victim’s assets.

The vulnerable code#

SOLIDITY
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#

  1. Attacker deposits MIN_LIQ, donates, shrinks to 1 share.
  2. Second donation ≈ victim size → 1 share worth ≫ deposit.
  3. Victim deposits 300e18 → 0 shares.
  4. Attacker redeemAll takes vault including victim funds.

Diagrams#

sequenceDiagram participant A as Attacker participant V as Vault segment participant U as Victim A->>V: deposit MIN_LIQ A->>V: donate inflate price A->>V: shrink to 1 share A->>V: donate ~victim size U->>V: deposit 300e18 Note over V: mints 0 shares floor A->>V: redeemAll steals deposit

Impact#

Full loss of victim deposit on any empty compounded segment (many segments → many attack surfaces).

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

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.