Description
sm-crypto provides JavaScript implementations of the Chinese cryptographic algorithms SM2, SM3, and SM4. A private key recovery vulnerability exists in the SM2 decryption logic of sm-crypto prior to version 0.3.14. By interacting with the SM2 decryption interface multiple times, an attacker can fully recover the private key within approximately several hundred interactions. Version 0.3.14 patches the issue.
Published: 2026-01-22
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Private key compromise
Action: Patch Now
AI Analysis

Impact

The vulnerability resides in the SM2 decryption routine of the sm-crypto library. By repeatedly calling the SM2 decryption interface, an attacker can recover the full private key after only a few hundred interactions. The success of this attack directly leaks the cryptographic secret, undermining all confidentiality and integrity guarantees that rely on SM2 keys.

Affected Systems

The affected product is sm-crypto from JuneAndGreen. Any deployment running a version earlier than 0.3.14 is vulnerable. Version 0.3.14 and later contain the patch that fixes the recovery flaw.

Risk and Exploitability

The CVSS score of 9.1 classifies this flaw as critical. Although the EPSS score is below 1%, indicating a low current exploitation probability, the vulnerability is not listed in the CISA KEV catalog. An attacker must be able to invoke the SM2 decryption function, which is typically exposed through application code; therefore the attack vector is inferred to be through the application’s usage of the library rather than a network exploit. Given the high impact of private key leakage, the overall risk to any system that depends on SM2 remains significant until the library is updated.

Generated by OpenCVE AI on April 18, 2026 at 03:58 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade sm-crypto to version 0.3.14 or newer; use a package manager to install the fixed release.
  • Review all uses of SM2 encryption and decryption in the codebase; replace any legacy calls that may still reference the vulnerable functions.
  • If an immediate upgrade is not possible, remove SM2 functionality from public-facing components and temporarily disable decryption operations until the patch is applied.

Generated by OpenCVE AI on April 18, 2026 at 03:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-pgx9-497m-6c4v sm-crypto Affected by Private Key Recovery in SM2-PKE
History

Wed, 25 Feb 2026 15:45:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:juneandgreen:sm-crypto:*:*:*:*:*:*:*:*

Fri, 23 Jan 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Juneandgreen
Juneandgreen sm-crypto
Vendors & Products Juneandgreen
Juneandgreen sm-crypto

Thu, 22 Jan 2026 16:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 22 Jan 2026 02:45:00 +0000

Type Values Removed Values Added
Description sm-crypto provides JavaScript implementations of the Chinese cryptographic algorithms SM2, SM3, and SM4. A private key recovery vulnerability exists in the SM2 decryption logic of sm-crypto prior to version 0.3.14. By interacting with the SM2 decryption interface multiple times, an attacker can fully recover the private key within approximately several hundred interactions. Version 0.3.14 patches the issue.
Title sm-crypto Affected by Private Key Recovery in SM2-PKE
Weaknesses CWE-345
References
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}


Subscriptions

Juneandgreen Sm-crypto
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-01-22T15:49:07.259Z

Reserved: 2026-01-19T14:49:06.314Z

Link: CVE-2026-23966

cve-icon Vulnrichment

Updated: 2026-01-22T15:48:31.924Z

cve-icon NVD

Status : Analyzed

Published: 2026-01-22T03:15:47.007

Modified: 2026-02-25T15:30:40.560

Link: CVE-2026-23966

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T04:00:08Z

Weaknesses