Reproduced Exploit

NextGen — Permanent DoS due to non-shrinking array in unbounded loops

participateToAuction only pushes bids; arrays never shrink. returnHighestBid / claimAuction iterate the full array. Enough dust bids make claim OOG → permanent auction DoS.

Oct 2023Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Oct 2023

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: 29526-h-05-permanent-dos-due-to-non-shrinking-array-usage-in-an-un. Standalone Foundry PoC and full write-up: 29526-h-05-permanent-dos-due-to-non-shrinking-array-usage-in-an-un_exp in the evm-hack-registry mirror.


Reproduction: self-contained Foundry PoC (forge-std only) — no fork. Full trace: output.txt.

AuditVault taxonomy: lang/solidity · platform/code4rena · severity/high · sector/nft · genome: unbounded-loop · permanent


Key info#

ImpactHIGH — spam bids inflate auctionInfoData; claimAuction OOGs permanently
ProtocolNextGen
Bug classNon-shrinking bid array + unbounded loops in claim/highest-bid
FindingCode4rena 2023-10-nextgen H-05 · #29526
Reporthttps://code4rena.com/reports/2023-10-nextgen
SourceAuditVault
StatusAudit finding — sample+extrapolate gas PoC
Compiler^0.8.24 (PoC)

TL;DR#

participateToAuction only pushes bids; arrays never shrink. returnHighestBid / claimAuction iterate the full array. Enough dust bids make claim OOG → permanent auction DoS.

HARM: extrapolated claimAuction gas at REAL_N bids exceeds block gas limit.


Root cause#

Unbounded growing bid array used in unbounded loops.

Preconditions#

Open auction; attacker can bid with increasing dust amounts.

Attack walkthrough#

Push SAMPLE bids → measure claim gas → extrapolate to REAL_N → require > 30M.

Diagrams#

flowchart TD A["Attacker spam participateToAuction"] --> B["auctionInfoData grows"] B --> C["claimAuction after end"] C --> D["returnHighestBid O n loop"] C --> E["refund loop O n"] D --> F{"gas > block limit?"} F -->|Yes| G["claim permanently DoSd"]

Impact#

Auction cannot be claimed; NFT and bids stuck.

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.