CVE-2026-73567
CriticalCVSS 9.1Summary
sm-crypto before 0.5.0 in the default no-argument sm2.generateKeyPairHex() path in Node.js uses the module-wide SecureRandom instance from [email protected], which seeds an ARC4 stream from Math.random() and new Date().getTime() because window.crypto.getRandomValues is unavailable even though globalThis.crypto exists. An attacker who can observe the process's Math.random() outputs and estimate the key-generation time can reconstruct the seed, recover generated SM2 private keys, and predict signing ephemeral scalars used to forge signatures. This issue is fixed in version 0.5.0.
Risk Assessment
Weak entropy in key generation could lead to private key recovery and signature forgery, compromising data integrity and confidentiality.
Recommendation
Update sm-crypto to version 0.5.0 or later and ensure secure randomness sources are used.
Original NVD description (English source)
sm-crypto provides JavaScript implementations of the Chinese cryptographic algorithms SM2, SM3, and SM4. Prior to 0.5.0, the default no-argument sm2.generateKeyPairHex() path in Node.js uses the module-wide SecureRandom instance in src/sm2/utils.js, supplied by [email protected], which seeds an ARC4 stream from Math.random() and new Date().getTime() because window.crypto.getRandomValues is unavailable even though globalThis.crypto exists. An attacker who can observe the process's Math.random() outputs and estimate the key-generation time can reconstruct the seed, recover generated SM2 private keys, and predict signing ephemeral scalars used to forge signatures. This issue is fixed in version 0.5.0.

