Skip to main content

Bouncy Castle CVE-2026-103604

| EUVDEUVD-2026-91234 HIGH
Inefficient Algorithmic Complexity (CWE-407)
2026-10-02 bcorg GHSA-p48w-99f8-9598
8.7
CVSS 4.0 · Vendor: bcorg
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft X.509 name with long escape-heavy value
  2. Delivery
    Submit cert/CRL/CSR to target service
  3. Exploit
    Service parses and calls ToString/RdnAreEqual
  4. Execution
    Quadratic escaping loop runs
  5. Impact
    CPU exhaustion denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
Exploitation Conditions

Exploitation requires that the victim application (1) parses an attacker-supplied X.509 structure - certificate, CRL, certification request, or other DN-bearing structure - using bc-csharp before 2.7.0, AND (2) subsequently converts that name to a string via X509Name.ToString / IetfUtilities.ValueToString (for logging or display) OR compares it with IetfUtilities.RdnAreEqual, as PKIX path validation does when enforcing directoryName name constraints. The malicious attribute value must contain a long sequence of characters that must be escaped (commas, quotes, backslashes, +, =, <, >, ;) or long runs of leading/trailing spaces, so that the quadratic work dominates. The principal LIMITING factor is that merely accepting a certificate is insufficient - the vulnerable string-conversion or RDN-comparison code path must actually execute on the untrusted name; services that validate certificates without stringifying/comparing attacker-controlled DNs are not exposed.

Impact

This is a genuine availability-impact denial-of-service issue rather than a high-CVSS-but-low-real-risk artifact, but its real-world severity is heavily mediated by application behavior. The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) and the equivalent 3.1 profile both indicate a remote, unauthenticated, low-complexity vector with no confidentiality or integrity impact and HIGH availability impact - consistent with the CWE-407 (algorithmic complexity) root cause: a quadratic O(n^2) escaping loop in X509Name.ToString / IetfUtilities.ValueToString confirmed directly by the vendor commit diff (bd03e38). No EPSS score was supplied and the CVE is NOT in CISA KEV, so there is no evidence of active exploitation; the GitHub commit demonstrates the fix but no standalone weaponized POC is referenced. The 8.7 score is plausible for a network-reachable DoS, but note a key caveat: the attacker does not trigger the cost merely by sending a certificate - the victim application must convert the malicious name to a string (to log/display) or compare it via RdnAreEqual/PKIX directoryName name-constraint validation. Where that processing does not occur on untrusted input, real risk is substantially lower than the raw score implies. Treat as a patch-soon issue for any .NET service that parses and logs/validates externally-supplied X.509 material.

Exploit ScenarioDerived

A remote unauthenticated attacker submits a certificate, CRL, or certification request containing a distinguished name whose attribute value is a very long run of characters requiring RFC 4514 escaping (e.g. thousands of commas or leading/trailing spaces) to a .NET service that uses bc-csharp. When the service converts that name to a string to log or display it, or compares it during PKIX path validation of directoryName name constraints, the quadratic escaping routine consumes CPU proportional to n^2, exhausting a core and degrading or hanging the service. No public exploit is identified at time of analysis, but the vendor commit clearly documents the quadratic character-move cost.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 02, 2026

Denial of service in the Legion of the Bouncy Castle C

library (bc-csharp) affects all versions before 2.7.0, where quadratic CPU work in X.509 distinguished-name string conversion lets a remote unauthenticated attacker exhaust a server's CPU with a single crafted certificate, CRL, certification request, or other DN-bearing structure containing a long attribute value of characters that require RFC 4514 escaping. Exposure requires that the application actually converts the untrusted name to a string via X509Name.ToString / IetfUtilities.ValueToString (for logging or display) or compares it with IetfUtilities.RdnAreEqual, as PKIX path validation does when enforcing directoryName name constraints; merely parsing the certificate is not enough. There is no confirmed active exploitation (not in CISA KEV) and no public exploit code identified at time of analysis, but a vendor patch is available and the availability-only impact (CVSS:4.0 8.7 / assessed CVSS:3.1 7.5, A:H) makes application-level exposure the decisive risk factor.

RemediationAI

Vendor-released patch: upgrade Bouncy Castle bc-csharp to 2.7.0 or later (all earlier versions are affected), which contains the linear-time escaping rewrite in IetfUtilities.AppendValue/ValueToString and the X509Name constructor changes from commit bd03e38; see the vendor advisory at https://github.com/bcgit/bc-csharp/wiki/CVE-2026-103604. If an immediate upgrade is not possible, treat untrusted DNs as hostile input rather than normal strings: cap the size of accepted certificates, CRLs, PKCS#10 requests, and other ASN.1 structures at the transport or parser layer to bound the length of any attribute value before it reaches the vulnerable code path (trade-off: overly tight limits can reject legitimate enterprise DNs with long multi-valued RDNs), and avoid invoking X509Name.ToString, IetfUtilities.ValueToString, or IetfUtilities.RdnAreEqual on attacker-controlled names, for example by logging a hash or a pre-sanitized, length-truncated identifier instead of the raw name (trade-off: reduced diagnostic fidelity in logs and audit trails). Where directoryName name constraints are the trigger, non-validating deployments can temporarily disable or restrict that constraint type, but this weakens PKIX enforcement and should be paired with an upstream upgrade as soon as practical (trade-off: relaxing name-constraint checks can admit certificates outside the intended namespace). Finally, apply timeouts, per-request CPU budgets, and rate limiting on certificate-processing endpoints so a single pathological DN cannot monopolize worker threads; these are compensating controls only and do not remove the underlying quadratic behavior.

Affected VersionsENISA

bc-csharp 0 <2.7.0

Affected Packages

euvd bc_csharp fix: 2.7.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-407 (inefficient algorithmic complexity) inside Bouncy Castle's C

X.500 name formatting code, specifically IetfUtilities.ValueToString and the X509Name.ToString path that renders a distinguished name into its RFC 4514 string form. The pre-2.7.0 implementation escaped special characters by calling StringBuilder.Insert on the very buffer it was scanning, so each inserted backslash shifted the remaining content and forced an O(n) copy; with n escapable characters (',', '"', '\\', '+', '=', '<', '>', ';') or n leading/trailing spaces, the total work approached n^2/2 character moves, producing CPU exhaustion on attacker-sized RDN values. X509Name construction was also rewritten to consume AttributeTypeAndValue instances directly rather than re-parsing each sequence element. The CPE cpe:2.3:a:legion_of_the_bouncy_castle_inc.:bc-csharp:*:*:*:*:*:*:*:* matches all released variants of the library before 2.7.0, and Java consumers of the sibling Bouncy Castle distribution are not covered by this C#-specific record. The upstream fix (commit bd03e38) replaces the in-place escaping with a single linear pass that appends into a fresh StringBuilder, preserving identical output while making the conversion O(n); the same class of defect is what makes DN stringification of untrusted certificates a denial-of-service sink in PKI validation pipelines.

Know when Bc Csharp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (bcorg) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Remote attacker-supplied X.509 name triggers quadratic CPU cost with no auth or interaction (AV:N/AC:L/PR:N/UI:N); only availability is affected (C:N/I:N/A:H).

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (bcorg).

CVSS VectorVendor: bcorg

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

The Bouncy Castle C

cryptography library (bc-csharp), used across many .NET applications for certificate and PKI processing, is affected by a high-severity denial-of-service flaw in all versions prior to 2.7.0. A single crafted certificate, CRL, or certification request containing a long specially-formatted distinguished-name attribute can consume disproportionate CPU whenever an application converts that name to a string for logging or display, or compares it during PKIX path validation - meaning a small volume of malicious input can degrade or take down certificate-handling services. Leadership should care because affected systems are typically internet-facing TLS, PKI, or signing components, so the exposure is availability of customer-facing services rather than data loss, and remediation requires tracking down every application embedding the library rather than patching a single server.

Business Impact: High
Compensating Controls

Apply vendor patch. If upgrading to bc-csharp 2.7.0 cannot be completed immediately, restrict or rate-limit untrusted certificate, CRL, and CSR submission endpoints, and avoid calling X509Name.ToString / IetfUtilities.ValueToString on untrusted DN-bearing structures or comparing them with IetfUtilities.RdnAreEqual until the upgrade is in place.

Threat Intelligence Overview

EPSS Score
0.3%
Top 84% exploitable
Prevalence
High
Bouncy Castle C# is a widely used crypto library across .NET applications
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2026-63569 CRITICAL
9.1 Oct 02

Crafted small-order or out-of-range Diffie-Hellman values passed to DHAgreement.CalculateAgreement in Bouncy Castle C# (

CVE-2026-103603 HIGH
8.7 Oct 02

Memory exhaustion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows a remote, unauthenticated attacker to cause a deni

CVE-2026-63566 HIGH
8.7 Oct 02

Memory-exhaustion denial of service in the C# DTLS implementation of Bouncy Castle (bc-csharp) before 2.7.0 lets a remot

CVE-2026-63568 HIGH
8.7 Oct 02

Denial of service in Legion of the Bouncy Castle's C# cryptography library (bc-csharp) before 2.7.0 lets an unauthentica

CVE-2026-103600 HIGH
8.7 Oct 02

Uncontrolled recursion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows unauthenticated remote attackers to crash or

CVE-2026-63574 HIGH
8.7 Oct 02

Denial of service in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows unauthenticated remote attackers to

CVE-2026-16000 HIGH
8.7 Oct 02

Authentication-tag forgery in Legion of the Bouncy Castle Inc. bc-csharp (Bouncy Castle C#) before 2.7.0 lets a remote,

CVE-2026-63571 HIGH
8.7 Oct 02

Forged X.509 attribute certificates are accepted as valid by Legion of the Bouncy Castle Inc. bc-csharp versions before

CVE-2026-63567 HIGH
8.2 Oct 02

Observable padding discrepancy in the IES/ECIES decryption path of Bouncy Castle C# (bc-csharp) before 2.7.0 lets an una

CVE-2026-63573 HIGH
8.2 Oct 02

RSA PKCS#1 v1.5 key transport in the Bouncy Castle C# (bc-csharp) CMS implementation before 2.7.0 is vulnerable to a Ble

CVE-2026-103601 HIGH
8.2 Oct 02

Information disclosure in Bouncy Castle C# (bc-csharp) versions before 2.7.0 allows unauthenticated remote attackers to

CVE-2026-103602 HIGH
8.2 Oct 02

Certificates that should be rejected by PKIX name constraints are accepted by Legion of the Bouncy Castle Inc. bc-csharp

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy