Skip to main content
Vulnerability Database/CVE-2026-63570

CVE-2026-63570: Bouncy Castle bc-csharp DOS Vulnerability

CVE-2026-63570 is a denial of service vulnerability in Bouncy Castle bc-csharp caused by an infinite loop in certificate chain processing. Attackers can exploit crafted PKCS#12 files to exhaust system resources. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-63570 Overview

CVE-2026-63570 is a denial-of-service vulnerability in the Legion of the Bouncy Castle bc-csharp cryptography library affecting versions before 2.7.0. The flaw resides in Pkcs12Store.GetCertificateChain, where the chain-building loop lacks a visited-set guard. An attacker who can supply a crafted PKCS#12 file to an application that loads it and requests a key entry's certificate chain triggers an infinite loop. The loop consumes CPU and memory until an OutOfMemoryException terminates the process. The issue is classified under CWE-835: Loop with Unreachable Exit Condition.

Critical Impact

A single malicious PKCS#12 file can exhaust CPU and memory on any .NET application that invokes GetCertificateChain, resulting in process termination through OutOfMemoryException.

Affected Products

  • Legion of the Bouncy Castle Inc. bc-csharp versions prior to 2.7.0
  • .NET applications consuming Org.BouncyCastle.Pkcs.Pkcs12Store for PKCS#12 keystore parsing
  • Downstream libraries and services that expose PKCS#12 import to untrusted input

Discovery Timeline

  • 2026-10-02 - CVE-2026-63570 published to the National Vulnerability Database
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-63570

Vulnerability Analysis

The defect lives in Pkcs12Store.GetCertificateChain within crypto/src/pkcs/Pkcs12Store.cs. The method walks certificate issuer links to assemble a chain from the leaf entry to a root. The loop terminates only under two conditions: no issuer can be located, or a certificate's AuthorityKeyIdentifier points to itself. It does not track previously visited certificates. When two or more certificates form an issuer cycle through their AuthorityKeyIdentifier extensions, the loop appends entries indefinitely to the output list. The process grows unbounded until the .NET runtime throws OutOfMemoryException.

Signatures are not verified during traversal. Key-identifier links are followed on name match alone, so any attacker-controlled PKCS#12 bundle can seed the cycle without needing a valid signing key.

Root Cause

The chain assembly loop fails to maintain state about certificates it has already processed. Any directed graph with a cycle in the issuer relationship produces nonterminating iteration. The fix introduces a visited-set guard so that a certificate encountered a second time ends the walk.

Attack Vector

Exploitation requires that a target application load an attacker-supplied PKCS#12 file and request a key entry's certificate chain. The attacker crafts a bundle containing two certificates whose AuthorityKeyIdentifier extensions each identify the other's public key. User interaction is required to supply the file. Delivery vectors include certificate upload forms, mTLS keystore import flows, document signing services, and automated certificate ingestion pipelines.

text
             if (c == null)
                 return null;
 
+            // TODO Ideally an insertion-order Set instead
             var cs = new List<X509CertificateEntry>();
 
             while (c != null)

Source: bcgit/bc-csharp commit 1b8fad04. The patch prepares the chain-building loop to track visited entries so a cycle no longer loops forever.

Detection Methods for CVE-2026-63570

Indicators of Compromise

  • .NET process termination events citing System.OutOfMemoryException originating from Org.BouncyCastle.Pkcs.Pkcs12Store.GetCertificateChain
  • Sustained single-core CPU saturation by a .NET worker process shortly after a PKCS#12 upload or import
  • Rapid private working-set growth in services that parse user-supplied .p12 or .pfx files

Detection Strategies

  • Inventory applications that reference BouncyCastle.Cryptography or Portable.BouncyCastle NuGet packages below 2.7.0
  • Instrument PKCS#12 import endpoints with timeouts and memory ceilings, then alert on breaches
  • Parse submitted PKCS#12 files out-of-band and flag bundles whose AuthorityKeyIdentifier graph contains cycles

Monitoring Recommendations

  • Forward .NET crash dumps and Windows Error Reporting events to a central log pipeline for review
  • Track per-request memory allocations on APIs that accept certificate uploads
  • Correlate certificate-import traffic with worker-process restarts to identify abuse attempts

How to Mitigate CVE-2026-63570

Immediate Actions Required

  • Upgrade bc-csharp to version 2.7.0 or later across all .NET services and dependencies
  • Audit transitive dependencies with dotnet list package --vulnerable --include-transitive to surface pinned older versions
  • Place resource limits on processes that call Pkcs12Store.GetCertificateChain with untrusted input

Patch Information

The fix is published in bc-csharp 2.7.0. The code change is tracked in bcgit/bc-csharp commit 1b8fad04 and documented in the CVE-2026-63570 project wiki. Rebuild and redeploy any application that statically references the vulnerable assembly.

Workarounds

  • Reject PKCS#12 uploads from untrusted sources until the library upgrade is deployed
  • Validate incoming bundles with an alternative parser that detects issuer cycles before invoking Bouncy Castle
  • Run PKCS#12 import logic in a sandboxed worker with hard CPU and memory quotas to contain exhaustion
bash
# Upgrade the vulnerable package in a .NET project
dotnet add package BouncyCastle.Cryptography --version 2.7.0

# Verify no transitive references pin an older version
dotnet list package --vulnerable --include-transitive

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.