CVE-2026-71892
org.bouncycastle/bcpkix-jdk18on: org.bouncycastle/bcpkix-fips: bouncycastle: Bouncy Castle: Key-size validation bypass via improper algorithm check
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 3, 2026
Updated · October 14, 2026
Description
A flaw was found in Bouncy Castle. A remote attacker can bypass cryptographic key-size validation by sending a crafted Cryptographic Message Syntax (CMS) message that uses key derivation. Due to an incorrect algorithm identifier comparison in the recipient handling logic, key-size verification is skipped even when explicitly enabled. This allows an attacker to supply encryption keys with unexpected or weaker key lengths, defeating security controls designed to enforce key sizes.
Statement
A flaw was found in Bouncy Castle's CMS implementation when validating key sizes on key-transport recipients. When processing messages utilizing RFC 9709 content-encryption key derivation (HKDF), an improper comparison between an ASN1ObjectIdentifier and a byte array causes key-size verification to be silently skipped even if explicitly enabled via setKeySizeValidation(true). A remote attacker can supply a crafted CMS message with unexpected or weaker key lengths, bypassing application cryptographic policy controls and degrading the integrity and confidentiality guarantees of encrypted content.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Validate decrypted content-encryption key lengths directly within application logic after recipient processing, or reject CMS envelopes utilizing RFC 9709 HKDF key derivation.
CVSS / CWE
CVSS 3.1 · 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
CWE-1024 · Comparison of Incompatible Types