Worked example · 2023-08
Zunami Protocol price-manipulation drain via Curve pool — Ethereum — 2023-08-13
Summary
Zunami Protocol was a yield-aggregation protocol on Ethereum that issued the stablecoin UZD and the ETH-denominated zETH, backed by strategies that deposit into Curve and related venues. On 2023-08-13 an attacker exploited a price-caching weakness in the two products. Per Ackee, the attacker manipulated the LP price calculation in the MIMCurveStakeDao strategy by donating SDT tokens to it, the inflated price was cached for the whole block, and the attacker ran earlier operations in reverse order to profit; the zETH exploit took 26 WETH and the UZD exploit 1,178 WETH [ackeezunami].
CertiK's walkthrough of the UZD leg: flash loans from Uniswap V3 and Balancer, swaps through Curve pools into UZD and SDT, SDT sent to the strategy contract, SushiSwap prices pushed up via WETH/SDT and USDT/WETH swaps, a call to cacheAssetPrice() that raised the attacker's UZD balance from about 4.8M to 16.9M, unwinding of the price manipulation, swaps of the inflated UZD back through Curve, and repayment of about $32.4M of flash loans, leaving about 1,152 WETH [certikzunami]. UZD fell about 99% and zETH about 89% in the aftermath (reported by CryptoPotato in the search results; not separately fetched).
The attacker's proceeds were cashed out through Tornado Cash [merklezunami].
Realised extraction
Roughly 1,152-1,178 ETH (about $2.1M), depending on whether the figure is gross or after flash-loan repayment [certikzunami]. Laundered via Tornado Cash [merklezunami]; no recovery is reported in the cited sources.
T9.001 / T9.002 classification
The exploit is a price-manipulation attack in which the manipulated input was an internally computed, block-cached price rather than an external oracle feed (T9.001), funded atomically by flash loans (T9.002). The earlier-draft description of a Curve pool exchange rate acting as the protocol's oracle is not supported by CertiK or Ackee and was removed.
Timeline (UTC)
Read it as three stages. Get in: a price that could be pushed and then cached. Prepare: a Tornado-funded attack contract. Take: flash loans, a forced price cache, and the unwind. Times are from CertiK and Merkle Science.
| When | What happened | OAK |
|---|---|---|
| Before 2023-08-13 (undisclosed) | The MIMCurveStakeDao strategy prices its LP position from the SDT price and the SDT balance it holds, so donating SDT to it changes the price. UZD v1.1, launched without an audit, extended block-level price caching to totalSupply, balanceOf and allowance, so other contracts could read the cached price. HashEx had audited the strategy and did not find this (Ackee). |
T9.001 |
| 2023-08-13 (before the attack) | The attacker withdraws 10 ETH from Tornado Cash and uses it to create the attack contract, deployed from the attacker's EOA (CertiK). | T7.001 (funding) |
| 2023-08-13 about 22:30 | Attack starts (Merkle Science). One transaction flash-loans 7,000,000 USDT from Uniswap V3 and 7,000,000 USDC plus 10,011 WETH from Balancer (about $18.4M on the Balancer side) (CertiK). | T9.002 |
| same transaction | Loan funds buy UZD and crvUSD/crvFRAX positions on Curve, and 11 WETH buys 55,981 SDT which is sent to the strategy. On SushiSwap 10,000 WETH buys 58,042 SDT and 7,000,000 USDT buys 2,154 WETH, pushing the SDT price up. | T9.001 |
| same transaction | cacheAssetPrice() on UZD records the inflated price for the block. The attacker's UZD balance rises from about 4.87M to about 16.90M. |
T9.001 |
| same transaction | The SushiSwap swaps are reversed, the inflated UZD is sold on Curve (14,158,424 UZD for crvFRAX, 2,744,533 UZD for crvUSD), and flash loans of about $32.4M are repaid. The attacker keeps 1,152 WETH. The sequence runs twice: 1,178 ETH in total (CertiK). Ackee splits it into 26 WETH from the zETH leg and 1,178 WETH from the UZD leg. CertiK's analysed transaction: 0x0788ba222970c7c68a738b0e08fb197e669e61f9b226ceec4cab9b85abe8cceb. |
T9.002 / T9.001 |
| after 2023-08-13 (exact times undisclosed) | The proceeds are sent to the attacker's address and cashed out through Tornado Cash (Merkle Science, CertiK). | T7.001 (cash-out) |
| 2023-08-13 onward | Zunami asks users on Twitter not to buy zETH and UZD (Merkle Science). No recovery is reported in the cited sources. Ackee's post-mortem is dated 2023-08-31. | response |
Key addresses:
- Attacker EOA —
0x5f4C2…as given by CertiK (full address not published in the cited sources). - Analysed exploit transaction —
0x0788ba222970c7c68a738b0e08fb197e669e61f9b226ceec4cab9b85abe8cceb - Contract holding the total-holdings calculation —
0x2ffcc661011bec72e1a9524e12060983e74d14ce - SushiSwap SDT/WETH pair —
0x22def8cf4e481417cb014d9dc64975ba12e3a184 - SushiSwap WETH/USDT pair —
0x06da0fd433c1a5d7a4faa01111c044910a184553 - UZD contract —
0xb40b…as given by CertiK (full address not published); vulnerable strategy pool0x984…(full address not published).
Public references
[certikzunami]— CertiK, "Zunami Protocol Incident Analysis" (2023-08-16): https://www.certik.com/ko/blog/zunami-protocol-incident-analysis[ackeezunami]— Ackee Blockchain, "Zunami hack post-mortem: what happened?" (2023-08-31): https://ackee.xyz/blog/wp-json/wp/v2/posts/555[merklezunami]— Merkle Science, "Hack Track: Zunami Flow of Funds Analysis" (2023-08-17): https://www.merklescience.com/blog/hack-track-zunami-flow-of-funds-analysis