HIGH 7.5

CVE-2026-10097: wolfSSL ML-KEM-1024 Incomplete Ciphertext Validation – Private Key Recovery

wolfSSL's optimized implementation of ML-KEM-1024, a post-quantum key encapsulation mechanism, contains a critical flaw in how it validates ciphertexts during decryption. The vulnerability stems from an incomplete cryptographic check: the library compares only 1536 of the required 1568 ciphertext bytes when verifying that a ciphertext was correctly re-encrypted. This allows an attacker to craft malicious ciphertexts that pass validation when they should be rejected. An attacker with access to a decapsulation oracle can exploit this as a side-channel-like oracle to recover the long-term private key—without needing to exploit timing behavior or other indirect measurements. A proof of concept demonstrated recovery of a full private key using roughly 350 carefully chosen ciphertexts, with approximately 98% success rate.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weaknesses (CWE)
CWE-697
Affected products
1 configuration(s)
Published / Modified
2026-06-25 / 2026-06-26

NVD description (verbatim)

wolfSSL's AVX2-optimized ML-KEM implementation (mlkem_cmp_avx2) compares only 1536 of the 1568 ciphertext bytes during the Fujisaki-Okamoto re-encryption check in ML-KEM-1024 decapsulation. Ciphertexts that differ from the expected re-encryption solely in bytes 1536-1567 bypass implicit rejection and are accepted as valid, breaking IND-CCA2 security. An attacker able to submit chosen ciphertexts to a decapsulation oracle that uses a static ML-KEM-1024 key, and to observe whether the genuine shared secret or the implicit-rejection secret was produced, can use this as a plaintext-checking oracle to recover the private key. A proof of concept recovered a full ML-KEM-1024 private key with approximately 98% success using roughly 350 chosen ciphertexts. The flaw is a deterministic logic error and does not rely on timing measurements.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in wolfSSL's AVX2-optimized ML-KEM implementation, specifically in the mlkem_cmp_avx2 function used during ML-KEM-1024 decapsulation. The Fujisaki-Okamoto construction, which ML-KEM uses, depends on implicit rejection: a decapsulation operation must deterministically reject (and output a derived pseudorandom shared secret) if the ciphertext does not decrypt correctly to the original plaintext under re-encryption. wolfSSL's AVX2 code path skips comparison of bytes 1536–1567 during this check, meaning ciphertexts that differ only in those final 32 bytes bypass rejection and are treated as valid. This breaks IND-CCA2 indistinguishability under chosen-ciphertext attack. An attacker observing whether decapsulation returns the genuine shared secret or the implicit-rejection secret can use the oracle behavior to mount a plaintext-checking attack, ultimately recovering the private key via polynomial-time queries.

Business impact

Organizations deploying wolfSSL for post-quantum cryptography face loss of confidentiality of encrypted communications protected by ML-KEM-1024 keys. An attacker able to submit chosen ciphertexts to a decapsulation service and observe the resulting shared secret (or infer it indirectly through application behavior) can recover static private keys. This is particularly critical in scenarios where ML-KEM keys are intended to have long-term reuse—such as hybrid encryption schemes, key encapsulation in enterprise protocols, or TLS 1.3 with post-quantum key shares. Compromise of the private key enables retroactive decryption of all past communications encrypted to that key. For vendors and service providers using wolfSSL, this necessitates key rotation, re-evaluation of past encrypted data, and potentially breach notifications depending on scope of exposure.

Affected systems

The vulnerability affects wolfSSL's wolfssl library (all versions implementing the vulnerable AVX2-optimized ML-KEM code path for ML-KEM-1024). The flaw is specific to systems where AVX2 optimization is enabled and ML-KEM-1024 decapsulation is performed. Systems running on older CPUs without AVX2 support, or using the scalar (non-optimized) implementation path, are not affected. Determine affected systems by checking: (1) wolfSSL version in use, (2) whether AVX2 optimizations are compiled and enabled, and (3) whether ML-KEM-1024 is active in your cryptographic operations. Verify vendor guidance for the exact patched version number and conditional compilation flags.

Exploitability

Exploitability requires three conditions: (1) the attacker has network or local access to submit chosen ciphertexts to a decapsulation operation, (2) the attacker can observe or infer whether decapsulation produced the genuine shared secret or the implicit-rejection secret (via timing side-channels, error messages, or application behavior differences), and (3) the same private key is reused across multiple decapsulation queries. The attack is deterministic and does not depend on fine-grained timing measurements; coarse-grained side-channels (e.g., whether decryption succeeds or fails, or differences in application response time) are sufficient. The proof of concept required only ~350 chosen ciphertexts, making the barrier to exploitation low once the oracle is available. CVSS 7.5 (High) reflects high confidentiality impact with low attack complexity and no authentication requirement.

Remediation

Apply the patch from wolfSSL that corrects the mlkem_cmp_avx2 function to compare all 1568 ciphertext bytes during the Fujisaki-Okamoto re-encryption check. Verify the corrected implementation is enabled (AVX2 code path is used) on deployment targets. After patching, conduct key rotation for any ML-KEM-1024 private keys that may have been exposed or used with ciphertexts an attacker could have crafted. If the scope of potential attacker access is known, limit key rotation scope accordingly. For systems that cannot immediately patch, consider disabling AVX2 optimization as a temporary workaround to force use of the scalar code path, though this carries a performance penalty.

Patch guidance

Contact wolfSSL or check the vendor security advisory for the specific patched version that resolves mlkem_cmp_avx2. The patch must verify that all 1568 bytes of the ciphertext are compared during decapsulation validation. Apply and test in a non-production environment first. Confirm that the patched library uses the corrected code path on your target hardware (AVX2-capable systems). After deployment, validate that no behavior change occurs in legitimate decapsulation operations. For systems where AVX2 is disabled or unavailable, confirm the scalar implementation path is unaffected by running unit tests from the wolfSSL test suite.

Detection guidance

Monitor for anomalous ciphertext submissions to services using wolfSSL ML-KEM-1024 decapsulation. If audit logs or application instrumentation is available, look for patterns of repeated failed decapsulation attempts (which might indicate oracle queries). Network-level detection is difficult without decryption context, but unusual volumes of ciphertext submissions from a single source to a decapsulation endpoint warrant investigation. If using application-level logging, instrument decapsulation code to log when the implicit-rejection secret is returned (versus the genuine secret) and correlate with source IP/identity. Intrusion detection rules should flag rapid-fire decapsulation requests from the same endpoint.

Why prioritize this

This vulnerability merits immediate prioritization because it directly breaks post-quantum cryptographic security guarantees (IND-CCA2) and requires only modest numbers of oracle queries to recover static private keys. While exploitation requires oracle access (limiting opportunistic attacks), any system exposing a decapsulation oracle is at risk. Post-quantum cryptography is increasingly deployed for long-term data protection; compromise of ML-KEM-1024 keys can have long-lasting impact. Organizations with customer-facing or sensitive encrypted systems using wolfSSL should patch urgently.

Risk score, explained

CVSS 7.5 (High) reflects: (1) High confidentiality impact—the private key and all encrypted communications are compromised; (2) Low attack complexity—the exploit is a deterministic logic error requiring no measurement or side-channel expertise; (3) Network vector—the attacker can submit ciphertexts remotely if the decapsulation oracle is accessible; (4) No authentication or user interaction required. Integrity and availability are not impacted directly. The score would be higher if the vulnerability also enabled ciphertext forgery or denial of service, but the flaw is specific to confidentiality loss through private key recovery.

Frequently asked questions

Is my wolfSSL deployment affected if I disabled AVX2 optimizations at compile time?

No. The vulnerability is in the mlkem_cmp_avx2 function, which is only used when AVX2 optimizations are enabled and the CPU supports AVX2. If you compiled wolfSSL with AVX2 disabled, the scalar implementation path is used and is not affected. Verify your build configuration to confirm.

Can this vulnerability be exploited without direct access to a decapsulation oracle?

Exploitation requires the attacker to submit chosen ciphertexts and observe whether decapsulation returns the genuine or implicit-rejection secret. This requires either direct API access or the ability to infer the result from application behavior (e.g., response times, error messages, or subsequent cryptographic operations). Attacks over an encrypted TLS channel where the attacker cannot see application behavior are not feasible.

If I rotate my ML-KEM-1024 private keys after patching, do I need to re-encrypt existing data?

Data encrypted with the compromised key under a ciphertext an attacker could have crafted is at risk. If your threat model includes a well-resourced attacker with prior oracle access, re-encryption of sensitive data with fresh keys is prudent. If exposure scope is limited (e.g., internal use only, limited decapsulation endpoints), risk assessment may justify accepting historical exposure and rotating keys forward.

Does this vulnerability affect ML-KEM-512 or ML-KEM-768?

The vulnerability is specific to the ML-KEM-1024 decapsulation path in wolfSSL's AVX2 implementation. ML-KEM-512 and ML-KEM-768 variants were not mentioned as affected. Verify the vendor advisory for confirmation and any additional caveats.

This analysis is based on public vulnerability data and the provided CVE record. Specific patch version numbers, affected product versions, and vendor remediation timelines should be verified directly with wolfSSL's official security advisories. Organizations should test patches in non-production environments before deployment. The proof-of-concept success rate (98%) reflects controlled laboratory conditions and may vary in real-world deployments depending on oracle noise and attacker constraints. This assessment does not constitute professional security advice; conduct your own risk assessment based on your deployment specifics and threat model. Source: NVD (public-domain), retrieved 2026-08-04. Analysis generated by SEC.co (claude-haiku-4-5).