Brahma Finance Hack
What happened
On November 9, 2022, an attacker stole 89,343.76 USDC from three users of Brahma's TopGear vault (brahTOPG) on Ethereum. The users had approved the vault's Zapper contract to spend their USDC. The Zapper's zapIn function took a caller-supplied token, swap target and call data and did not validate them, so the attacker could make it perform an arbitrary external call that pulled USDC from wallets that had approved it. The vault itself was not drained; only the three approving wallets lost funds.
About four minutes later the attacker swapped the 89,343.76 USDC for about 89,335 DAI on Uniswap V3. SlowMist put the loss at $89,879.
**Block data**
- Attacker:
0x6fa00a7324dc293ea8ecf56fe3143104494c4213 - Attack contract:
0x60032a41726241499b0c626c836c9099cb895c05 - Exploit tx:
0xeaef2831d4d6bca04e4e9035613be637ae3b0034977673c1c2f10903926f29c0 - Swap to DAI:
0x4249331dd223230b701331a4ee36ec4bb37032435da51ec53368bc1d224181a0
How it happened
- The attacker's EOA called its attack contract, which checked a victim's USDC balance.
- The contract called the Zapper's
zapIn, passing a fake token asrequiredTokenand attacker-builtcallDatafor the external call toswapTarget. - Because the Zapper did not validate these values, it made the attacker-specified call, which moved the victim's approved USDC to the attack contract.
- The contract repeated this for three wallets (about 79,680, 5,365 and 4,299 USDC) and forwarded the 89,343.76 USDC to the attacker's EOA in the same transaction.
- The attacker then swapped the USDC for DAI on Uniswap V3.
Protocol details
Evidence
- report Decoding Brahma (brahTOPG) Smart Contract Vulnerability (Neptune Mutual) medium.com
- report SlowMist on X: brahTOPG attacked on November 9, 2022 twitter.com
- transaction Etherscan transaction 0xeaef2831...29c0 etherscan.io
- transaction Etherscan transaction 0x4249331d...81a0 (USDC to DAI swap) etherscan.io
- address Etherscan: Zapper contract 0xd248b30a...446d etherscan.io
- address etherscan.io address 0x6003…code etherscan.io
- address etherscan.io address 0x6fa0…4213 etherscan.io
- analysis DeFiLlama defillama.com
- analysis Weekly Blockchain Security Watch (Fairyproof) fairyproof.substack.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.