Reproduced Exploit

Ammplify: a fake pool is paid the maker's whole token balance

newMaker takes a pool address and never checks that Uniswap V3 created it. mint stores that address as the pool guard and calls pool.mint. The callback pays amount0Owed and amount1Owed to msg.sender. The fake pool asks for the maker's entire balance of both tokens and forwards them to the attacker.

Sep 2025•Ethereum•logic•3 min read

Loss

1000000 token0 and 250000 token1 moved from the maker to the attacker

Chain

Ethereum

Category

logic

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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 63179-h-13-attackers-can-drain-the-protocol-tokens-sherlock-ammpli. Standalone Foundry PoC and full write-up: 63179-h-13-attackers-can-drain-the-protocol-tokens-sherlock-ammpli_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/missing-check

Key info#

FieldValue
Loss1000000 token0 and 250000 token1 moved from the maker to the attacker
Vulnerable contractMaker.uniswapV3MintCallback
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-09
Compilersolc 0.8.27, cancun, via IR
Bug classUnchecked pool address in the mint callback

TL;DR#

newMaker takes a pool address and never checks that Uniswap V3 created it. mint stores that address as the pool guard and calls pool.mint. The callback pays amount0Owed and amount1Owed to msg.sender. The fake pool asks for the maker's entire balance of both tokens and forwards them to the attacker.

Background#

Sherlock's September 2025 Ammplify contest, issue 566. Maker.newMaker passes the user-supplied pool into PoolLib.mint, which tstores it and calls IUniswapV3Pool.mint. uniswapV3MintCallback only checks msg.sender == poolGuard and then safeTransfers whatever the pool reports. The fix is to require the pool was created by the canonical factory. The protocol later fixed this in itos-finance/Ammplify pull 43.

The vulnerable code#

SOLIDITY
_safeTransfer(pInfo.token0, activeMint, amount0Owed); // @> VULN
_safeTransfer(pInfo.token1, activeMint, amount1Owed);

pInfo is read from the same pool that chose amount0Owed and amount1Owed. The guard was set to that pool inside mint.

DIFF
  function newMaker(address pool, ...) external {
+     require(factory.getPool(token0, token1, fee) == pool, "not a pool");
      _mint(pool, ...);
  }

Root cause#

The only authorization on the callback is "you are the address we just called." The user chooses that address, and the callback trusts the amounts and token addresses it returns.

Preconditions#

  • The maker holds token balances. Here that is 1000000 token0 and 250000 token1, standing in for fees and unpaid liquidity.
  • The caller can pass any contract as pool.

Attack walkthrough#

  1. The attacker deploys a pool whose token0 and token1 are the maker's tokens.
  2. newMaker is called with that pool. No factory check runs.
  3. mint sets the guard and calls pool.mint.
  4. The pool's mint calls back with the maker's full balances.
  5. Both transfers land on the pool, which forwards them to the attacker. The maker's balances are 0.

Diagrams#

flowchart TD A["Maker holds 1000000 token0 and 250000 token1"] --> B["newMaker is called with an attacker pool"] B --> C["mint stores that pool as the guard and calls pool.mint"] C --> D["VULN: callback pays amount0Owed and amount1Owed to the pool"] D --> E["Pool forwards both balances to the attacker"] E --> F["Maker token balances are 0"]

Impact#

The attacker receives 1000000 token0 and 250000 token1 that were sitting on the maker. Those balances are the fees, penalties, and idle liquidity the report says can be taken. A factory check before the guard is set stops the callback from ever running against this contract.

Remediation#

Require pool equals factory.getPool(token0, token1, fee) before tstore, and keep the msg.sender == poolGuard check.

How to reproduce#

BASH
cd 63179-h-13-attackers-can-drain-the-protocol-tokens-sherlock-ammpli_exp
forge test -vv

test_exploit_fake_pool_drains_both_tokens asserts the attacker holds both full balances and the maker holds neither. Captured output is output.txt.

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.