CVE-2026-103600: CWE-674 Uncontrolled Recursion in Legion of the Bouncy Castle Inc. bc-csharp
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.
AI Analysis
Technical Summary
The vulnerability arises from the ASN.1 parser in bc-csharp versions prior to 2.7.0, which uses recursive calls to parse nested ASN.1 constructed elements without limiting recursion depth. Approximately 2,000 nested levels (about 8 KB of DER data) can exhaust the default 1.5 MB thread stack on Windows, causing a StackOverflowException that terminates the process. On threads with larger stacks, parsing time increases quadratically with nesting depth, significantly degrading performance. This flaw allows remote unauthenticated attackers to trigger denial of service by supplying malicious ASN.1 data in various protocols and formats that rely on ASN.1 parsing.
Potential Impact
Successful exploitation results in denial of service due to stack exhaustion and process termination via a StackOverflowException in the .NET runtime. This affects any application using vulnerable versions of bc-csharp to parse untrusted ASN.1 data, potentially disrupting services that handle certificates, cryptographic messages, and related protocols. There is no indication of code execution or data disclosure from this vulnerability.
Mitigation Recommendations
A fixed version 2.7.0 of bc-csharp is available that addresses this uncontrolled recursion issue. Users should upgrade to version 2.7.0 or later to remediate this vulnerability. No other vendor advisory content is provided, so patching is the primary recommended mitigation.
CVE-2026-103600: CWE-674 Uncontrolled Recursion in Legion of the Bouncy Castle Inc. bc-csharp
Description
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.
CVSS v4.0
Score 8.7high
Affected software
Legion of the Bouncy Castle Inc.
bc-csharp
pkg:nuget/BouncyCastle.CryptographyRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from the ASN.1 parser in bc-csharp versions prior to 2.7.0, which uses recursive calls to parse nested ASN.1 constructed elements without limiting recursion depth. Approximately 2,000 nested levels (about 8 KB of DER data) can exhaust the default 1.5 MB thread stack on Windows, causing a StackOverflowException that terminates the process. On threads with larger stacks, parsing time increases quadratically with nesting depth, significantly degrading performance. This flaw allows remote unauthenticated attackers to trigger denial of service by supplying malicious ASN.1 data in various protocols and formats that rely on ASN.1 parsing.
Potential Impact
Successful exploitation results in denial of service due to stack exhaustion and process termination via a StackOverflowException in the .NET runtime. This affects any application using vulnerable versions of bc-csharp to parse untrusted ASN.1 data, potentially disrupting services that handle certificates, cryptographic messages, and related protocols. There is no indication of code execution or data disclosure from this vulnerability.
Mitigation Recommendations
A fixed version 2.7.0 of bc-csharp is available that addresses this uncontrolled recursion issue. Users should upgrade to version 2.7.0 or later to remediate this vulnerability. No other vendor advisory content is provided, so patching is the primary recommended mitigation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- bcorg
- Date Reserved
- 2026-09-30T23:01:10.053Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abf5de5a43b0b3b8988e873
Added to database: 10/02/2026, 07:31:49 UTC
Last enriched: 10/02/2026, 07:47:13 UTC
Last updated: 10/02/2026, 21:45:56 UTC
Views: 13
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.