CVE-2026-73567: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in JuneAndGreen sm-crypto
The sm-crypto JavaScript library for Chinese cryptographic algorithms SM2, SM3, and SM4 has a critical vulnerability in versions prior to 0.5.0. The default key generation in Node.js uses a cryptographically weak pseudo-random number generator seeded from Math.random() and the current time, allowing attackers who can observe Math.random() outputs and estimate key generation time to recover private keys and forge signatures. This issue is fixed in version 0.5.0.
AI Analysis
Technical Summary
sm-crypto versions before 0.5.0 use a module-wide SecureRandom instance seeded by an ARC4 stream derived from Math.random() and new Date().getTime() due to the unavailability of window.crypto.getRandomValues in Node.js, despite globalThis.crypto existing. This weak seeding method allows attackers who can observe Math.random() outputs and approximate the key generation time to reconstruct the seed, recover SM2 private keys, and predict ephemeral signing scalars, enabling signature forgery. The vulnerability is identified as CWE-338 (Use of Cryptographically Weak PRNG). It is fixed in version 0.5.0.
Potential Impact
An attacker capable of observing the process's Math.random() outputs and estimating the key generation time can reconstruct the seed used for key generation, recover SM2 private keys, and predict ephemeral signing scalars. This compromises the confidentiality of private keys and the integrity of digital signatures, allowing signature forgery. There is no indication of active exploitation in the wild.
Mitigation Recommendations
Upgrade to sm-crypto version 0.5.0 or later, where this issue is fixed by using a secure random number generator. No other mitigations are indicated.
CVE-2026-73567: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in JuneAndGreen sm-crypto
Description
The sm-crypto JavaScript library for Chinese cryptographic algorithms SM2, SM3, and SM4 has a critical vulnerability in versions prior to 0.5.0. The default key generation in Node.js uses a cryptographically weak pseudo-random number generator seeded from Math.random() and the current time, allowing attackers who can observe Math.random() outputs and estimate key generation time to recover private keys and forge signatures. This issue is fixed in version 0.5.0.
CVSS v3.1
Score 9.1critical
Affected software
JuneAndGreen
sm-crypto
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
sm-crypto versions before 0.5.0 use a module-wide SecureRandom instance seeded by an ARC4 stream derived from Math.random() and new Date().getTime() due to the unavailability of window.crypto.getRandomValues in Node.js, despite globalThis.crypto existing. This weak seeding method allows attackers who can observe Math.random() outputs and approximate the key generation time to reconstruct the seed, recover SM2 private keys, and predict ephemeral signing scalars, enabling signature forgery. The vulnerability is identified as CWE-338 (Use of Cryptographically Weak PRNG). It is fixed in version 0.5.0.
Potential Impact
An attacker capable of observing the process's Math.random() outputs and estimating the key generation time can reconstruct the seed used for key generation, recover SM2 private keys, and predict ephemeral signing scalars. This compromises the confidentiality of private keys and the integrity of digital signatures, allowing signature forgery. There is no indication of active exploitation in the wild.
Mitigation Recommendations
Upgrade to sm-crypto version 0.5.0 or later, where this issue is fixed by using a secure random number generator. No other mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-08-12T20:53:46.381Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a7e058ebf8831d5399500fc
Added to database: 08/13/2026, 17:57:34 UTC
Last enriched: 08/21/2026, 13:31:42 UTC
Last updated: 09/26/2026, 13:47:48 UTC
Views: 69
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.