Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.0

CVE-2026-71851: CryptoJS versions before 4.0 generate weak random keys

CVE-2026-71851 · published 3 months ago
Summary

The CryptoJS JavaScript library, in versions before 4.0, creates random numbers using a simple math function instead of a secure source. This makes keys and recovery phrases easier for attackers to guess, risking loss of funds in wallet apps that rely on it. Upgrade to CryptoJS 4.0 or later to use proper cryptographic randomness.

What to do
  • Update evanvosberg crypto-js to version 4.0.0.
  • Update evanvosberg crypto-js to version 3.3.0-aikido.4.
  • Update rootio @rootio/crypto-js to version 3.3.0-root.io.4.
Affected software
Ecosystem VendorProductAffected versions
npm evanvosberg crypto-js < 4.0.0
Fix: upgrade to 4.0.0
Root:npm evanvosberg crypto-js < 3.3.0-aikido.4
Fix: upgrade to 3.3.0-aikido.4
Root:npm rootio @rootio/crypto-js < 3.3.0-root.io.4
Fix: upgrade to 3.3.0-root.io.4
Debian:11 debian cryptojs All versions
Debian:12 debian cryptojs All versions
Original advisory text
crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain
crypto-js is a JavaScript library of crypto standards. Versions of crypto-js prior to 4.0.0 generate randomness in CryptoJS.lib.WordArray.random() using a custom variation of the Multiply-With-Carry pseudorandom number generator, seeded from Math.random(), instead of a cryptographically secure source. This generator was introduced in version 3.1.2-4 and remained present in nearly every 3.x release. Nominal requests for 128 or 256 bits of entropy through this function produce effective search spaces of approximately 2 to the 39th and 2 to the 47th possibilities, small enough to enumerate on commodity hardware. Downstream wallet applications that used CryptoJS.lib.WordArray.random() as the entropy source for BIP39 recovery phrases are affected, and an attacker who enumerates the reduced output space can recover the resulting private keys and control the associated funds. This issue is fixed in version 4.0.0.
Fix within
Internet-facing 14 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit
  • Gives an attacker full control
Severity
9.0 Critical
Exploitation
<1% chance of attack within 30 days
Type
CWE-331Insufficient Entropy
CWE-334Small Space of Random Values
CWE-338Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Timeline
Published7 Aug 2026
Updated7 Nov 2026
First seen7 Aug 2026
Track software like this
Free during beta