Description
sm-crypto provides JavaScript implementations of the Chinese cryptographic algorithms SM2, SM3, and SM4. A signature forgery vulnerability exists in the SM2 signature verification logic of sm-crypto prior to version 0.4.0. Under default configurations, an attacker can forge valid signatures for arbitrary public keys. If the message space contains sufficient redundancy, the attacker can fix the prefix of the message associated with the forged signature to satisfy specific formatting requirements. Version 0.4.0 patches the issue.
Published: 2026-01-22
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Signature Forgery
Action: Apply Patch
AI Analysis

Impact

The sm-crypto library implements the Chinese SM2, SM3, and SM4 cryptographic algorithms. A flaw in the SM2 signature verification logic allows an attacker to forge a valid signature for any chosen public key. When the message space contains sufficient redundancy, the attacker can control the message prefix to match required formatting, enabling the forged signature to pass verification checks. This capability can be used to impersonate trusted parties, tamper with data, or bypass integrity checks in any application that relies on sm-crypto for signature validation.

Affected Systems

The vulnerability affects all installations of the JuneAndGreen sm-crypto JavaScript library built before version 0.4.0.

Risk and Exploitability

With a CVSS score of 7.5, the flaw is considered high severity. The current EPSS score of less than 1% indicates a very low probability of exploitation at present, and it is not listed in the CISA KEV catalog. Exploitation requires that an attacker can supply both a crafted public key and a forged signature to the verification routine, which is feasible in any context where sm-crypto is invoked on external data, such as web services or client-side applications. The vulnerability does not allow arbitrary code execution but can subvert authentication or integrity mechanisms.

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.4.0 or newer.
  • Replace SM2 signature verification with a vetted implementation or an alternative cryptographic library that correctly validates signatures.
  • Strictly validate any externally supplied public keys and enforce that signatures are accepted only from trusted, authenticated sources.

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-hpwg-xg7m-3p6m sm-crypto Affected by Signature Forgery in SM2-DSA
History

Wed, 25 Feb 2026 15:30: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': 'partial'}, '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 signature forgery vulnerability exists in the SM2 signature verification logic of sm-crypto prior to version 0.4.0. Under default configurations, an attacker can forge valid signatures for arbitrary public keys. If the message space contains sufficient redundancy, the attacker can fix the prefix of the message associated with the forged signature to satisfy specific formatting requirements. Version 0.4.0 patches the issue.
Title sm-crypto Affected by Signature Forgery in SM2-DSA
Weaknesses CWE-347
References
Metrics cvssV3_1

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


Subscriptions

Juneandgreen Sm-crypto
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-01-22T15:58:10.585Z

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

Link: CVE-2026-23965

cve-icon Vulnrichment

Updated: 2026-01-22T15:57:56.977Z

cve-icon NVD

Status : Analyzed

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

Modified: 2026-02-25T15:27:23.550

Link: CVE-2026-23965

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses