IT SBIT Services
Schneeberger
DEEN
CVE tracker

bc-csharp: Name constraint bypass in directoryName certificate path validation

CVE-2026-63577High 8.2

← All vulnerabilities

Summary

Improper matching of directoryName name constraints in bc-csharp (BouncyCastle.Cryptography for .NET) allows a certificate subject to contain extra RDNs ahead of a permitted subtree and still be treated as inside that subtree. An attacker who controls, or can get certificates issued by, a name-constrained intermediate CA can therefore have certificates accepted whose subject name or directoryName subject alternative name lies outside the permitted namespace. This matters only for applications that validate paths with PkixCertPathValidator or PkixCertPathBuilder, trust such CAs, and rely on the subject name for identity or authorization.

Affected

  • bc-csharp (BouncyCastle.Cryptography) versions before 2.7.0
  • Vendor wiki: BC C# .NET 2.6.2 and earlier, and 2.7.0-beta.98 pre-release
  • Affects all CLRs; only directoryName name constraints are affected

Fixed in

  • Upgrade to bc-csharp 2.7.0 or later

Workaround

  • No configuration setting corrects the matching in earlier versions.
  • Applications that depend on directoryName name constraints can check, after successful path validation, that the end-entity subject name and any directoryName subject alternative names begin with the full RDN sequence of a subtree the constrained CA is permitted to use.

Exploitation

  • No evidence of exploitation in the wild found.
  • No public proof of concept known.
  • CISA SSVC assessment: exploitation none, automatable no, technical impact partial.

Our recommendation

  • Inventory bc-csharp / BouncyCastle.Cryptography versions in SBOMs, lockfiles and deployed binaries, including vendor appliances and in-house applications.
  • Upgrade to 2.7.0 or later, starting with services that perform certificate chain validation.
  • If the upgrade is delayed, apply the subject-prefix check described in the vendor wiki.
  • Check whether any internal CA uses directoryName name constraints; if none does, the risk is low.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 17:31.

Original description (NVD)

Improper certificate validation in the directoryName name-constraint check (PkixNameConstraintValidator.WithinDNSubtree) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows an attacker who controls, or can have certificates issued by, a name-constrained intermediate CA to get certificates accepted by PKIX path validation whose subject distinguished name, or a directoryName subjectAltName, lies outside the CA's permitted subtrees, via a name that places other RDNs ahead of a copy of the permitted RDN sequence, because the check looks for the constraint's first RDN anywhere in the name and compares the remaining RDNs from that position, instead of requiring the constraint to be an initial prefix of the name as RFC 5280 sections 4.2.1.10 and 7.1 require.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.