Crypto exploits

AmbientCrocSwapDex exploit analysis

A flash-loan-funded attacker walked Ambient Finance's CrocSwapDex ETH/USDC pool across roughly 10,400 ticks, minted a narrow concentrated-liquidity range at the manipulated price, and harvested its fee rewards through a code path that never checks the position's minimum dwell time, netting a reported 67.85 ETH on Ethereum on June 7, 2026.

David

Security ·

Reported loss
67.85 ETH net, per DeFiHackLabs' proof of concept, reconciling with 33.72 WETH retained after Balancer repayment plus 34.13 ETH from a Uniswap V3 swap of 55,913.81 USDC, per Etherscan's record of the attack transaction
Occurred
Logged
Chain
Ethereum

Logged as “2026-06-07: Native Surplus Accounting Flaw on AmbientCrocSwapDex”.

Analysis3 min read

Ambient Finance (built as CrocSwap, and still named that way inside its contracts) runs its exchange through one monolithic contract, CrocSwapDex at 0xAaAaAAAaA24eEeb8d57D431224f73832bC34f688 on Ethereum, which delegatecalls into sidecar proxies for trading, liquidity provision, and account bookkeeping instead of deploying a separate contract per pool. One of those sidecars, `ColdPath`, keeps a per-user ledger called surplus collateral: a user deposits ETH or a token once with depositSurplus (userCmd code 73) and can then draw on that internal balance across later calls without sending msg.value again, finishing with disburseSurplus (code 74) to withdraw whatever is left. That ledger is not the bug. It is the plumbing that let the attacker chain thirteen swaps, a mint, and a harvest inside one transaction funded by a single flash loan.

The missing check: harvest skips the mint-timestamp lock

The actual gap sits in a different sidecar. `WarmPath.harvest`, reachable through userCmd callpath 2 with code 5 (HARVEST_LP in the `ProtocolCmd` library), calls `PositionRegistrar.harvestPosLiq` to pay out a concentrated liquidity position's accumulated fee mileage. harvestPosLiq never calls assertJitSafe. Full or partial withdrawal of a position, through burnPosLiq, does call it, checking the position's timestamp_ against the pool's jitThresh to stop liquidity that shows up only to catch a single trade's fee and then leave. A position can be minted and have its fee mileage harvested in the same block, in the same transaction, with no dwell time enforced at all.

Thirteen grid steps, a narrow mint, and an immediate harvest

The attack contract, deployed by 0x0000000000037E625B2502C26029Aea237f102aF at 0xAAC14D196A9E27923A92D8e87E3b6A5DCD4fEc1B, ran the following sequence:

  1. Flash-borrowed 50 WETH and 1 base unit of USDC (0.000001 USDC) from the Balancer Vault and unwrapped the WETH to native ETH.
  2. Deposited the 50 ETH as surplus collateral on CrocSwapDex (code 73), consuming msg.value once for the rest of the transaction.
  3. Called the hot-swap path thirteen times on the ETH/USDC pool (pool index 420), each call walking the price up by an 800-tick grid step, moving the curve roughly 10,400 ticks from where it started, funded out of the surplus balance rather than fresh transfers.
  4. Minted a 32-tick-wide concentrated range at the new price (MINT_RANGE_LIQ_LP, callpath 2) with 19.1 billion liquidity units, sized to dwarf whatever real liquidity already sat in that band.
  5. Ran one further swap, nudging the price 19 ticks inside that same 32-tick range, so an effectively uncapped notional swap paid its fee almost entirely to the position just minted.
  6. Called HARVEST_LP on that position, pulling its fee mileage out through harvestPosLiq with no resting-time check to block it.
  7. Swapped back down the full 10,400 ticks to the starting price.
  8. Disbursed the entire remaining surplus balance (code 74), wrapped it to WETH, repaid the Balancer loan, and swept anything left to the owner address.

What the chain shows

Etherscan's record of the attack transaction, 0xb2fc668c42623261074de6fc30d583efede2b0e20d7aded42b7b634f9322ff52, shows CrocSwapDex paying out 83.72 WETH to the attack contract. Against the 50 WETH owed back to Balancer, that leaves 33.72 WETH. The same transaction shows 55,913.81 USDC pulled from the pool and routed through Uniswap V3 via the Universal Router for 34.13 ETH. The two remainders add to 67.85 ETH, the net loss DeFiHackLabs reports for the incident after the final USDC-to-WETH conversion and ETH forwarding its proof of concept describes. No dollar figure for the loss appears in any source read for this incident.

No public response, and a separate incident later

No post-mortem, bounty notice, or compensation announcement from Ambient Finance about this transaction is available. The protocol did face a separate, later incident in which its website's nameservers were hijacked to serve a phishing frontend, attributed by the security firm Blockaid to the group Inferno Drainer. That attack touched only the front end and left the contracts untouched, and it is a different incident from the accounting gap exploited here.

The closest match on this site for mechanism is KolanHook, where a flash loan from Balancer funded a spot-price walk on a Uniswap V4 pool with no TWAP check, mispositioned escrowed liquidity at the manipulated price, and reversed the swap back through that liquidity before repaying the loan. Ambient's version swaps a mispositioned buy window for a harvestable position, and an ungated accept call for a missing assertJitSafe check, but the shape is the same: flash loan, manipulate price, exploit a freshly placed position, reverse, repay.

The fix is narrow: either extend assertJitSafe's dwell-time check to harvestPosLiq, the way it already applies to burnPosLiq, or scale the fee mileage a freshly minted position can harvest by how long it has actually rested rather than paying out the full raw delta since mint.

Sources read (11)

Other exploits

Query every incident yourself — free, no signup

Updated 9 Nov 2026. Figures are as reported by the sources listed above and are not independently verified.