Nerve Finance Hack
What happened
On November 15, 2021, an attacker drained the fUSDT and UST metapools of Nerve Finance's bridge pools on BNB Chain and made about 900 BNB, which Halborn valued at about $537,000.
Nerve's metapools used Saddle Finance's MetaSwap code. Nine days earlier the same bug had been exploited in Synapse's nUSD metapool. In MetaSwap, swap and swapUnderlying value the base-pool LP token differently. swapUnderlying accounts for the Nerve 3pool's virtual price, but swap ignores it. So swap always underprices the 3pool LP token, and a trader receives more LP tokens than they should for their fUSDT.
The attacker used 50,000 BUSD flash loans from ForTube and repeated a five-step loop in around 200 transactions. In one round, 50,000 BUSD became 50,351 fUSDT, then 36,959 Nerve 3pool LP tokens, then 37,071 BUSD, and finally 51,494 fUSDT, about 1,140 more fUSDT than the round started with.
Example attack transaction: 0xea95925eb0438e04d0d81dc270a99ca9fa18b94ca8c6e34272fc9e09266fcf1d
How it happened
- The attacker took a 50,000 BUSD flash loan from ForTube and swapped it for 50,351 fUSDT.
- It called
swapon the fUSDTMetaSwappool and received 36,959 Nerve 3pool LP tokens. Becauseswapignores the 3pool virtual price, this was more LP than the fUSDT was worth. - It called
removeLiquidityOneCoinon the Nerve 3pool and redeemed the LP tokens for 37,071 BUSD. - It called
swapUnderlyingon the metapool to trade the BUSD for 51,494 fUSDT. This path does use the virtual price, so the round ended with more fUSDT than it started with. - It repeated the loop around 200 times across the fUSDT and UST metapools until their liquidity was gone, repaid the loans and kept about 900 BNB.
Protocol details
Evidence
- report Report halborn.com
- report Report blocksecteam.medium.com
- report Synapse Protocol Medium feed: 11/06/2021 Post-mortem of nUSD Metapool Exploit synapseprotocol.medium.com
- transaction bscscan.com transaction 0x0348…32a6 bscscan.com
- transaction bscscan.com transaction 0x16ec…6581 bscscan.com
- transaction bscscan.com transaction 0x17cd…4e7c bscscan.com
- transaction bscscan.com transaction 0x2dbc…067b bscscan.com
- transaction bscscan.com transaction 0x55bd…0a53 bscscan.com
- transaction bscscan.com transaction 0x7f6b…b3c1 bscscan.com
- transaction bscscan.com transaction 0xcf43…ec90 bscscan.com
- transaction bscscan.com transaction 0xe5a0…a1f4 bscscan.com
- transaction bscscan.com transaction 0xea95…cf1d bscscan.com
- address bscscan.com address 0xd547…9228 bscscan.com
- analysis DeFiLlama defillama.com
- analysis The analysis of Nerve Bridge Security Incident (BlockSec) blocksec.com
- analysis Explained: The Synapse and Nerve Bridge Hacks (November 2021) halborn.com
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.