Rubic Hack
What happened
On December 25, 2022, an attacker drained USDC from Rubic users who had approved the RubicProxy contract on Ethereum. About $1.42 million was lost from roughly 49 wallets. Rubic had added the USDC token contract itself to RubicProxy's list of trusted routers. Because routerCallNative() forwarded arbitrary calldata to any whitelisted router, the attacker could make RubicProxy call USDC's transferFrom on users' approvals.
The attacker swapped the USDC to WETH on Uniswap, unwrapped it and sent about 1,100 ETH to Tornado Cash. Rubic paused its routing contracts a little over an hour after the attack started, told users to revoke approvals, and compensated affected users who contacted support. Revoke.cash notes that USDC still sits on the router whitelist of a paused contract, so old approvals remain risky if the contracts are ever unpaused.
How it happened
- Rubic added the USDC token address to the RubicProxy router whitelist (live page cites the add-router transaction
0x30679e7b6b410fb78368f5fb6e4c203e44d81c66ae9014c797e40856be1bbe66). - The attacker called
routerCallNative()with USDC as the router and calldata encodingtransferFrom(victim, attacker, amount). The whitelist check passed because USDC was listed. - RubicProxy made the call as the approved spender, so USDC moved from each victim that had approved RubicProxy to the attacker's contract.
- The attacker swapped the USDC to WETH, unwrapped it and moved about 1,100 ETH through Tornado Cash.
Protocol details
Security review history
- CertiK View report
- Fairyproof View report
Evidence
Proof of concept
1 availableSources
- report Twitter/X Alert twitter.com
- report Twitter/X Alert twitter.com
- report @peckshield incident report twitter.com
- report @CryptoRubic incident report twitter.com
- transaction etherscan.io transaction 0x3067…be66 etherscan.io
- transaction etherscan.io transaction 0x6551…6e56 etherscan.io
- transaction etherscan.io transaction 0x9a97…7d46 etherscan.io
- address etherscan.io address 0x001b…6ee9 etherscan.io
- analysis Web Archive archive.ph
- analysis DeFiLlama defillama.com
- analysis Rubic Exchange Hack Analysis - Whitelisting does not always work effectively blog.solidityscan.com
- analysis Rubic DEX aggregator hack leads to $1.4m of user funds stolen crypto.news
- analysis 2022 Rubic Hack: Check If You're Affected revoke.cash
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.