# CVE-2026-71851: crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain

> Insufficient entropy in crypto-js allows attackers to enumerate private keys and steal funds from downstream wallet applications.

- **Severity:** Critical 9.0 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Aug 2026
- **Updated:** 8 Aug 2026
- **Also known as:** DEBIAN-CVE-2026-71851, GHSA-rg76-677x-56q9, ROOT-APP-NPM-CVE-2026-71851, UBUNTU-CVE-2026-71851

## What is CVE-2026-71851?

CVE-2026-71851 is a critical vulnerability in brix crypto-js, published on 7 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)), CWE-334 (Small Space of Random Values), CWE-331 (Insufficient Entropy)

## Which versions are affected by CVE-2026-71851?

2 open source packages ship an affected version, including crypto-js.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `crypto-js` | npm | All versions | 4.0.0 |
| `crypto-js` | npm | All versions | 4.0.0 |

## How do I fix CVE-2026-71851?

Upgrade crypto-js to 4.0.0 or later.

## Is CVE-2026-71851 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-71851 exists.

Public exploit code:

- Weak-RNG stream-sweep research (CVE-2026-71851 class): PRNG schemes x seeds -> BIP39 -> victim set membership (github_poc): https://github.com/brendonlee20042004-sys/weakrng-sweep

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-71851 and fix it if it is affected.

What it is: CVE-2026-71851 is a critical vulnerability in brix crypto-js, published on 7 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-71851 exists.

Affected packages and fixed versions:
- crypto-js (npm): affected all versions; fixed in 4.0.0
- crypto-js (npm): affected all versions; fixed in 4.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-71851/ (Markdown: https://insights.sbomify.com/CVE-2026-71851/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-71851
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-71851
- OSV: https://osv.dev/vulnerability/CVE-2026-71851

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-71851/
Summaries are generated and may contain mistakes; the official description above is the record.
