Hundred Finance Hack
What happened
On April 15, 2023, an attacker drained about $7.4 million from Hundred Finance's lending markets on Optimism. Hundred is a Compound v2 fork. Its hWBTC market held almost no supply, and the attacker used that to push the hWBTC exchange rate so high that a couple of wei of hWBTC counted as collateral worth hundreds of WBTC. They borrowed against it and then pulled out the WBTC they had donated, helped by a rounding-down bug when redeeming.
The attacker, 0x155da45d374a286d383839b1ef27567a15e67528, ran the main exploit in tx 0x6e9ebcdebbabda04fa9f2e3bc21ea8b2e4fb4bf4f4670cb8483e2f0b2604f451 through attack contract 0x978d0ce23869ec666bfde9868a8514f3d2754982. A second transaction was 0x15096dc6a59cff26e0bd22eaf7e3a60125dcec687580383488b7b5dd2aceea93. rekt.news reports that about $5.4M was bridged to Ethereum and swapped or put into Curve, while about $0.9M stayed on Optimism. Hundred offered a $500k bounty for identifying the attacker, sent the attacker an on-chain message to negotiate, and warned other Compound forks that the bug was a general flaw in the code, not specific to its deployment. This was Hundred's second exploit, bringing its total losses to about $16.9M.
How it happened
- The attacker flash-loaned 500 WBTC from Aave V3.
- They redeemed the hWBTC they already held, taking the market's hWBTC
totalSupplyto zero. - They minted 200 hWBTC with 4 WBTC, then redeemed all but 2 wei of hWBTC. Now 2 wei was the whole supply.
- They sent the flash-loaned WBTC directly to the hWBTC contract without calling
mint(). Because the exchange rate is based on the contract's cash balance (getCash()) divided by supply, this made each hWBTC wei worth a huge amount of WBTC. - With that 2-wei hWBTC as collateral, they borrowed other assets, including about 1,021 ETH.
- They called
redeemUnderlyingto take the donated WBTC back. The hWBTC to burn worked out to about 1.99999, buttruncate()rounded it down to 1 wei, so the withdrawal left collateral on the books. - The remaining position was liquidated, the flash loan was repaid, and the borrowed assets were kept as profit. The attacker repeated this across Hundred's markets.
Protocol details
Security review history
- Chainsulting View report
Evidence
Proof of concept
1 availableSources
- report Twitter/X Alert twitter.com
- report Twitter/X Alert twitter.com
- report Twitter/X Alert twitter.com
- report Hundred Finance - REKT 2 rekt.news
- report @HundredFinance incident report twitter.com
- report @PeckShieldAlert incident report twitter.com
- report @HypernativeLabs incident report twitter.com
- transaction Optimism transaction 0x6e9ebcde...f451 optimistic.etherscan.io
- transaction optimistic.etherscan.io transaction 0x1509…ea93 optimistic.etherscan.io
- address optimistic.etherscan.io address 0x155d…7528 optimistic.etherscan.io
- address optimistic.etherscan.io address 0x284a…9aac optimistic.etherscan.io
- address optimistic.etherscan.io address 0x978d…4982 optimistic.etherscan.io
- address optimistic.etherscan.io address 0xd340…702b optimistic.etherscan.io
- analysis Blog reference blog.hundred.finance
- analysis DeFiLlama defillama.com
- analysis #6: Hundred Finance Incident: Catalyzing the Wave of Precision-Related Exploits in Vulnerable Forked Protocols blocksec.com
- analysis Explained: The Hundred Finance Hack (April 2023) halborn.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.