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

CVE-2026-103602: Bouncy Castle Certificate Validation Bypass

CVE-2026-103602 is an information disclosure vulnerability in Bouncy Castle bc-csharp that allows attackers to bypass name constraints in certificate validation. This article covers the technical details, affected versions, and mitigation.

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-103602 Overview

CVE-2026-103602 is an improper certificate validation flaw [CWE-295] in the PkixNameConstraintValidator component of Legion of the Bouncy Castle bc-csharp prior to version 2.7.0. The validator failed to strip the RFC 1034 root-label trailing dot before comparing names against name constraints. An attacker who controls, or can obtain certificates from, a name-constrained intermediate certificate authority (CA) can get certificates accepted during PKIX certification path validation for rfc822Name, dNSName, or uniformResourceIdentifier values that should fall within excluded subtrees for that CA.

Critical Impact

A name-constrained intermediate CA can issue certificates for hosts, email addresses, or URIs that should be excluded, undermining the integrity guarantees of PKIX path validation.

Affected Products

  • Legion of the Bouncy Castle bc-csharp versions prior to 2.7.0
  • .NET applications performing PKIX certification path validation via PkixNameConstraintValidator
  • Systems relying on name-constrained intermediate CAs with rfc822Name, dNSName, or uniformResourceIdentifier subtree exclusions

Discovery Timeline

  • 2026-10-02 - CVE-2026-103602 published to the National Vulnerability Database (NVD)
  • 2026-10-02 - Last updated in the NVD database

Technical Details for CVE-2026-103602

Vulnerability Analysis

The vulnerability resides in the name-constraint matching logic used during PKIX certification path validation in bc-csharp. When the validator compared a certificate's rfc822Name, dNSName, or uniformResourceIdentifier value against an excluded subtree, it did not canonicalize the host component by removing the RFC 1034 root-label trailing dot. A fully qualified host name written with a trailing dot therefore failed to match the same host written without the dot in an excluded subtree.

This mismatch allows a malicious or compromised intermediate CA, whose authority is constrained via excludedSubtrees, to issue leaf certificates that bypass those exclusions. Although confidentiality and availability are not directly affected, integrity of the trust decision is broken: relying parties will accept certificates for identities that the trust anchor explicitly excluded.

Root Cause

The root cause is inconsistent canonicalization during construction and comparison of name constraints. Names and constraints were compared without first stripping the single trailing dot used in DNS and related syntaxes to indicate the root label. Because host.example.com. and host.example.com were not normalized to a common form, the containment check against an excluded subtree returned a negative result when it should have returned positive.

Attack Vector

An attacker who controls a name-constrained intermediate CA, or who can obtain certificates from one, crafts a leaf certificate with a Subject Alternative Name whose host ends in a dot. The leaf is then presented to a client application that uses PkixNameConstraintValidator to perform path validation. The validator traverses the chain, evaluates the excluded subtrees declared on the intermediate, and incorrectly concludes that the dotted name is not within the excluded set.

The fix moves canonicalization and validation into construction of the name-constraint objects, strips the trailing dot once, and fails closed on malformed host labels.

text
// Patch excerpt: crypto/src/pkix/NameConstraintEmail.cs
// Construction is the only way in, and it validates as well as canonicalises:
// the single RFC 1034 root-label trailing dot (of the host, which is always
// the string tail) is stripped once, here; the value's shape ... is classified
// once, here, into a NameConstraintHostNameKind, with the host comparand
// cached alongside; and the host part is then rejected if it contains an
// empty label (fail-closed).

internal static NameConstraintEmail FromConstraint(string constraint) =>
    new NameConstraintEmail(
        NameConstraintUtilities.StripTrailingDot(constraint),
        isConstraint: true);

Source: bc-csharp commit be276e05

Detection Methods for CVE-2026-103602

Indicators of Compromise

  • Certificates whose Subject Alternative Name dNSName, rfc822Name, or uniformResourceIdentifier values contain a trailing dot in the host portion.
  • End-entity certificates chaining to a name-constrained intermediate CA that assert identities overlapping declared excludedSubtrees.
  • TLS, S/MIME, or signed-URI validation events that succeed against hosts expected to be blocked by an intermediate CA's name constraints.

Detection Strategies

  • Inventory .NET applications and libraries that depend on BouncyCastle.Cryptography or legacy BouncyCastle NuGet packages, and flag versions below 2.7.0.
  • Audit certificate stores and recently observed TLS handshakes for SAN entries that end with a dot, which are rare in benign traffic.
  • Where feasible, re-run PKIX path validation of recently accepted certificates with a patched 2.7.0 validator and compare outcomes.

Monitoring Recommendations

  • Centralize TLS and PKI telemetry so that certificates issued by name-constrained intermediates can be correlated against observed SANs.
  • Alert on validation libraries loading BouncyCastle.Cryptography assemblies with versions earlier than 2.7.0 in production workloads.
  • Track issuance from internal name-constrained CAs and alert on leaf certificates whose SAN values include trailing-dot hosts.

How to Mitigate CVE-2026-103602

Immediate Actions Required

  • Upgrade bc-csharp to version 2.7.0 or later in every .NET application that performs PKIX certification path validation.
  • Rebuild and redeploy downstream libraries and services that statically reference older Bouncy Castle assemblies.
  • Review trust configurations for intermediate CAs that rely on excludedSubtrees for dNSName, rfc822Name, or uniformResourceIdentifier types.

Patch Information

The fix is included in Legion of the Bouncy Castle bc-csharp 2.7.0. The patch moves name-constraint validation to construction time, strips the RFC 1034 trailing dot once, and rejects host components containing empty labels. See the upstream commits for implementation details: commit 75c3c57, commit be276e05, and commit f196a22. Advisory details are published in the bc-csharp CVE-2026-103602 wiki page.

Workarounds

  • If upgrading is not immediately possible, reject at the application layer any certificate whose SAN host component ends with a dot before invoking the validator.
  • Reduce reliance on excludedSubtrees as a sole security boundary; combine with allowlists of acceptable issuer and identity pairs.
  • Restrict issuance from name-constrained intermediate CAs to automated pipelines that normalize SAN inputs and reject trailing-dot hosts.
bash
# Update the Bouncy Castle NuGet package to a fixed version
dotnet add package BouncyCastle.Cryptography --version 2.7.0
dotnet restore
dotnet build --configuration Release

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.