CVE-2026-12340
Undergoing Analysis Undergoing Analysis - In Progress
Out-of-Bounds Heap Read in wolfSSL SM2/SM3 Certificate Verification

Publication date: 2026-06-25

Last updated on: 2026-06-25

Assigner: wolfSSL Inc.

Description
Out-of-bounds heap read during SM2/SM3 certificate signature verification. When parsing a certificate with an SM3wSM2 signature, the Subject Key Identifier computation reads the trailing 65 bytes of the public key without checking that the key is at least that long. A public key shorter than 65 bytes results in an out-of-bounds heap read, leading to a potential crash (denial of service); there is no out-of-bounds write. Note this only affects builds with SM2 support (--enable-sm2 or --enable-all).
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-25
Last Modified
2026-06-25
Generated
2026-06-26
AI Q&A
2026-06-26
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
wolfssl wolfssl From 3.0.0 (inc)
wolfssl wolfssl From 2026-06-10 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Mitigation Strategies

The immediate mitigation is to update wolfSSL to a version that includes the fix from pull request #10641, which prevents processing certificates with SM3-with-SM2 signatures and public keys shorter than 65 bytes.

This fix adds checks to reject such certificates, preventing the out-of-bounds read and potential denial of service.

If updating is not immediately possible, consider disabling SM2 support in wolfSSL builds by not enabling the --enable-sm2 or --enable-all options, thereby avoiding the vulnerable code path.

Also, review and restrict certificates in use to ensure they do not have SM3-with-SM2 signatures with short public keys.

Executive Summary

This vulnerability is an out-of-bounds heap read that occurs during the verification of certificates signed with the SM2/SM3 signature algorithm. Specifically, when parsing a certificate with an SM3-with-SM2 signature, the process of computing the Subject Key Identifier reads 65 bytes from the public key without verifying that the key is at least that long.

If the public key is shorter than 65 bytes, this results in reading memory beyond the allocated buffer (out-of-bounds read), which can lead to a crash or denial of service. This issue only affects builds of wolfSSL that have SM2 support enabled.

Impact Analysis

The primary impact of this vulnerability is a potential denial of service caused by a crash when processing specially crafted certificates with an SM3-with-SM2 signature and a public key shorter than 65 bytes.

Because the vulnerability involves an out-of-bounds read without any out-of-bounds write, it does not directly lead to memory corruption or code execution, but it can cause the application using wolfSSL to crash unexpectedly.

Detection Guidance

This vulnerability involves an out-of-bounds heap read triggered by parsing certificates with an SM3-with-SM2 signature algorithm and a public key shorter than 65 bytes. Detection would involve identifying such certificates being processed by wolfSSL builds with SM2 support enabled.

While no explicit commands are provided in the resources, a practical approach would be to monitor or scan certificates used in your environment for SM3-with-SM2 signatures and verify the length of their public keys.

You might use OpenSSL or similar tools to inspect certificates, for example:

  • openssl x509 -in certificate.pem -text -noout

Then check the signature algorithm field for SM3-with-SM2 and verify the public key length is at least 65 bytes.

Additionally, monitoring wolfSSL logs or enabling debugging might help detect crashes or errors related to this vulnerability.

Compliance Impact

The provided information does not specify any direct impact of this vulnerability on compliance with common standards and regulations such as GDPR or HIPAA.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-12340. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart