Reproduced Exploit

Ammplify — H-10: `subtreeBorrowedX/Y` is node-only (makers underpaid)

1. Child holds large subtreeBorrowed; parent holds small own borrow. 2. Fee charge on parent adds only parent.subtreeBorrowedX (node-only). 3. Child mass ignored → fees ~418 vs correct ~20979 in the demo numbers. 4. Takers underpay; makers lose the residual.

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: 63176-h-10-takers-can-pay-significantly-less-fees-with-makers-losi. Standalone Foundry PoC and full write-up: 63176-h-10-takers-can-pay-significantly-less-fees-with-makers-losi_exp in the evm-hack-registry mirror.


Vulnerability classes: fee-calculation · fee-theft

Reproduction: self-contained Foundry PoC with only forge-std. Full trace: output.txt.

AuditVault taxonomy: severity/high · sector/dex · platform/sherlock · fee-calculation · fee-theft


Key info#

ImpactHIGH — makers lose up to ~99% of taker fees when parent touched first
ProtocolAmmplify
Vulnerable codeFee base uses node.subtreeBorrowedX without rolling up children
Finding#63176 / issue 426 · panprog (+ others)
Compiler^0.8.24

TL;DR#

  1. Child holds large subtreeBorrowed; parent holds small own borrow.
  2. Fee charge on parent adds only parent.subtreeBorrowedX (node-only).
  3. Child mass ignored → fees ~418 vs correct ~20979 in the demo numbers.
  4. Takers underpay; makers lose the residual.

The vulnerable code#

SOLIDITY
totalXBorrows += node.liq.subtreeBorrowedX; // @> VULN: not a true subtree sum
// FIX: ownBorrow + children.subtreeBorrow like subtreeTLiq

Diagrams#

flowchart TD A["Parent own borrow 418"] --> C["Charge at parent"] B["Child borrow 20561"] -.->|not rolled up| C C --> D["Fee base = 418 only"] D --> E["Makers underpaid ~98 percent"]

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.