Add advisories for pqc_kyber and cosmian_kyber (AVX2 cmov skips FO implicit rejection, key recovery) - #3151
Open
007bsd wants to merge 4 commits into
Open
Add advisories for pqc_kyber and cosmian_kyber (AVX2 cmov skips FO implicit rejection, key recovery)#3151007bsd wants to merge 4 commits into
007bsd wants to merge 4 commits into
Conversation
…(chosen-ciphertext key recovery)
… AVX2 cmov defect)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both affected crates are unmaintained (see Checklist), so there is no upstream
maintainer to confirm the report or ship a fix. These advisories are filed for the
public record and to warn dependents via
cargo audit. The defect is reportedupstream in the linked PRs below.
Affected crate(s)
pqc_kyber(~14,800 recent downloads per crates.io, rolling ~90-day window)cosmian_kyber(stale fork of the same code; ~50 recent downloads, 0 dependents)Links to upstream issue(s) or PR(s)
pqc_kyber: Fix broken AVX2 cmov that skips FO implicit rejection (key recovery) Argyle-Software/kyber#121cosmian_kyber: Fix broken AVX2 cmov that skips FO implicit rejection (key recovery) Cosmian/kyber#6Severity
Complete IND-CCA break (both crates carry the identical defect). The AVX2
cmovbuilds its blend mask with_mm256_set1_epi64x, so every byte's high bit is 0 and_mm256_blendv_epi8copies nothing, making the routine a no-op. Thatcmovis the Fujisaki-Okamoto implicit-rejection step in decapsulation (called withlen == 32, entirely through the vector loop), so on an invalid ciphertext the rejection value is never applied and the returned shared secret depends on the decrypted plaintext of the attacker-chosen ciphertext. This is a chosen-ciphertext plaintext-checking oracle and allows full recovery of a reused static secret key. Verified end to end on ML-KEM-768 (4,272 decapsulation queries, 0/768 coefficient mismatches, recovered key reproduces decryption on 64/64 random ciphertexts). Reachable only with the opt-inavx2feature and a reused key pair; the default reference backend is correct. CVSS 7.4 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).Checklist
RUSTSEC-0000-0000as the IDdatefield is set to the public disclosure dateBoth crates are unmaintained:
pqc_kyber's last release and commit are August 2023, andcosmian_kyberis a stale fork (last published January 2023). The defect is reported upstream in Argyle-Software/kyber#119 and Cosmian/kyber#5 (linked above); the maintainers are unresponsive, so a publishing confirmation could not be obtained.