Skip to main content

What Happened

BlockSec’s analysis describes the September 2, 2025 Bunni exploit as repeated small withdrawals compounding a rounding error into an approximately $8.4 million drain. The affected liquidity calculation and subsequent swaps must be considered together; a single small error is not the complete attack mechanism. BlockSec incident analysis.

Attack Mechanism

The withdrawal logic updated the idle balance by subtracting a rounded-down proportional amount. Active balance depended on the remaining accounting, so a rounding choice that appeared conservative for one withdrawal was exploitable when repeated near very small balances. The reported Ethereum sequence first moved the pool into a low-active-balance state, then made many tiny withdrawals. The USDC active balance fell from 28 wei to 4 wei while the burned shares represented only a small fraction of the pool. Subsequent swaps changed which liquidity estimate controlled pricing, allowing the attacker to trade against the distorted liquidity. The failure was compositional: the initial swaps created a rounding-sensitive state, repeated withdrawals accumulated the error, and later swaps extracted value. A single withdrawal’s error does not explain the whole attack. The policy below compares each withdrawal’s observed active-balance reduction with the reduction expected from burned shares, then adds excess reductions across the transaction. A one-wei allowance applied independently to 44 calls could allow 44 wei of drift; a transaction-wide budget does not reset for each call. The required accounting reader has an explicit interface: at a supplied snapshot it must return (shareSupply, active0, active1) for one selected pool. That reader must derive active balances from the target Bunni revision, including idle balances and rehypothecated assets. The assertion code is complete, but a Bunni-specific reader is still required; this is not a drop-in Bunni deployment.

Assertion Example

What This Check Covers

Use token-specific base-unit budgets; the example uses one budget for both assets for clarity. Only withdrawals for the reader’s selected pool may enter this calculation. Nested withdrawals can double-count changes, and swaps or fee realization inside withdrawals require a richer model. Test the full swap–withdraw–swap sequence as well as individual rounding boundaries.