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.
Published: 2026-08-07
Score: 9 Critical
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is caused by the CryptoJS.lib.WordArray.random() function utilizing a custom Multiply‑With‑Carry pseudorandom number generator seeded from Math.random() in versions prior to 4.0.0. This produces only about 2^39 to 2^47 bits of entropy instead of the intended 128 or 256 bits. When wallet applications use this function to generate BIP39 recovery phrases, the small search space can be exhaustively enumerated on commodity hardware, enabling an attacker to recover the private key and control the associated funds. The weakness falls under CWE‑331, CWE‑334, and CWE‑338.

Affected Systems

The affected product is the JavaScript library brix:crypto‑js in all releases before 4.0.0. Any downstream wallet or crypto application that relies on CryptoJS.lib.WordArray.random() for key generation or recovery phrase creation is also impacted.

Risk and Exploitability

The CVSS score of 9 indicates a critical severity, but the EPSS score is not available, so the current exploitation probability is unknown. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires that the vulnerable library be active in the application, and the attacker must enumerate the reduced entropy space to derive the key. If the library is used in a client‑side or server‑side key‑generation flow, an attacker can generate the private key by brute‑forcing the weakened randomness.

Generated by OpenCVE AI on August 7, 2026 at 20:39 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade brix:crypto-js to version 4.0.0 or later.
  • Update any wallet or cryptographic application that imports CryptoJS.lib.WordArray.random() to use the patched library.
  • Replace the vulnerable WordArray.random() call with a true cryptographic random source such as crypto.getRandomValues() or a platform‑specific secure RNG; review the key‑generation path to ensure sufficient entropy.

Generated by OpenCVE AI on August 7, 2026 at 20:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-rg76-677x-56q9 crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain
History

Fri, 07 Aug 2026 19:15:00 +0000

Type Values Removed Values Added
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.
Title crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain
Weaknesses CWE-331
CWE-334
CWE-338
References
Metrics cvssV3_1

{'score': 9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-07T18:48:08.348Z

Reserved: 2026-08-07T18:26:53.523Z

Link: CVE-2026-71851

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T20:45:03Z

Weaknesses
  • CWE-331

    Insufficient Entropy

  • CWE-334

    Small Space of Random Values

  • CWE-338

    Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)