IT SBIT Services
Schneeberger
DEEN
CVE tracker

Bouncy Castle bc-csharp: Uncontrolled recursion in ASN.1 parser

CVE-2026-103600High 8.7

← All vulnerabilities

Summary

bc-csharp (BouncyCastle.Cryptography for .NET) before 2.7.0 does not limit the nesting depth of ASN.1 structures. A remote, unauthenticated attacker can send a small, deeply nested encoding (about 8 KB) to any application that parses untrusted ASN.1, such as X.509 certificates, CRLs, CMS, OCSP or TLS Certificate messages. On the default .NET main thread on Windows this causes a stack overflow that terminates the whole process, and on threads with larger stacks it causes high CPU use. The CVSS vector rates only the availability impact as high.

Affected

  • bc-csharp by Legion of the Bouncy Castle Inc. before 2.7.0 (CVE record)
  • Vendor wiki also lists 2.6.2 and earlier and the 2.7.0-beta.98 pre-release
  • All CLRs

Fixed in

  • bc-csharp 2.7.0 (adds a default nesting depth limit of 64)

Workaround

  • No setting exists in versions before 2.7.0.
  • Check untrusted input before passing it to Bouncy Castle and reject encodings that nest constructed elements more deeply than the application expects; legitimate structures stay well within 64 levels.
  • Limiting the input size alone is not sufficient.
  • Parsing on a thread with a larger stack avoids process termination but not the CPU cost.

Exploitation

  • CISA SSVC: exploitation none, automatable yes, technical impact partial.
  • Not in the CISA KEV catalogue; EPSS about 0.003 at the time of the source.
  • No public exploitation reports found; public proof of concept not verified.

Our recommendation

  • Inventory .NET applications and deployed binaries that use BouncyCastle.Cryptography below 2.7.0, including transitive dependencies.
  • Upgrade to 2.7.0 or later and retest; prioritise internet-facing services that parse certificates or ASN.1.
  • Until the upgrade, validate the nesting depth of untrusted input and monitor for unexpected process crashes and restarts.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 06:12.

Original description (NVD)

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.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.