CVE-2026-73567: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in JuneAndGreen sm-crypto
A cryptographic weakness exists in sm-crypto versions prior to 0.5.0 where the default SM2 key pair generation in Node.js uses a weak pseudo-random number generator seeded from predictable sources. This flaw allows attackers who can observe Math.random() outputs and estimate key generation time to recover private keys and forge signatures. The issue is fixed in version 0.5.0.
AI Analysis
Technical Summary
The sm-crypto JavaScript library implements Chinese cryptographic algorithms SM2, SM3, and SM4. Before version 0.5.0, the default no-argument call to sm2.generateKeyPairHex() in Node.js uses a module-wide SecureRandom instance from [email protected], which seeds an ARC4 stream cipher using Math.random() and the current time (new Date().getTime()). Because window.crypto.getRandomValues is unavailable in this context despite globalThis.crypto existing, the randomness source is weak. An attacker who can observe the process's Math.random() outputs and approximate the key generation time can reconstruct the seed, recover SM2 private keys, and predict ephemeral signing scalars, enabling signature forgery. This vulnerability is addressed in sm-crypto version 0.5.0.
Potential Impact
Exploitation allows an attacker to recover SM2 private keys generated by the vulnerable sm-crypto library and predict ephemeral signing scalars, enabling the forgery of digital signatures. This compromises the confidentiality and integrity of cryptographic operations relying on SM2 keys generated by affected versions.
Mitigation Recommendations
Upgrade to sm-crypto version 0.5.0 or later, where the weak pseudo-random number generator usage in key generation has been fixed. No other mitigations are specified.
CVE-2026-73567: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in JuneAndGreen sm-crypto
Description
A cryptographic weakness exists in sm-crypto versions prior to 0.5.0 where the default SM2 key pair generation in Node.js uses a weak pseudo-random number generator seeded from predictable sources. This flaw allows attackers who can observe Math.random() outputs and estimate key generation time to recover private keys and forge signatures. The issue is fixed in version 0.5.0.
CVSS v3.1
Score 9.1critical
Affected software
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
The sm-crypto JavaScript library implements Chinese cryptographic algorithms SM2, SM3, and SM4. Before version 0.5.0, the default no-argument call to sm2.generateKeyPairHex() in Node.js uses a module-wide SecureRandom instance from [email protected], which seeds an ARC4 stream cipher using Math.random() and the current time (new Date().getTime()). Because window.crypto.getRandomValues is unavailable in this context despite globalThis.crypto existing, the randomness source is weak. An attacker who can observe the process's Math.random() outputs and approximate the key generation time can reconstruct the seed, recover SM2 private keys, and predict ephemeral signing scalars, enabling signature forgery. This vulnerability is addressed in sm-crypto version 0.5.0.
Potential Impact
Exploitation allows an attacker to recover SM2 private keys generated by the vulnerable sm-crypto library and predict ephemeral signing scalars, enabling the forgery of digital signatures. This compromises the confidentiality and integrity of cryptographic operations relying on SM2 keys generated by affected versions.
Mitigation Recommendations
Upgrade to sm-crypto version 0.5.0 or later, where the weak pseudo-random number generator usage in key generation has been fixed. No other mitigations are specified.
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
- Remediation Level
- null
Threat ID: 6a7e058ebf8831d5399500fc
Added to database: 08/13/2026, 17:57:34 UTC
Last enriched: 08/13/2026, 18:11:17 UTC
Last updated: 08/13/2026, 19:30:01 UTC
Views: 5
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.