Bouncy Castle bc-csharp: Denial of service via quadratic-time X.509 name escaping
Summary
The bc-csharp cryptography library converts X.509 distinguished names to strings with an algorithm whose run time grows quadratically with the length of an attribute value. A remote, unauthenticated attacker can supply a certificate, CRL, certification request or similar structure with a long value containing characters that need escaping, such as commas, and exhaust CPU resources. Exposure depends on the application converting such names to strings, for example for logging or display, or on PKIX path validation with directoryName name constraints.
Affected
- bc-csharp (NuGet package BouncyCastle.Cryptography) before 2.7.0
- BC C# .NET 2.6.2 and earlier, and 2.7.0-beta.98 pre-release
Fixed in
- Upgrade to BC C# .NET 2.7.0 or later (fix commit bd03e38bbb49db5be33f4463fc40997400c545cc)
Workaround
- Check the length of attribute values before converting a name to a string, and skip or truncate overly long values
- Limit the size of certificates, CRLs and requests accepted from untrusted parties
No vendor workaround beyond these measures is documented.
Exploitation
- CISA SSVC: exploitation none, automatable no, technical impact partial
- Not listed in KEV according to a third-party source; EPSS about 0.00259
- No public proof of concept or in-the-wild exploitation found in the limited search performed
Our recommendation
- Inventory .NET applications that use the BouncyCastle.Cryptography NuGet package and check their version
- Upgrade to version 2.7.0 or later, prioritising internet-facing services and services that process certificates from untrusted sources
- Until the upgrade is done, apply input size limits for certificates and requests and monitor for CPU exhaustion
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- Vendor wiki: CVE-2026-103604 github.com
- Fix commit bd03e38bbb49db5be33f4463fc40997400c545cc github.com
- OSV: CVE-2026-103604 osv.dev
- Vulners: CVE-2026-103604 vulners.com
- OpenCVE: CVE-2026-103604 app.opencve.io
- VulDB: CVE-2026-103604 vuldb.com
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, 06:13.
Original description (NVD)
Inefficient algorithmic complexity in X.509 distinguished name string conversion (X509Name.ToString and IetfUtilities.ValueToString) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows a remote unauthenticated attacker to cause a denial of service through CPU exhaustion via a certificate, CRL, certification request or other structure whose name contains a long attribute value made up of characters that must be escaped, such as commas, or of leading or trailing spaces, because each escaping backslash was inserted into the buffer being scanned, so the work grew quadratically with the length of the value. Applications are exposed when they convert such a name to a string, for example to log or display it, or compare it with IetfUtilities.RdnAreEqual, as PKIX path validation does for directoryName name constraints.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
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.
