Introduction
A vulnerability in the widely used JavaScript cryptography library, CryptoJS, has resulted in significant financial losses, affecting five cryptocurrency wallet applications. Coinspect, a blockchain security firm, pinpointed CryptoJS.lib.WordArray.random() as the weak random number generator responsible for the breaches. This flaw led to the generation of predictable recovery phrases, facilitating the theft of approximately $5.7 million across multiple incidents since late May.
Identified Affected Wallets
Coinspect has confirmed that five wallet applications utilized the vulnerable random number generator for recovery phrase generation. These include RRWallet, Bexo Wallet, NanChat, Bitcoin Libre, and Milo. While Bexo and NanChat have since issued fixes, RRWallet and Milo remain discontinued without any updates. Bitcoin Libre addressed the issue with a release in July 2024.
The firm highlighted the challenges in identifying all impacted wallets, as some were removed from app stores or updated with patched releases, making older versions inaccessible for examination.
Technical Analysis and Impact
The vulnerability in CryptoJS significantly reduced the entropy of generated recovery phrases, making them susceptible to attacks. While 128- and 256-bit entropy should provide extensive security, the flawed generator reduced them to manageable levels for enumeration on standard hardware. Coinspect’s analysis revealed that the flaw was exploited during two major draining events, resulting in losses from numerous cryptocurrency accounts.
Despite initial fixes in CryptoJS releases 3.2.0 and 3.2.1, the weak code was reintroduced in version 3.3.0, only to be permanently rectified in version 4.0.0. The presence of the flawed function alone does not necessarily compromise security; exploitation occurs only if it is used to generate sensitive values.
Future Outlook and Recommendations
Coinspect advises users of affected wallets to generate new recovery phrases securely and transfer their funds to ensure asset safety. The security firm continues to monitor blockchain data to identify further vulnerabilities and provide guidance to wallet users.
As of now, only NanChat has issued a public advisory, urging users to migrate their wallets to secure versions. Coinspect’s public checker tool allows users to verify if their wallet addresses are at risk, underscoring the ongoing need for vigilance and secure practices in the cryptocurrency space.
Conclusion
The CryptoJS vulnerability underscores the critical importance of robust cryptographic practices in cryptocurrency applications. As the industry continues to evolve, users and developers must remain proactive in addressing potential security threats to safeguard digital assets.
