CVE-2026-103604 in bc-csharpinfo

Summary

by MITRE • 10/02/2026

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.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 10/02/2026

The vulnerability identified in Legion of the Bouncy Castle Inc. bc-csharp prior to version 2.7.0 represents a critical algorithmic complexity flaw within the X.509 distinguished name string conversion mechanisms, specifically affecting the X509Name.ToString and IetfUtilities.ValueToString methods. This issue stems from an inefficient implementation that fails to account for quadratic time complexity when processing specific character sequences in certificate attributes. The core technical defect occurs during the serialization of attribute values that require escaping, such as commas or strings with leading and trailing spaces. In these scenarios, each inserted backslash is added into a buffer that is simultaneously being scanned, causing the computational work required to grow quadratically relative to the length of the input value rather than linearly. This design flaw means that as the size of the malicious attribute increases, the processing time escalates exponentially, creating a significant performance bottleneck that can be exploited by an attacker.

From an operational perspective, this vulnerability enables remote unauthenticated attackers to cause a denial of service through CPU exhaustion. The attack vector is triggered when applications interact with X.509 structures such as certificates, Certificate Revocation Lists (CRLs), or certification requests containing crafted distinguished names. Specifically, the flaw is exploited during operations that convert these names into strings for logging, display purposes, or comparison against other values using methods like IetfUtilities.RdnAreEqual. A prominent example of this exposure occurs during PKIX path validation processes where directoryName name constraints are evaluated. If a malicious certificate presents an attribute value with numerous escaped characters, the system will spend disproportionate amounts of CPU cycles attempting to process and compare these strings, potentially leading to complete service unavailability for legitimate users or causing resource exhaustion on the host machine running the vulnerable library.

This vulnerability is classified under CWE-400, which denotes Uncontrolled Resource Consumption, as it allows an attacker to consume excessive computational resources through a single crafted input. Furthermore, from a tactical standpoint related to the MITRE ATT&CK framework, this flaw aligns with techniques associated with Denial of Service (T1499) and potentially impacts Availability in the context of cryptographic processing failures. The quadratic complexity issue highlights a common pitfall in security libraries where string manipulation operations are not optimized for adversarial inputs designed to maximize computational overhead.

To mitigate this risk, organizations utilizing bc-csharp must immediately upgrade to version 2.7.0 or later, which addresses the inefficient algorithmic complexity by optimizing the buffer handling and escaping logic during distinguished name conversion. Until an update can be applied, defensive measures should include implementing strict input validation on X.509 attributes before they are processed for string representation. Limiting the maximum length of attribute values in certificates and CRLs accepted by the application can also serve as a temporary control to prevent the quadratic scaling effect from reaching critical thresholds. Additionally, monitoring CPU usage spikes during certificate parsing operations may help detect potential exploitation attempts in real-time, allowing for rapid incident response before total system degradation occurs.

Responsible

Bcorg

Reservation

10/01/2026

Disclosure

10/02/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!