CVE-2026-103600 in bc-csharpinfo

Summary

by MITRE • 10/02/2026

Uncontrolled recursion in the ASN.1 parser (Asn1InputStream, Asn1StreamParser) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows a remote unauthenticated attacker to cause a denial of service via a crafted ASN.1 encoding of deeply nested constructed elements (for example SEQUENCE inside SEQUENCE, in definite-length DER or indefinite-length BER form), because each nesting level is parsed by a further recursive call with no bound on depth. About 2,000 levels (8 KB of DER) are enough to exhaust a 1.5 MB thread stack, the .NET main-thread default on Windows, and raise a StackOverflowException, which .NET cannot catch and which terminates the whole process; on threads with larger stacks, parse time instead grows quadratically with depth (about 9 seconds of CPU for a 64 KB input). Any path that parses untrusted ASN.1 is exposed, including X.509 certificates and CRLs, CMS/PKCS#7, PKCS#8/PKCS#12, OCSP and TLS Certificate messages.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 10/02/2026

The vulnerability identified in the Bouncy Castle cryptography library for .NET, specifically within versions prior to 2.7.0, represents a critical uncontrolled recursion flaw located in the ASN.1 parsing components known as Asn1InputStream and AsnStreamParser. This issue stems from the fundamental design of the parser which utilizes recursive function calls to traverse nested constructed elements inherent in Abstract Syntax Notation One (ASN.1) data structures. When processing input that contains deeply nested constructs, such as a SEQUENCE element containing another SEQUENCE ad infinitum, each level of nesting triggers an additional stack frame allocation on the call stack. Because there is no explicit depth limit or counter implemented to restrict this recursion, the parser continues to consume memory resources until it exceeds the available thread stack space. This architectural oversight allows a remote unauthenticated attacker to exploit the flaw by submitting maliciously crafted ASN.1 encodings designed specifically to trigger excessive nesting levels.

The operational impact of this vulnerability is severe and manifests primarily as a denial of service condition through application crash or resource exhaustion. On Windows systems utilizing the default .NET main thread stack size of approximately 1.5 megabytes, an attacker needs only to provide about two thousand levels of nested elements, which corresponds to roughly eight kilobytes of DER-encoded data, to exhaust the available stack space. This results in a StackOverflowException that cannot be caught by standard exception handling mechanisms within the .NET runtime, leading directly to the termination of the entire application process rather than just failing the specific parsing operation. For threads configured with larger stack sizes, while immediate crashes may not occur immediately, the parse time grows quadratically relative to the depth of nesting. In scenarios involving a sixty-four kilobyte input, this can result in approximately nine seconds of CPU consumption per request, effectively creating a resource exhaustion vector that can degrade system performance or cause timeouts for legitimate users if such inputs are processed repeatedly.

This vulnerability affects any code path within an application that utilizes the Bouncy Castle library to parse untrusted ASN.1 data. Common attack surfaces include the processing of X.509 certificates and Certificate Revocation Lists (CRLs), Cryptographic Message Syntax (CMS) or PKCS#7 envelopes, private key formats such as PKCS#8 and PKCS#12, Online Certificate Status Protocol (OCSP) responses, and TLS handshake messages containing certificate data. Since these protocols are foundational to secure communications in many enterprise environments, an attacker could target public-facing services like web servers, API gateways, or email systems that handle digital certificates. The ability to crash the hosting process remotely without authentication makes this a high-severity threat capable of disrupting critical infrastructure and compromising availability guarantees for dependent applications.

From a classification perspective, this vulnerability aligns with CWE-675, which denotes operations on uncontrolled data structures leading to resource exhaustion, specifically through recursive processing limits. In terms of the MITRE ATT&CK framework, this exploit technique falls under T1499 Endpoint Denial of Service, where an adversary uses specific methods like application or service crashes via stack overflow to disrupt availability. The lack of input validation regarding nesting depth is a classic example of insufficient boundary checks on recursive algorithms. To mitigate this risk, organizations must immediately upgrade the Bouncy Castle library for .NET to version 2.7.0 or later, where developers have implemented safeguards against unbounded recursion. Additionally, defensive coding practices should include implementing explicit maximum depth limits in custom ASN.1 parsers and utilizing stack size monitoring tools during penetration testing to identify similar vulnerabilities in other cryptographic libraries that may share this architectural pattern.

Responsible

Bcorg

Reservation

10/01/2026

Disclosure

10/02/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!