NPM · JULY 2026 · EARLY WARNING

sm-crypto npm Package Vulnerability: Predictable SM2 Key Generation

EARLY WARNING · UNCONFIRMED. This page describes a developing threat that 0Day surfaced from early signals and has not yet independently confirmed. Details may change. Always verify against the primary sources before acting.
Severity
HIGH
Affected component
sm-crypto (npm)
Affected versions
< 0.4.0 or < 0.3.14 or < 0.3.14 or < 0.5.0
Patched version
Not yet available
GHSA-VH45-F885-3848

An early warning has been issued for the sm-crypto npm package, which reportedly uses a predictable random number generator for SM2 key generation in Node.js. This makes the generated keys vulnerable to prediction attacks.

What happened

The sm-crypto npm package, specifically versions less than 0.4.0, 0.3.14, and 0.5.0, is under investigation for using a predictable random number generator (RNG) in Node.js. This RNG, which combines Math.random and the wall clock, is insufficient for secure key generation. As a result, the SM2 private keys and signing ephemeral scalars generated by these versions may be vulnerable to prediction attacks.

This vulnerability, tracked as GHSA-VH45-F885-3848 and CVE-2026-73567, was first flagged on July 24, 2026. The severity is classified as high, and while there is no confirmed exploitation in the wild, the issue is critical due to the nature of the vulnerability. Users of the affected versions should assess their exposure and consider alternative libraries for cryptographic key generation until a fix is released.

What to do about it

How 0Day would have caught this

MATCHED TO YOUR ACTUAL DEPENDENCY GRAPH0Day matches every incoming threat signal against your GitHub organization’s full dependency graph, including transitive dependencies. If sm-crypto is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.

Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.

Frequently asked questions

Am I affected?

You are affected if your project uses the sm-crypto npm package in versions less than 0.4.0, 0.3.14, or 0.5.0.

What should I do right now?

Monitor the primary sources for updates and consider using alternative libraries for cryptographic key generation until a fix is released.

Is there a patch available?

No official patch has been published yet. Await updates from the sm-crypto maintainers.

How severe is this vulnerability?

The severity is classified as high due to the critical nature of predictable key generation in cryptographic operations.

Sources

Join the 0Day waitlist →

← Back to all threats