Qubit Finance Hack
Incident Overview
Qubit Finance lending protocol was hacked due to smart contract vulnerability. The hacker minted $xETH tokens to steal 80,000,000 worth of $BNB
Qubit Finance is DeFi protocol for lending and borrowing on both Ethereum and Binance SmartChain. The protocol confirmed a hack on Twitter, 206,809 $BNB was stolen which was worth 80,000,000 $USD up to that time. The attack flow is below:
The attacker:
- funded his wallet with 0.8887725 ETH from Tornado Cash
- sent 16 deposit transactions to QBridge of Ethereum
- sent 16 voteProposal transactions to QBridge contract of BSC by Qubit Relayer
- a number of $xETH tokens were minted by 16 voteProposal transactions, and liquidity in Qubit was withdrawn using this as collateral.
The attacker called the QBridge deposit function on the Ethereum network, which calls the deposit function QBridgeHandler. QBridgeHandler should receive the $WETH token, which is the original tokenAddress, and if the person who performed the tx does not have a $WETH token, the transfer should not occur.
tokenAddress.safeTransferFrom(depositer, address(this), amount);
In the deposit function above, tokenAddress is 0, so safeTransferFrom didn’t fail and the deposit function ended normally regardless of the amount value. Additionally, tokenAddress was the $WETH address before depositETH was added, but as depositETH is added, it is replaced with the zero address that is the tokenAddress of ETH.
In summary, the deposit function was a function that should not be used after depositETH was newly developed, but it remained in the contract, which allows the attacker to use this to steal the funds.
Incident Report
Protocol Information
What the Attacker Needed to Succeed
Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.
What Auditors Should Check
If you're auditing a protocol with similar architecture to Qubit Finance, these are the critical security checks that could have prevented this incident (January 2022).
- Verify all logic paths related to Other are guarded by proper access controls and input validation
- Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs
Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.
Free TrialSources & References
-
01
Source 1 https://archive.is/0Ubc7
Learn to Prevent the Next Qubit Finance
The Qubit Finance hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.