CVE-2026-71851: brix crypto-js insufficient entropy in WordArray.random

CVE-2026-71851 · Severity: critical · CVSS 9 · Published 2026-08-07

A popular JavaScript library used for cryptography contains a flaw in how it generates random numbers. This weakness makes it possible for attackers to guess security-sensitive values, such as recovery phrases for cryptocurrency wallets. In practice, this has already led to the theft of millions of dollars in digital assets because the 'random' keys were not sufficiently unpredictable.

Technologies: crypto-js (npm). Vendors: npm.

Quick answers

Is CVE-2026-71851 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-71851 being exploited in the wild.
How severe is CVE-2026-71851?
Critical severity, with a CVSS score of 9, published 7 August 2026.
Which products and versions are affected?
crypto-js (npm) < 4.0.0, SEMVER:introduced=0,fixed=4.0.0.
Is there a fix for CVE-2026-71851?
Yes. crypto-js (npm): upgrade to 4.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-71851 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-71851?
Check whether you run crypto-js (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • crypto-js (npm): upgrade to 4.0.0 or later
    npm install crypto-js@4.0.0

Technical details

The vulnerability exists in the `CryptoJS.lib.WordArray.random()` function, which used a custom Multiply-With-Carry PRNG seeded by the non-cryptographic `Math.random()`. This implementation results in significantly reduced entropy; for example, a requested 256-bit value may only have an effective search space of 2^47, which is susceptible to brute-force enumeration on modern hardware. Attackers can exploit this to recover BIP39 recovery phrases and private keys in downstream applications like crypto wallets. The issue was resolved in version 4.0.0 by migrating to native platform cryptographic APIs (Web Crypto API or Node.js crypto module). Note that rotating the library does not fix previously generated secrets, which must be manually replaced.

Affected products

  • brix crypto-js < 4.0.0

Identifiers

  • CVE-2026-71851
  • GHSA-rg76-677x-56q9

Timeline

  • 2026-08-05: disclosed: Initial disclosure by Coinspect
  • 2026-08-07: advisory: GitHub Advisory published
  • 2020-05-20: patched: Version 4.0.0 released (historical context)

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.