Worked example · 2022-07
Nirvana Finance — flash-loaned USDC used to manipulate the ANA price, treasury drained — Solana — 2022-07-28
Summary
On 2022-07-28 an attacker took a flash loan of about $10M USDC from Solend, used it against Nirvana's program to move the ANA price, took roughly $3.5M of USDT out of the Nirvana treasury, repaid the loan and bridged the proceeds from Solana to Ethereum through Wormhole (The Block, Cointelegraph, CertiK). The Block reports that Solend said its own protocol was not affected. Nirvana asked the attacker to return the funds and offered a $300,000 white-hat bounty (Cointelegraph).
Timeline (UTC)
Stages: Flaw (price handling in Nirvana's program), Take (flash loan, price move, sale to treasury), Money (USDT to USDCet, Wormhole to Ethereum), Response. No source opened for this entry gives block times; rows carry dates only.
| When | What happened | OAK |
|---|---|---|
| Before 2022-07-28 (undisclosed) | Nirvana's program lets a caller move the ANA price inside one transaction. The exact flawed function is not given in the opened sources. | — |
| 2022-07-28 | The attacker borrows about $10M USDC from the Solend main pool vault (Cointelegraph; CertiK gives $10,250,000 USDC) | T9.002 |
| 2022-07-28 | Per OtterSec (relayed by Cointelegraph), an attacker program raises ANA from $8 to $24 using the borrowed funds; ANA is minted at that price and sold to the treasury for about $3.49M USDT (Cointelegraph, CertiK). Exploit tx on Solana: LyUnvdY9KBQiVRFqmSzGUfCuPGqYX1xNHCWLWxWZ4MvgLcNis2Kui6T25Ayai5UzpTAFkSRSgriKb3pM8tAoeR5 |
T9.002 |
| 2022-07-28 | The attacker repays the flash loan, converts USDT to USDCet and moves it to Ethereum over Wormhole (Cointelegraph, CertiK). Solana conversion tx 5yF3VH82Wa3TC4zxdzxmEq4jL3EvSPovHVLG3XASzjHNpiyeSt1t2FF6WrHN94hBJc4AAHb3sUWgsAsupSRuszF7; Ethereum tx 0xb5a89c01da58ec7ec8a4b0d0361d8f1719966d4deceaa01efc1362601a76339c |
— |
| 2022-07-28 | Nirvana says it was hacked, that the fault is its own program and not Solend's, and asks for the treasury back (Cointelegraph). Solend says it was in contact with Nirvana and not affected (The Block). Nirvana offers a $300,000 bounty and an end to the investigation into the attacker's identity (Cointelegraph; CertiK dates the thread to 21:00 UTC on 2022-07-28) | response |
| 2022-07-31 | Nirvana publishes an official statement on Medium (per CertiK; OAK could not open that page). CertiK relays that Nirvana says it fixed the code and flagged the wallets involved | response |
| At CertiK's writing (undated) | The funds remain in Ethereum wallet 0xB9AE2624Ab08661F010185d72Dd506E199E67C09 and no return is reported (CertiK) |
— |
Key addresses (as printed in full by CertiK):
- Attacker (Solana) —
76w4SBe2of2wWUsx2FjkkwD29rRznfvEkBa1upSbTAWH - Nirvana treasury (Solana) —
CxuuSEv67PzNkMxqCvHeDUr6HKaadoz8NhTfxbQSJnaG - Nirvana program (Solana) —
nirkXSE28jCQoK8SmKWqxXz3L9vbSRGKS24iYJj8Aeo - Solend main pool vault (flash-loan source) —
DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby - Receiving Ethereum wallet —
0xB9AE2624Ab08661F010185d72Dd506E199E67C09
Root-cause evidence
- Technique: OAK-T9.002
- Source: https://www.certik.com/blog/nirvana-finance-incident-analysis; https://cointelegraph.com/news/solana-based-stablecoin-nirv-drops-85-following-3-5m-exploit; https://www.theblock.co/news/regulation/2022-07-28-solana-stablecoin-nirvana-sinks-90-amid-3-5-million-flash-loan-exploit-159975
- Source type: security-firm
- Confidence: reported
- Evidence: All three sources agree on the Solend flash loan, the date, the roughly $3.5M taken and the Wormhole bridge to Ethereum. They disagree on how the price was moved. CertiK says the attacker manipulated inputs to Nirvana's program and bought ANA at an artificially low price. Cointelegraph, citing OtterSec, says the price was raised from $8 to $24 and ANA was minted and sold at that price. The Block says the oracle feed was manipulated. Nirvana's own post-mortem was not opened, so the exact flawed function is undisclosed here and the mechanism is not settled.
Public references
- CertiK, "Nirvana Finance Incident Analysis": https://www.certik.com/blog/nirvana-finance-incident-analysis
- Cointelegraph, "Solana-based stablecoin NIRV drops 85% following $3.5M exploit" (2022-07-29): https://cointelegraph.com/news/solana-based-stablecoin-nirv-drops-85-following-3-5m-exploit
- The Block, "Solana stablecoin Nirvana sinks 90% amid $3.5 million flash loan exploit" (2022-07-28): https://www.theblock.co/news/regulation/2022-07-28-solana-stablecoin-nirvana-sinks-90-amid-3-5-million-flash-loan-exploit-159975