Read the docs
TI-2026-51657 Aliases CVE-2026-73567GHSA-vh45-f885-3848

sm-crypto: Predictable SM2 key generation in Node.js: default RNG uses Math.random + wall clock

Priority MEDIUM 48CWE-338Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
High · High · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.

Summary

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00444 38th percentileScored 2026-11-07
Fix Fixed sm-crypto (JuneAndGreen): 0.5.0sm-crypto (npm): 0.5.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
Yes
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
JuneAndGreensm-cryptobefore 0.5.00.5.0Patch availableCNA
—sm-crypto (npm)before 0.5.00.5.0Patch availableGHSA-vh45-f885-3848
  • sm-crypto VendorJuneAndGreen Affected before 0.5.0 Fixed in 0.5.0 Patch available CNA
  • sm-crypto (npm) Vendor— Affected before 0.5.0 Fixed in 0.5.0 Patch available GHSA-vh45-f885-3848

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:juneandgreen:sm-crypto:*:*:*:*:*:*:*:*——JuneAndGreen
  • cpe:2.3:a:juneandgreen:sm-crypto:*:*:*:*:*:*:*:* Versions — — ·JuneAndGreen

Remediation

  • Fix · CNA sm-crypto (JuneAndGreen) Fixed in 0.5.0
  • Fix · GHSA-vh45-f885-3848 sm-crypto (npm) Fixed in 0.5.0 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-73567
  2. 2026-10-03 Alias added: GHSA-vh45-f885-3848

References

  • TI-2026-19308 sm-crypto Affected by Private Key Recovery in SM2-PKE CVSS 3.1CRITICAL 9.1
  • TI-2026-19309 sm-crypto Affected by Signature Malleability in SM2-DSA CVSS 3.1HIGH 7.5
  • TI-2026-19307 sm-crypto Affected by Signature Forgery in SM2-DSA CVSS 3.1HIGH 7.5

Sources