CVE-2026-103604: Quadratic-time escaping when converting X.509 distinguished names to strings
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.
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
Which applications are exposed to this denial-of-service issue?
Applications using Bouncy Castle bc-csharp before 2.7.0 are exposed when they convert attacker-controlled X.509 distinguished names to strings. This can occur when names from certificates, CRLs, certification requests, or similar structures are logged, displayed, compared with IetfUtilities.RdnAreEqual, or processed during PKIX path validation for directoryName name constraints.
What does an attacker need to do to trigger the issue?
An unauthenticated remote attacker needs to supply a structure containing a distinguished-name attribute with a long value that requires escaping, such as many commas or leading or trailing spaces. Triggering requires the application to process that name through the affected string-conversion or comparison path.
Are all uses of the affected library vulnerable by default?
No. Exposure depends on whether the application converts an attacker-controlled distinguished name to a string or performs the affected RDN comparison. The provided information does not identify a universally affected default configuration.
What is the remediation?
Upgrade Bouncy Castle bc-csharp to version 2.7.0 or later. If upgrading cannot happen immediately, avoid or limit processing of untrusted certificates, CRLs, certification requests, and other structures whose distinguished names may be converted, logged, displayed, or compared.