Skip to main content

Bouncy Castle Java CVE-2026-71892

| EUVDEUVD-2026-91989 MEDIUM
Incorrect Comparison (CWE-697)
2026-10-03 bcorg GHSA-x42w-4gqh-qrvm
6.9
CVSS 4.0 · Vendor: bcorg
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft CMS EnvelopedData with HKDF CEK
  2. Delivery
    Advertise key size mismatching inner algorithm
  3. Exploit
    Faulty byte-array vs OID comparison
  4. Execution
    Key-size validation silently skipped
  5. Impact
    Recipient accepts wrong-size key

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incorrect comparison
Exploitation Conditions

Three conditions must all hold: (1) the receiving application must have explicitly enabled the opt-in control JceKeyTransRecipient.setKeySizeValidation(true), which is OFF by default; (2) the processed message must be a key-transport EnvelopedData or AuthEnvelopedData using RFC 9709 content-encryption key derivation (id-alg-cek-hkdf-sha256); and (3) the HKDF-derived content-encryption key size must not match the advertised inner content-encryption algorithm. Limiting factors that reduce real-world risk: the validation is opt-in and non-default, so applications that never call setKeySizeValidation(true) are unaffected; non-HKDF messages are unaffected; messages whose key size already matches are unaffected; and the flaw bypasses a size-enforcement check rather than directly decrypting data or recovering keys.

Impact

This is a medium-severity defense-in-depth control failure, not a high-impact primitive. The vendor CVSS 4.0 base score is 6.9 (U:Amber) with vector AV:N/AC:L/AT:N/PR:N/UI:N and Low vulnerable-system confidentiality and integrity impact (VC:L/VI:L), which already signals limited rather than severe consequences. No EPSS probability, no CISA KEV listing, and no standalone public exploit were supplied, so there is no evidence of active or at-scale exploitation; the only exploitation artifact is a regression test shipped inside the patch commit, which demonstrates the condition but is not a weaponized exploit. CAVEAT ON THE VECTOR: the CVSS metrics state PR:N/UI:N (remote, unauthenticated, no interaction), but the description makes clear the flaw only matters when the receiving application has explicitly opted in via JceKeyTransRecipient.setKeySizeValidation(true) AND the message uses RFC 9709 HKDF CEK derivation - those are target-side preconditions not reflected in the base vector, so real-world reachability is far narrower than AV:N/PR:N implies. The practical effect is that an optional, non-default key-size enforcement check silently passes when it should fail (CWE-697, incorrect comparison of a byte array against an ASN1ObjectIdentifier). This is a real correctness/security-control bug worth patching, but it is a low-real-risk issue for most deployments: it does not by itself enable decryption, code execution, or key recovery, and it is inert for every application that never enabled the opt-in validation.

Exploit ScenarioDerived

An attacker crafts a key-transport EnvelopedData or AuthEnvelopedData using RFC 9709 HKDF content-encryption key derivation (id-alg-cek-hkdf-sha256) in which the HKDF-derived content-encryption key size does not match the advertised content-encryption algorithm (e.g. 256 bits of keying material while the inner algorithm is AES-128-CBC). A recipient application that relies on setKeySizeValidation(true) as a security boundary accepts the mismatched message because the faulty OID comparison skips the size check entirely, defeating the only API-level key-size enforcement the library offers. A regression test demonstrating this condition ships with the patch, but no standalone public exploit was identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 03, 2026

Key-size validation bypass in Bouncy Castle for Java before 1.86 (and Bouncy Castle for Java FIPS before bcpkix-fips 2.0.13 / 2.1.13) allows a key-transport EnvelopedData or AuthEnvelopedData message whose HKDF-derived content-encryption key does not match the advertised content-encryption algorithm to be accepted even when the application has explicitly enabled org.bouncycastle.cms.jcajce.JceKeyTransRecipient.setKeySizeValidation(true). The defect is confined to messages using RFC 9709 CEK derivation (id-alg-cek-hkdf-sha256); messages with a matching key size, non-HKDF messages, and recipients that never enable validation are unaffected, and the opt-in control is off by default, so this is a medium-severity defense-in-depth failure rather than a direct decryption or key-recovery primitive. Unauthenticated remote attackers who can supply CMS content to an application that has enabled the control can silently defeat the only mechanism the API offers for enforcing recovered key size; no public exploit code or confirmed active exploitation was identified at time of analysis, and a vendor-released patch is available.

RemediationAI

Vendor-released patch: upgrade Bouncy Castle for Java to 1.86 (bcprov/bcpkix), and Bouncy Castle for Java FIPS to bcpkix-fips 2.0.13 on the 2.0.X line or bcpkix-fips 2.1.13 on the 2.1.X line; the upstream fix commit is https://github.com/bcgit/bc-java/commit/be0a7d925c818ef2f338bcec55178b9b6336dfc3 and the advisory is at https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902026%E2%80%9071892. Where immediate upgrade is not possible, do not rely on setKeySizeValidation(true) as a size-enforcement control for RFC 9709 messages: add an application-side check that compares the recovered CEK length to the inner content-encryption algorithm parsed from the id-alg-cek-hkdf-sha256 AlgorithmIdentifier parameters, since the library check is a no-op in that path. Alternatively, reject or quarantine inbound key-transport EnvelopedData/AuthEnvelopedData that advertise id-alg-cek-hkdf-sha256 until the upgrade lands, or disable HKDF-based CEK derivation on the generating side (setEnableSha256HKdf(false)); the trade-off is loss of interoperability with peers that require RFC 9709 key derivation. Note that leaving setKeySizeValidation disabled is not an additional regression for HKDF messages, because the check never ran for them; no public exploit code was identified at time of analysis, so prioritization can follow normal patch-cycle timelines given the opt-in, non-default nature of the affected control.

Affected VersionsENISA

BC-FJA 2.1.0 <2.1.13
BC-JAVA 1.78 <1.86
BC-FJA 2.0.7 <2.0.13

Affected Packages

euvd bc_fja fix: 2.0.13, 2.1.13
euvd bc_java fix: 1.86

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Bouncy Castle's CMS implementation (pkix module, class org.bouncycastle.cms.jcajce.JceKeyTransRecipient) supports RFC 9709 content-encryption key derivation, in which the transported encrypted key is fed through HKDF-SHA256 to produce the CEK and the AlgorithmIdentifier parameters carry the real inner content-encryption algorithm. The affected code attempted to detect that construction with 'encryptedEncryptionKey.equals(CMSObjectIdentifiers.id_alg_cek_hkdf_sha256)', a comparison between a byte array and an ASN1ObjectIdentifier. Because a byte[] can never equal an ASN1ObjectIdentifier, the branch was always false (CWE-697: incorrect comparison), causing the check to fall through to a key-size lookup on the outer wrapper OID. That OID identifies a key-derivation construction, not a cipher, so no key size is registered for it and the size comparison was skipped entirely, leaving validation silently inert. The upstream fix changes the test to compare the parsed content-encryption AlgorithmIdentifier's algorithm OID, so validation now checks the recovered key against the inner cipher (e.g. aes128-CBC versus a 256-bit recovered key) as intended. The relevant CPEs are cpe:2.3:a:legion_of_the_bouncy_castle_inc.:bc-java and cpe:2.3:a:legion_of_the_bouncy_castle_inc.:bc-fja.

Know when Java gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (bcorg) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/U:Amber
vuln.today AI 6.5 MEDIUM

A crafted CMS message is delivered over the network with no attacker privileges or user interaction; the flaw only bypasses a key-size enforcement control, yielding low confidentiality and integrity impact and no availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
SUSE 4.8 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Primary rating from Vendor (bcorg).

CVSS VectorVendor: bcorg

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

In Bouncy Castle for Java before 1.86, the opt-in key-size validation on CMS key-transport recipients, org.bouncycastle.cms.jcajce.JceKeyTransRecipient.setKeySizeValidation(true), never ran for a message using RFC 9709 content-encryption key derivation (id-alg-cek-hkdf-sha256). The branch that should have selected the actual content-encryption algorithm carried in the key derivation AlgorithmIdentifier's parameters compared the encrypted-key byte array against the id-alg-cek-hkdf-sha256 object identifier, a comparison between a byte array and an ASN1ObjectIdentifier that is false for every possible input, so the check fell through to a key-size lookup on the outer wrapper OID. That OID identifies a key-derivation construction rather than a cipher and has no registered key size, so the size comparison was skipped entirely. A key-transport EnvelopedData or AuthEnvelopedData whose transported, HKDF-derived content-encryption key did not match the key size of the advertised content-encryption algorithm was therefore accepted even with validation explicitly enabled, silently defeating the only mechanism the API offers for enforcing recovered key size. The recipient now dispatches on the content-encryption AlgorithmIdentifier's algorithm OID, so validation checks the recovered key against the inner content-encryption algorithm. Messages with a matching key size, non-HKDF messages, and recipients that do not enable validation are unaffected. This issue also affects Bouncy Castle for Java FIPS (BC-FJA) before bcpkix-fips 2.0.13 (2.0.X series) and 2.1.13 (2.1.X series).

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
High
Bouncy Castle is a widely deployed Java and FIPS cryptography library across enterprise applications
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
High
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise Module for Development Tools 15 SP7 Affected
SUSE Linux Enterprise Server 15 SP7 Affected
SUSE Linux Enterprise Server 16.0 Affected
SUSE Linux Enterprise Server 16.1 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy