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.
OpenCVE Enrichment
Github GHSA