CVE-2026-71892: CWE-697 Incorrect Comparison in Legion of the Bouncy Castle Inc. BC-JAVA
CVE-2026-71892 is a medium severity vulnerability in Bouncy Castle for Java (BC-JAVA) before version 1.86 and certain FIPS versions. The issue involves an incorrect comparison in the key-size validation logic for CMS key-transport recipients when using RFC 9709 content-encryption key derivation (HKDF with SHA-256). This flaw causes the key-size validation to be bypassed, allowing acceptance of keys that do not match the expected size, even when validation is enabled. The problem affects versions 1.78 up to but not including 1.86, 2.0.7 up to but not including 2.0.13, and 2.1.0 up to but not including 2.1.13. The vulnerability does not affect messages without HKDF or recipients that do not enable validation. No known exploits are reported in the wild.
AI Analysis
Technical Summary
In Bouncy Castle for Java versions prior to 1.86, the opt-in key-size validation for CMS key-transport recipients using RFC 9709 content-encryption key derivation (id-alg-cek-hkdf-sha256) fails due to an incorrect comparison between a byte array and an ASN1ObjectIdentifier. This causes the validation branch to skip checking the recovered key size against the actual content-encryption algorithm, instead falling back to an outer wrapper OID that lacks a registered key size. Consequently, keys derived via HKDF that do not match the advertised content-encryption algorithm's key size are accepted silently, defeating the validation mechanism. The issue also affects Bouncy Castle for Java FIPS versions before bcpkix-fips 2.0.13 and 2.1.13. The fix involves dispatching validation based on the inner content-encryption algorithm's OID, ensuring correct key size checks. Non-HKDF messages and recipients without validation enabled are unaffected.
Potential Impact
The vulnerability allows CMS key-transport recipients using HKDF-based content-encryption key derivation to accept keys with incorrect sizes despite explicit key-size validation being enabled. This undermines the security guarantees of the key-size validation mechanism, potentially allowing cryptographic operations with keys that do not meet expected size requirements. However, messages without HKDF or recipients not enabling validation are not impacted. There are no reports of active exploitation in the wild.
Mitigation Recommendations
A fix is available in Bouncy Castle for Java versions 1.86 and later, and in BC-FJA versions 2.0.13 and later (2.0.X series) and 2.1.13 and later (2.1.X series). Users should upgrade to these fixed versions to ensure proper key-size validation. Until upgraded, enabling key-size validation on HKDF-based messages does not provide the intended security benefit. Patch status is confirmed by vendor advisory information embedded in the description. No additional mitigations are indicated.
CVE-2026-71892: CWE-697 Incorrect Comparison in Legion of the Bouncy Castle Inc. BC-JAVA
Description
CVE-2026-71892 is a medium severity vulnerability in Bouncy Castle for Java (BC-JAVA) before version 1.86 and certain FIPS versions. The issue involves an incorrect comparison in the key-size validation logic for CMS key-transport recipients when using RFC 9709 content-encryption key derivation (HKDF with SHA-256). This flaw causes the key-size validation to be bypassed, allowing acceptance of keys that do not match the expected size, even when validation is enabled. The problem affects versions 1.78 up to but not including 1.86, 2.0.7 up to but not including 2.0.13, and 2.1.0 up to but not including 2.1.13. The vulnerability does not affect messages without HKDF or recipients that do not enable validation. No known exploits are reported in the wild.
CVSS v4.0
Score 6.9medium
Affected software
Legion of the Bouncy Castle Inc.
BC-JAVA
Legion of the Bouncy Castle Inc.
BC-FJA
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
In Bouncy Castle for Java versions prior to 1.86, the opt-in key-size validation for CMS key-transport recipients using RFC 9709 content-encryption key derivation (id-alg-cek-hkdf-sha256) fails due to an incorrect comparison between a byte array and an ASN1ObjectIdentifier. This causes the validation branch to skip checking the recovered key size against the actual content-encryption algorithm, instead falling back to an outer wrapper OID that lacks a registered key size. Consequently, keys derived via HKDF that do not match the advertised content-encryption algorithm's key size are accepted silently, defeating the validation mechanism. The issue also affects Bouncy Castle for Java FIPS versions before bcpkix-fips 2.0.13 and 2.1.13. The fix involves dispatching validation based on the inner content-encryption algorithm's OID, ensuring correct key size checks. Non-HKDF messages and recipients without validation enabled are unaffected.
Potential Impact
The vulnerability allows CMS key-transport recipients using HKDF-based content-encryption key derivation to accept keys with incorrect sizes despite explicit key-size validation being enabled. This undermines the security guarantees of the key-size validation mechanism, potentially allowing cryptographic operations with keys that do not meet expected size requirements. However, messages without HKDF or recipients not enabling validation are not impacted. There are no reports of active exploitation in the wild.
Mitigation Recommendations
A fix is available in Bouncy Castle for Java versions 1.86 and later, and in BC-FJA versions 2.0.13 and later (2.0.X series) and 2.1.13 and later (2.1.X series). Users should upgrade to these fixed versions to ensure proper key-size validation. Until upgraded, enabling key-size validation on HKDF-based messages does not provide the intended security benefit. Patch status is confirmed by vendor advisory information embedded in the description. No additional mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- bcorg
- Date Reserved
- 2026-08-08T00:06:07.401Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ac0c0f9a43b0b3b89b059bc
Added to database: 10/03/2026, 08:46:49 UTC
Last enriched: 10/03/2026, 09:01:23 UTC
Last updated: 10/03/2026, 13:17:58 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.