本文へ移動
Contact

TECHFUND
Media

Hi AUDIT
2024/8/2

Deep Analysis of the $230M WazirX Exploit Incident

Author : Piyush shukla

On July 18, 2024, WazirX experienced a cyber attack targeting one of its multisig wallets, resulting in the theft of digital assets exceeding $230 million. The affected wallet was managed using Liminal’s digital asset custody and wallet infrastructure.

The Exploit

The attackers managed to [upgrade the multisig] wallet to a malicious version, allowing them to steal all the funds. This upgrade required signatures from three WazirX signers and one Liminal signer. Interestingly, instead of directly transferring the funds using the compromised signers, they upgraded the wallet to a version that no longer required WazirX or Liminal signatures. This suggests that the attackers didn’t have access to all the private keys. If they had, they would have simply transferred the funds directly, likely choosing a time when the signers were inactive rather than during active operations as they did.

The hacker’s accounts were initially funded by Tornado Cash, but they didn’t use Tornado Cash to its full extent.

Why Was WazirX's 45% Funds Stored in Liminal Wallets?

Liminal is a custody wallet service. Many times, wallets store their funds for better security. However, the decision to store 45% of users' funds in one single third-party wallet is questionable. According to WazirX, they used a multi-signature wallet to ensure that no single party, including Liminal, could initiate a transaction independently. 

What is a Multi-Signature Wallet and How Does It Work?

 A multisignature (multisig) wallet utilizes multiple private keys to access cryptocurrency assets or transfer them. Multisig wallets work by requiring two or more private keys to execute a transaction. Using a smart contract, the wallet owners agree to the access rules, including the minimum number of keys. If all these particular conditions are met, the transaction is possible.

How_MultiSig_Wallets_Work

Types of Multisignature Wallets

1.  1-of-2 Signatures : Two parties that trust each other can use this multisig wallet to share funds without requiring the authorization of the other.

2.  2-of-3 Signatures : This popular multisig wallet requires two private keys to execute a transaction. Typically, one key is online, another offline, and the third with a security company.

3.  3-of-5 Signatures : The key holders store four keys in different offline locations, and the fifth remains with the wallet provider or a security company for improved security. Access to crypto assets is possible if you can access two of the four offline keys.

How WazirX's Multi-Signature Wallet Structure Works

To provide context, it’s important to understand WazirX's wallet structure:

- The affected multisig wallet had six signatories: five managed by WazirX and one by Liminal.

- For any transactions in the contract, it required a total of four signatures: three managed by WazirX signers and a fourth by Liminal.

The Liminal signer acts as the last line of defense, verifying if a transaction is correct and authentic before signing. In this cyber attack, the malicious transactions involved signatures from three WazirX signers and one from Liminal, confirming the use of Liminal’s infrastructure.

Possible Scenarios

1. The laptops used by the WazirX signers were compromised, and they approved the transaction, which Liminal then approved because the WazirX signers had already done so.

2. The UI provided by Liminal was compromised.

Both WazirX and Liminal claim they weren’t compromised, but clearly, at least one of them was. It is worth noting that WazirX's infrastructure, including their website, hot wallets, and databases, were not impacted. Only the multisig was affected. If the hackers compromised three of the WazirX laptops, it becomes hard to believe that they couldn’t breach their infrastructure

Liminal also stated in their public statement that two malicious transactions were sent to Liminal, but they rejected them due to a signature mismatch. According to Liminal, the attackers initially sent only two valid signatures. When the attackers finally sent all three valid signatures to Liminal, they approved the final signature.

After two days of the hack, WazirX announced a bug bounty program, offering the attacker a 10% bounty ($23M) if they returned the stolen funds. However, a week later, there was no update on this offer.

Now , WazirX attempted to restore normalcy by returning the remaining 55% of the users' funds still available in the wallet. They also launched a poll to gather user opinions on fund management after the attack. This poll sparked controversy as it seemed to focus more on business interests rather than resolving users' fund issues. You can read more about the poll here: WazirX Poll Description.

Timeline of Events

Day 1: July 18, 2024 : The exploit occurs. WazirX responds to the community and makes an official announcement about the hack.

Day 2: July 19, 2024 : Deposits and withdrawals are temporarily paused. A police complaint is filed.

Day 3: July 20, 2024 : Public announcements are made, but no significant actions are taken.

Day 4: July 21, 2024 : WazirX launches a bug bounty program, offering the attacker a 10% bounty ($23M) if they return the stolen funds.

Day 5: July 22, 2024 : More public announcements are made, but no substantial progress is reported.

Day 6: July 23, 2024 : Minimal actions are taken to recover the lost funds.

Day 7: July 24, 2024 : An announcement is made to launch a poll for users.

 Day 8: July 25, 2024 : The situation remains largely unchanged, with both parties still denying any compromise of private keys.

 Day 9: July 26, 2024 : Another poll announcement is made.

 Day 10: July 27, 2024 : A customer poll is launched, but users are not satisfied with it as it appears more business-friendly than user-focused.

After ten days, the blame game between Liminal and WazirX continues, and the root cause of the hack remains undetermined.

Conclusion

WazirX made significant mistakes by not having proper security measures and a secure custody setup in the first place. They put too much trust in Liminal and did not conduct their own checks.

The ongoing blame game between WazirX and Liminal, with no clear understanding or acknowledgment of the root cause, exacerbates the situation.

Hi AUDIT

Hi AUDIT is a high speed, high quality, best price security audit service, providing automated audit SaaS and consulting for web3 startups.
View More