Thetanuts Finance
- Project's own code
- Source not public before the hack
Why it happened
Attack class: Logic errorEach index mint ran a zero-value transferFrom hook that credited cash-secured-put vault shares with no USDC deposit.
What would have stopped it
- Require that any share credited through the index vault's mint path is backed by a real, transferred deposit.
- Reconcile each vault's total shares against its actual collateral on every mint and withdraw.
Not scored before the exploit
BlackHart had not scored Thetanuts Finance before this exploit.
An attacker stole about $105,000 from Thetanuts Finance, an options vault protocol, on Ethereum. They abused how the protocol's index vault tracked shares: by taking a flash loan and calling the vault's mint function 37 times, they inflated their balance in the underlying put-option vaults without ever depositing the matching USDC. They then redeemed the fake Bitcoin and Ether vault shares for about $105,000 of real USDC and repaid the flash loan. There is no tradeable NUTS governance token, so token holders were not affected; the loss came out of vault deposits.
The attacker deployed an exploit contract that flash-borrowed index tokens, then called mint 37 times on the Thetanuts index vault. Each mint credited shares in the underlying Bitcoin put vault and Ether put vault with no USDC behind them. The attacker then redeemed those shares for about $105,000 USDC and repaid the flash loan.
Attack flow
All 5 on-chain stepsThe attack in 3 steps. Step 1, Flash loan + inflate: Thetanuts index + 5 sub-vaults (source), Exploit contract (attacker). Step 2, Mint loop x37: Shares inflated across 5 sub-vaults (hub), about $105K reached this step. Step 3, Redeem: Exploit contract (exit).
Step 1: Flash loan + inflate
- SourceThetanuts index + 5 sub-vaultsTN-IDX-USDC-PUT over 5 CSCPv1 vaults~ $105K drainable, dominant0xc2c3ae0a...b86ac7
- AttackerExploit contractflash-borrows index tokensdrives the mint loop0xaf3a0fdb...2f2299
Step 2: Mint loop x37
- HubShares inflated across 5 sub-vaultsmint(2) called 37 times~49.7K BTC + ~24K ETH vault shares0xbba9...9fec
Step 3: Redeem
- ExitExploit contractinitWithdraw BTC + ETH vaults105,471.50 USDC, flash loan repaid0xaf3a0fdb...2f2299
Why each step worked
- mint() runs a zero-value transferFrom hookeach index mint credits sub-vault shares via transferFrom(attacker, index, 0) with no matching USDC deposit
- Aave flash loan of index tokens0x2ca7641b841a79cc70220ce838d0b9f8197accda
- Sub-vault accounting trusts the index hookshares minted on credit, never reconciled against real collateral
- No deposit check on the mint path37 mints credited share balances for free; nothing required USDC to back them
- Illiquid AVAX, BNB, MATIC shares stolen but unredeemedmissing controlthose sub-vaults had no liquidity to cash out, so only the BTC and ETH shares were realized
Full forensic detail
Step-by-step reconstruction, root cause, counterfactuals, remediation, and disclosure timeline.
Exploit anatomy
Root cause
Thetanuts' TN-IDX-USDC-PUT index vault sits on top of five cash-secured-put sub-vaults (BTC, ETH, AVAX, BNB, MATIC). The index vault's mint path updates the caller's position in each sub-vault through an accounting hook implemented as a zero-value transferFrom on each sub-vault. Because that hook credited share accounting while moving no tokens, repeatedly calling mint inflated the caller's sub-vault share balances with no matching USDC deposit. The attacker flash-borrowed index tokens from Aave, looped mint 37 times to inflate their Bitcoin and Ether sub-vault shares, redeemed those shares for about 105,471 USDC, and repaid the flash loan. The fix is to back every credited share with a real deposit and reconcile shares against collateral.
Prevention analysis
The zero-value hook would credit nothing, so 37 mints could not inflate a balance, and there would be nothing to redeem.
The inflated shares would fail the check and the transaction would revert before any USDC left the vaults.
The whole attack runs inside a single flash-loaned transaction, so a one-block delay between mint and withdraw would break it.
Similar incidents
Vaults that credit or price shares without verifying the underlying deposit are repeatedly drained, often with a flash loan to amplify. Same root cause: share accounting decoupled from real collateral.
Multiple vault hacks used a flash loan to inflate an internal balance, then redeemed it for real assets in the same transaction. Same shape as this exploit.
Remediation
Timeline
Get your protocol scored across 12 dimensions, or request ongoing coverage.