CVE-2026-13506: Bouncy Castle ASN.1 sequence nesting-depth guard bypass

CVE-2026-13506 · Severity: high · CVSS 7.5 · Published 2026-08-03

Bouncy Castle is a widely-used cryptographic library for Java applications. A vulnerability in its ASN.1 sequence parsing allows attackers to bypass depth-checking protections designed to prevent denial-of-service attacks through deeply nested data structures. An attacker can send malformed ASN.1 data over the network to crash or hang services that depend on Bouncy Castle for cryptographic operations.

Technologies: org.bouncycastle:bc-fips (Maven), org.bouncycastle:bcprov-jdk15to18 (Maven), org.bouncycastle:bcprov-jdk18on (Maven), org.bouncycastle:bcprov-lts8on (Maven). Vendors: Bouncy Castle, Maven.

Quick answers

Is CVE-2026-13506 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-13506 being exploited in the wild.
How severe is CVE-2026-13506?
High severity, with a CVSS score of 7.5, published 3 August 2026.
Which products and versions are affected?
Bouncy Castle before 1.85; Bouncy Castle FIPS before 1.0.2.7 (1.0.X), 2.0.2 (2.0.X), 2.1.3 (2.1.X); Bouncy Castle LTS before 2.73.12; org.bouncycastle:bc-fips (Maven) ECOSYSTEM:introduced=0,fixed=1.0.2.7; and 3 more.
Is there a fix for CVE-2026-13506?
Yes. org.bouncycastle:bc-fips (Maven): upgrade to 1.0.2.7 or later; org.bouncycastle:bcprov-jdk15to18 (Maven): upgrade to 1.85 or later; org.bouncycastle:bcprov-jdk18on (Maven): upgrade to 1.85 or later; org.bouncycastle:bcprov-lts8on (Maven): upgrade to 2.73.12 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-13506 attacked?
It is attacked over the network.
Am I affected by CVE-2026-13506?
Check whether you run Bouncy Castle, Bouncy Castle FIPS, Bouncy Castle LTS or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • org.bouncycastle:bc-fips (Maven): upgrade to 1.0.2.7 or later
    # set org.bouncycastle:bc-fips to 1.0.2.7 in your pom.xml or build.gradle
  • org.bouncycastle:bcprov-jdk15to18 (Maven): upgrade to 1.85 or later
    # set org.bouncycastle:bcprov-jdk15to18 to 1.85 in your pom.xml or build.gradle
  • org.bouncycastle:bcprov-jdk18on (Maven): upgrade to 1.85 or later
    # set org.bouncycastle:bcprov-jdk18on to 1.85 in your pom.xml or build.gradle
  • org.bouncycastle:bcprov-lts8on (Maven): upgrade to 2.73.12 or later
    # set org.bouncycastle:bcprov-lts8on to 2.73.12 in your pom.xml or build.gradle

Technical details

The vulnerability is an uncontrolled recursion issue (CWE-674) in Bouncy Castle's lazy ASN.1 sequence parsing logic. When processing ASN.1 sequences, the library maintains a nesting-depth guard to prevent stack exhaustion attacks; however, the lazy parsing mechanism can reset this guard, allowing an attacker to exceed safe nesting limits. The vulnerability is remotely exploitable without authentication, affecting multiple Bouncy Castle distributions: standard (before 1.85), LTS (before 2.73.12), and FIPS-certified variants (before 1.0.2.7, 2.0.2, or 2.1.3 depending on series). Successful exploitation results in denial of service through application hang or crash.

Affected products

  • Bouncy Castle Bouncy Castle before 1.85
  • Bouncy Castle Bouncy Castle LTS before 2.73.12
  • Bouncy Castle Bouncy Castle FIPS before 1.0.2.7 (1.0.X), 2.0.2 (2.0.X), 2.1.3 (2.1.X)

Identifiers

  • CVE-2026-13506
  • GHSA-qp49-qgx5-5m26

Timeline

  • 2026-08-03: disclosed
  • 2026-09-18: advisory: GitHub Advisory Database review completed

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.