sm-crypto weak randomness lets attackers recover SM2 private keys

critical severity · published 2026-08-13

The default key generation in sm-crypto's SM2 code seeds its randomness from Math.random() and the clock instead of real cryptographic randomness. An attacker who can observe the process's Math.random() outputs and estimate the key-generation time can reconstruct the seed and recover generated SM2 private keys.

CVE: CVE-2026-73567

Source: NVD

Get the fix

FixLane has a reviewed fix procedure for this incident: a read-only check first, then the fix. Ask the Telegram bot, or connect an AI agent to the FixLane MCP server and call get_fix_prompt with incident id 171 and your operating system.