# Thetanuts index vault: claim/mint accounting flaw drains 105k USDC

Thetanuts index vault mispriced component-share claims vs mint, letting a flash-loaned share position claim components then remint shares at zero cost to drain 105k USDC.

- Payout: Real-world hack
- Severity: critical
- Program: Thetanuts
- Credited: DeFiHackLabs
- Disclosed: 2026-06-15
- Write-up quality: 7/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-06/Thetanuts_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20260615-thetanuts
- Tags: domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:critical tech:evm tech:solidity technique:chained vuln:accounting-error vuln:business-logic vuln:flash-loan vuln:oracle-manipulation

**Target:** ERC4626-style index vault with component vaults (Ethereum mainnet)
**Root cause:** Index vault's claim() releases component-vault shares proportional to index shares while mint() prices new index shares without accounting for the value already withdrawn, so shares can be claimed then re-minted cheaply.
**Steps:**
1. Flash-loan nearly all index-vault shares held by Aave's aToken via `aave.flashLoan` with asset=INDEX_VAULT, amount=balanceOf(AAVE_INDEX_TOKEN)-3
2. In executeOperation, call `indexVault.claim(borrowedShares)` to receive component-vault shares (BTC/ETH/AVAX/BNB/MATIC)
3. Loop `indexVault.mint(mintAmount)` until balance >= repaymentShares, exploiting zero-cost mint after claim
4. Approve Aave and repay borrowed shares + premium
5. Call `initWithdraw(shares)` on BTC and ETH component vaults to convert to USDC
6. Forward USDC and residual AVAX/BNB/MATIC component shares to profit receiver
**Exploitation:** Flash-loan the index-vault share supply from Aave, claim underlying component-vault shares, then remint replacement index shares at near-zero cost because the vault's accounting no longer reflects the withdrawn components; repay Aave with reminted shares and keep the USDC plus residual component shares.
**Insight:** For index/fund vaults that both claim() underlying components and mint() new shares, check whether mint pricing is recomputed after claim — if totalAssets isn't decremented on claim, shares can be recycled to extract components for free.
