CVE-2026-71851
Received Received - Intake

Weak PRNG in CryptoJS Prior to 4.0.0 Enables Wallet Recovery Phrase Compromise

Vulnerability report for CVE-2026-71851, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-07

Last updated on: 2026-08-07

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-07
Last Modified
2026-08-07
Generated
2026-08-07
AI Q&A
2026-08-07
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
crypto-js crypto-js to 4.0.0 (exc)
brix crypto-js to 4.0.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-338 The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.
CWE-334 The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.
CWE-331 The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-71851 is a critical vulnerability in CryptoJS versions before 4.0.0. The function CryptoJS.lib.WordArray.random() uses a weak pseudo-random number generator called Ill Bloom, seeded by Math.random(), instead of a cryptographically secure source. This results in insufficient entropy for generating security-sensitive values like BIP39 recovery phrases.

Detection Guidance

To detect this vulnerability, check if your system uses CryptoJS versions prior to 4.0.0 by inspecting package.json or dependency files. Look for the CryptoJS.lib.WordArray.random() function in your codebase. Use commands like 'npm list crypto-js' or 'grep -r "WordArray.random" /path/to/project' to identify vulnerable versions or usages.

Impact Analysis

If you used CryptoJS to generate BIP39 recovery phrases or other sensitive data, attackers could brute-force the weak entropy and recover private keys. This could lead to theft of cryptocurrency funds or compromise of secured data. Even after updating CryptoJS, previously generated secrets remain vulnerable.

Compliance Impact

This vulnerability likely violates compliance requirements for cryptographic security in GDPR and HIPAA, as it involves the use of weak randomness for generating encryption keys or recovery phrases. Organizations may face penalties for failing to implement cryptographically secure random number generation.

Mitigation Strategies

Immediately upgrade CryptoJS to version 4.0.0 or later. Audit all dependencies for vulnerable versions and replace them. Rotate any long-term secrets generated using the affected function, such as BIP39 recovery phrases. Create new wallets with fresh recovery phrases instead of importing existing ones. Use Coinspect's public tool to check if addresses are associated with compromised recovery phrases.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-71851. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart