Critical crypto-js PRNG flaw exposed wallet seeds and cryptographic keys
Vulnerability Disclosure · 2 sources · Updated 4mo ago · First seen Aug 7, 2026

A critical vulnerability tracked as CVE-2026-71851 was disclosed in the JavaScript cryptography library crypto-js, affecting versions prior to 4.0.0. The flaw lies in CryptoJS.lib.WordArray.random(), which used a custom Multiply-With-Carry pseudorandom number generator seeded with Math.random() rather than a cryptographically secure operating-system entropy source. That design sharply reduced the effective entropy of supposedly strong random outputs, making generated keys, initialization vectors, and other secrets potentially predictable or reconstructable.
The weakness is especially serious for cryptocurrency wallets and decentralized applications that used the function to generate entropy for BIP39 recovery phrases, because attackers may be able to recover private keys and steal funds from affected wallets. Reports assign the issue a CVSS v3.1 score of 9.0 and map it to CWE-331, CWE-338, and CWE-334. The issue is fixed in crypto-js 4.0.0, and secure alternatives cited for randomness generation include browser window.crypto.getRandomValues() and Node.js crypto.randomBytes().


