We discovered an interesting edge case on the @Uniswap Continuous Clearing Auction repo with Grego AI that allowed an attacker to brick an ongoing auction and permanently lock all bidder’s funds with no upper bound limit on funds at risk.
Repo:
https://github.com/Uniswap/continuous-clearing-auction
Humble thanks to the Uniswap team to award us a bounty for this find. Team has acknowledged and fixed below, upgrading to v1.1.0:
If you would like to engage our AI security services for your protocol contact @0xriptide or @0xitsgreg to discuss.
Bug report follows …
Summary
This finding expands on a known informational issue from the Spearbit audit (section 3.5.2) and GitHub issue #251, where unbounded tick creation via sequential bids can inflate a linked list of ticks. Each submitBid call invokes _initializeTickIfNeeded, adding ticks without removal. At auction end, _iterateOverTicksAndFindClearingPrice must traverse all ticks above the clearing price in a single atomic while loop. If this exceeds the transaction gas limit (~16.78M post-Fusaka upgrade on Ethereum-compatible chains like Unichain), the final checkpoint reverts with OutOfGas (OOG), blocking all settlement functions (e.g., claimTokens, sweepCurrency) that rely on the ensureEndBlockIsCheckpointed modifier. Funds remain permanently locked.
The @spearbit audit assumed this only increases gas costs without causing DoS, and initial mitigations (e.g., assuming single-block bid limits) were invalidated by demonstrating multi-block feasibility. Post-Fusaka the tx gas cap reduces the tick threshold for OOG during finalization, but multi-block tick inflation remains viable. The attack requires the attacker to deposit substantial funds to elevate the clearing price and force full traversal, meaning they lock mostly their own capital.
Scenario on Unichain (Post-Fusaka Considerations):
- Attacker submits thousands of small bids (e.g., 1 wei) at sequential tick prices over multiple blocks (total cost low, <1 ETH for ~2,000-60,000 ticks depending on config).
- Small bids keep cumulative demand low (below TOTAL_SUPPLY * floorPrice), ensuring intermediate checkpoints remain gas-efficient (incremental traversal only).
- Near END_BLOCK, attacker (or legitimate bidders) submits a large bid (e.g., ~7e8 ETH) to spike demand and force clearing price into high tick range, requiring full traversal of all inflated ticks.
- Auction ends; final checkpoint attempts to process all ticks atomically but exceeds ~16.78M gas limit and reverts.
- All retries fail identically (no partial progress saved).
- Settlement blocked; all funds (attacker’s + victims’) locked permanently.
Realistic tick count for OOG: ~2,000-60,000 (adjusted down from original 200k PoC due to 16M tx cap vs. 30M test env; exact depends on per-iteration gas ~100-200k, but traversals can hit OOG at lower counts if demand pushes deep). On Unichain, block gas limits (~60M post-Fusaka) allow multi-tx blocks, but tx cap constrains single-call complexity.
Finding Description
The vulnerability stems from the tick linked list growing unbounded via multi-block bids, combined with atomic full-traversal requirements in _iterateOverTicksAndFindClearingPrice (ContinuousClearingAuction.sol#L310-327). State updates occur only after loop completion (L329-332), making partial checkpoints impossible. If gas exhausts mid-loop, the tx reverts with no progress.
Spearbit noted this as informational (3.5.2), assuming “only increased gas costs” and improbability due to single-block limits. However, multi-block inflation bypasses this: small bids avoid deep traversals during auction, deferring OOG to post-end calls. GitHub #251 documents the risk but was closed without code changes, relying on config mitigations.
Post-Fusaka, Ethereum’s tx gas cap (~16.78M via EIP-7825) invalidates pre-upgrade assumptions of higher limits, lowering the tick threshold for OOG but not preventing the vector. Attacker can maintain low demand until end, then leverage a large bid (theirs or organic) to trigger.
Likelihood
Low (requires extensive setup across multiple blocks, precise timing near auction end, minimal competing bids, and significant capital to push clearing price high; post-Fusaka tx gas cap of ~16.78M reduces viable tick count for OOG but does not prevent multi-block accumulation)
Impact
Medium (funds from all bidders can be locked indefinitely with no recourse; however, attack mechanics require the attacker to supply the majority of capital to force high tick traversal, limiting net loss to others; isolated to individual auctions, not systemic to broader protocol TVL)