Reproduced Exploit

apDAO: claiming NFTs before auction creation cuts the floor the owner is paid

An auction lists at treasury.realFloorValue(), which is (backing + backingLoanedOut) / float. claim() mints remainingClaimable NFTs and increases float without adding backing. Before creation the treasury holds 100 WETH against a float of 1, so the floor is 100. The attacker claims 9 NFTs first. Fl…

Oct 2024•Other•defi•3 min read

Loss

Owner is paid 10 WETH instead of 100. The attacker redeems 90 WETH

Chain

Other

Category

defi

Date

Oct 2024

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: 44395-c-01-frontrunning-the-auction-creation-and-settlement-to-low. Standalone Foundry PoC and full write-up: 44395-c-01-frontrunning-the-auction-creation-and-settlement-to-low_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/defi/sandwich-attack

Key info#

FieldValue
LossOwner is paid 10 WETH instead of 100. The attacker redeems 90 WETH
Vulnerable contractAuction.createAuction reading Treasury.realFloorValue
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateLocal synthetic · 2024-10
Compilersolc 0.8.27, cancun, via IR
Bug classFloor price is backing divided by a float that claim() can inflate

TL;DR#

An auction lists at treasury.realFloorValue(), which is (backing + backingLoanedOut) / float. claim() mints remainingClaimable NFTs and increases float without adding backing. Before creation the treasury holds 100 WETH against a float of 1, so the floor is 100. The attacker claims 9 NFTs first. Float becomes 10 and the floor becomes 10. The auction lists at 10. With no bidders, settlement pays the owner 10 WETH. The attacker redeems the 9 NFTs for the remaining 90 WETH. Skipping the claim pays the owner the full 100.

The vulnerable code#

SOLIDITY
uint256 value_ = (backing_ + backingLoanedOut_) / float_; // @> VULN
_mint(msg.sender, remainingClaimable); // @> VULN
uint256 currentRFV = treasury.realFloorValue(); // @> VULN

Settlement then calls redeemItem, which reads the same floor again, so both the listed price and the cash the owner receives are the diluted number.

Root cause#

float is the circulating NFT count and it is writable by claim() in the same window the auction reads it. More NFTs with the same backing means a lower redemption price for the NFT already being auctioned. The new NFTs are claims on the backing the owner no longer receives.

Preconditions#

  • Treasury backing is 100 WETH and float starts at 1 (the NFT about to be auctioned).
  • The attacker has remainingClaimable of 9.
  • No higher bid replaces the floor redemption. The report's second path is exactly an auction with no bidders.

Attack walkthrough#

  1. realFloorValue is 100 WETH.
  2. claim mints 9 NFTs. floatSupply becomes 10. The floor is 10 WETH.
  3. createAuction stores currentRFV of 10.
  4. settle redeems one NFT at the live floor and forwards 10 WETH to the owner.
  5. The attacker redeems 9 NFTs at 10 WETH each and receives 90 WETH. The treasury is empty.

Diagrams#

flowchart TD A["Floor is 100 WETH over a float of 1"] --> B["Attacker claims 9 NFTs and float becomes 10"] B --> C["createAuction reads the live floor of 10"] C --> D["Settlement pays the owner 10 WETH"] D --> E["Attacker redeems the 9 NFTs for the remaining 90 WETH"]

Impact#

The NFT owner is underpaid by 90 WETH on a 100 WETH floor. That 90 WETH is what the attacker's newly claimed NFTs redeem for. A creation that is not front-run pays the owner the full 100 WETH.

How to reproduce#

BASH
cd 44395-c-01-frontrunning-the-auction-creation-and-settlement-to-low_exp
forge test -vv

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.