Skip to main content
Vulnerability Database/CVE-2026-71888

CVE-2026-71888: Bouncy Castle Java Auth Bypass Vulnerability

CVE-2026-71888 is an authentication bypass flaw in Bouncy Castle for Java that allows attackers to insert unauthenticated attributes into CMS messages. This post explains its technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-71888 Overview

CVE-2026-71888 is a cryptographic integrity flaw in Bouncy Castle for Java affecting the streaming Cryptographic Message Syntax (CMS) AuthenticatedData parser. The parser accepts messages in which the digestAlgorithm and authAttrs fields disagree about whether authenticated attributes are present. An attacker who can modify a message in transit can inject attacker-chosen authenticated attributes without holding the key-encryption key or the content-MAC key. Applications that make authorization, routing, or labeling decisions from getAuthAttrs() act on spoofed values. The flaw is tracked under [CWE-354: Improper Validation of Integrity Check Value].

Critical Impact

Attackers can forge authenticated attributes such as RFC 2634 ESSSecurityLabel on CMS AuthenticatedData messages, bypassing authorization, routing, and labeling logic without compromising any key material.

Affected Products

  • Bouncy Castle for Java before 1.86
  • Bouncy Castle for Java LTS before 2.73.13
  • Bouncy Castle for Java FIPS (BC-FJA): bcpkix-fips before 1.0.13, 2.0.13, 2.1.13; bcutil-fips before 2.0.8 and 2.1.8

Discovery Timeline

  • 2026-10-03 - CVE CVE-2026-71888 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-71888

Vulnerability Analysis

RFC 5652 section 9.1 requires authAttrs to be present whenever digestAlgorithm is present in a CMS AuthenticatedData structure. Section 9.2 defines two mutually exclusive MAC inputs: the DER encoding of authAttrs when attributes are present, and the eContent OCTET STRING directly when they are not. The CMSAuthenticatedDataParser streaming constructor must choose between these two modes before it has read authAttrs, which appears later in the ASN.1 SEQUENCE. The parser decided based on digestAlgorithm alone.

When a message carried digestAlgorithm absent but authAttrs present, the parser treated it as the no-attributes case. It computed the MAC over eContent only, then exposed the untouched authAttrs through getAuthAttrs() as if they had been authenticated. The content itself remained MAC-bound, so plaintext tampering is not possible — only the authenticated attributes are forgeable.

This issue is a variant of CVE-2026-59642, which addressed MAC binding for messages that legitimately carry authAttrs but did not handle the mismatched-pairing case.

Root Cause

The streaming parser performs a mode selection based on a single ASN.1 field (digestAlgorithm) that an attacker controls independently of authAttrs. Neither asn1.cms.AuthenticatedData nor CMSAuthenticatedDataParser cross-validated that both fields were present or absent together, violating the RFC 5652 pairing requirement.

Attack Vector

An adversary with network position on a CMS-protected channel strips the digestAlgorithm field from an existing valid AuthenticatedData message and inserts an attacker-crafted authAttrs set, for example an RFC 2634 ESSSecurityLabel that elevates the message's classification or routing instruction. The MAC still validates because it only covers the content. Downstream applications that trust the returned attributes act on attacker-chosen values.

java
// Patch excerpt - util/src/main/java/org/bouncycastle/asn1/cms/AuthenticatedData.java
        {
            unauthAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(index), false);
        }
+
+        if ((digestAlgorithm != null) != (authAttrs != null))
+        {
+            throw new IllegalArgumentException("digestAlgorithm and authAttrs must be set together");
+        }
    }

Source: Bouncy Castle commit dcb683b

java
// Patch excerpt - pkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedDataParser.java
    private boolean authAttrNotRead;
    private boolean unauthAttrNotRead;
    private OriginatorInformation originatorInfo;
+   private boolean digestAlgorithmPresent;

    private CMSSecureReadable secureReadable;

Source: Bouncy Castle commit dcb683b

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-71888

Indicators of Compromise

  • CMS AuthenticatedData messages where the digestAlgorithm field is absent but the authAttrs field is populated — this combination violates RFC 5652 section 9.1.
  • Application logs showing authorization or routing decisions derived from getAuthAttrs() on messages received before upgrading to a patched Bouncy Castle release.
  • Unexpected ESSSecurityLabel or other security attribute values appearing on otherwise routine CMS traffic.

Detection Strategies

  • Inventory Java applications and dependencies for vulnerable Bouncy Castle versions using software composition analysis against bcprov, bcpkix, bcutil, and the -fips variants.
  • Add pre-parse validation on CMS messages to reject structures where digestAlgorithm presence does not match authAttrs presence.
  • Hunt for calls to CMSAuthenticatedDataParser.getAuthAttrs() whose return value feeds authorization, routing, or data-labeling logic.

Monitoring Recommendations

  • Capture and retain parser-level exceptions after upgrade; IllegalArgumentException: digestAlgorithm and authAttrs must be set together indicates attempted exploitation or malformed input.
  • Forward Java application logs into a centralized analytics tier to correlate CMS parse failures with upstream network sources.
  • Alert on sudden appearance of ESSSecurityLabel or signingTime attributes on message flows that historically omit them.

How to Mitigate CVE-2026-71888

Immediate Actions Required

  • Upgrade Bouncy Castle for Java to 1.86 or later; LTS users should move to 2.73.13 or later.
  • FIPS users must upgrade bcpkix-fips to 1.0.13, 2.0.13, or 2.1.13, and bcutil-fips to 2.0.8 or 2.1.8 depending on their release series.
  • Audit any application code that trusts attributes returned by CMSAuthenticatedDataParser.getAuthAttrs() and treat historical decisions based on them as suspect.

Patch Information

The fix is delivered in Bouncy Castle commit dcb683b32b440f1beb1d2276a34930164281fb95. asn1.cms.AuthenticatedData now rejects the mismatched pairing during parsing, and CMSAuthenticatedDataParser cross-checks the two fields once authAttrs is read. See the Bouncy Castle CVE-2026-71888 wiki entry for release-specific guidance.

Workarounds

  • If immediate upgrade is not possible, wrap CMS parsing with a validator that rejects any AuthenticatedData whose digestAlgorithm and authAttrs presence disagree.
  • Disregard values returned by getAuthAttrs() for security-relevant decisions until the library is patched; rely on out-of-band attribute sources where available.
  • Restrict CMS message intake to authenticated transport channels (for example, mutual TLS) to reduce the attacker's ability to tamper with messages in transit.
bash
# Maven dependency upgrade example
mvn versions:use-dep-version -Dincludes=org.bouncycastle:bcprov-jdk18on -DdepVersion=1.86 -DforceVersion=true
mvn versions:use-dep-version -Dincludes=org.bouncycastle:bcpkix-jdk18on -DdepVersion=1.86 -DforceVersion=true

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.