Incomplete Ciphertext Comparison in ML-KEM: From an IND-CCA2 Break to Key Recovery
Shows wolfSSL's incomplete ciphertext comparison in ML-KEM decapsulation leaks decryption noise, enabling key recovery via least squares on ML-KEM-1024 without lattice reduction.
Schemes: ML-KEM, ML-KEM-1024, Fujisaki-Okamoto transform
Findings (quotes checked against the source text)
-
wolfSSL's FO re-encryption check compared fewer than all ciphertext bytes on two backends, and the skipped bytes leak decryption noise that is a linear function of the secret key.
The bytes the check skips carry the tail of the decryption noise, and that noise is an exact linear function of the secret key.
-
Full-key recovery uses ordinary least squares over stacked measurements, with no lattice reduction needed.
Stacking the measurements gives an overdetermined linear system in the secret, which we solve by ordinary least squares with no lattice reduction.
-
Leakage from the unchecked v-tail survives even when u is fully validated, so the standard validate-all-of-u hardening does not close it.
Reading it off the unchecked v-tail, rather than from chosen sparse-u ciphertexts, means it survives even when u is fully validated, as on AVX2, so the standard "validate all of u" hardening does not close it.
-
The attack is a plaintext-checking oracle needing roughly 10^5 to 10^6 queries, versus a few thousand for key-mismatch attacks, so it trades efficiency for reach.
The price is queries, 10⁵ to 10⁶ against a few thousand for key-mismatch, so the contribution is reach rather than efficiency.
-
Authors recommend that an incomplete FO comparison be triaged as a key-recovery vulnerability rather than only an IND-CCA2 weakness.
We conclude that an incomplete FO comparison is a key-recovery vulnerability, and should be triaged as one.
Numbers (as extracted, not quote-checked)
- ML-KEM ciphertext bytes compared by wolfSSL AVX2 path: 1536 of 1568 bytes
- ML-KEM-1024 secret coefficients recovered at 400 ciphertexts on AVX2: 98.0% of 2048
- ML-KEM-1024 secret coefficients recovered at 600 ciphertexts on NEON: 98.5%
- Ciphertexts for full key recovery in verified reference model: about 1300 for all 2048 coefficients
For builders
If you implement ML-KEM in a PQ chain's node or wallet, verify that the FO re-encryption check compares every ciphertext byte, including the v-tail, in every SIMD backend.
Limits
Only the abstract was available; full text was not read, so per-backend details and the exact attack assumptions are unverified here.
Topics: implementation-sidechannel kem cryptanalysis sig-lattice