CVE-2026-13505: Bouncy Castle Zeroisation Of Sensitive Key Material Vulnerability

HIGH
Advisory Identifier: GHSA-98j2-6v39-78w8
CWE-772
Published
Advisory Summary

CVE-2026-13505 is a HIGH zeroisation of sensitive key material vulnerability (CWE-772: Missing Release of Resource after Effective Lifetime) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves zeroisation of sensitive key material on garbage collection relies on finalization.. Remediation is available by upgrading affected packages to version 1.0.2.7, 2.0.2, 2.1.3.

CVE-2026-13505 at a Glance

CVE Identifier CVE-2026-13505
GHSA Identifier GHSA-98j2-6v39-78w8
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-772: Missing Release of Resource after Effective Lifetime
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2026-13505

To remediate this vulnerability, upgrade all affected Bouncy Castle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.bouncycastle:bc-fips fixed: 1.0.2.7
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
    <version>1.0.2.7</version>
</dependency>
org.bouncycastle:bc-fips fixed: 2.0.2
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
    <version>2.0.2</version>
</dependency>
org.bouncycastle:bc-fips fixed: 2.1.3
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
    <version>2.1.3</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.bouncycastle

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-13505, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.bouncycastle

Analyze the terminal output to locate any version of Bouncy Castle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2.7), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.bouncycastle command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-772: Missing Release of Resource after Effective Lifetime, where the product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed. In Bouncy Castle, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In Bouncy Castle for Java FIPS (BC-FJA) before bc-fips 1.0.2.7 (1.0.X series), 2.0.2 (2.0.X series) and 2.1.3 (2.1.X series), sensitive key material held by the AES and DESede engines, the SP 800-90A DRBGs, SymmetricSecretKey and the PBKD and scrypt parameter classes was zeroised on garbage collection by overriding Object.finalize. Finalization runs at an unspecified time and in an unspecified order and is serviced by a single finalizer thread, so where objects carrying a finalizer are allocated faster than that thread retires them the pending-finalization queue grows without bound: disposal falls arbitrarily far behind, which can contribute to an OutOfMemoryError under load, and the key material those objects hold stays resident in the heap for as long as they are queued, defeating the purpose of the zeroisation. The behaviour was not a problem on Java 8 or Java 11; it is later JVMs, on which finalization has been deprecated and progressively de-emphasised, where it becomes one. Disposal of these classes now runs from a java.lang.ref.Cleaner registered in the multi-release jdk1.9 overlay, so on Java 9 and later it no longer depends on the finalizer being scheduled. Bouncy Castle for Java (bcprov) and Bouncy Castle for Java LTS are not affected, as neither implements the finalizer-based zeroisation scheme.

CVE-2026-13505 Affected Bouncy Castle Versions

3 component(s)
Fixed Versions:
1.0.2.72.0.22.1.3
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bc-fips
Maven
< 1.0.2.7
1.0.2.7
org.bouncycastle:bc-fips
Maven
≥ 2.0.0
< 2.0.2
2.0.2
org.bouncycastle:bc-fips
Maven
≥ 2.1.0
< 2.1.3
2.1.3

References

Frequently Asked Questions

What is CVE-2026-13505?
CVE-2026-13505 is a security vulnerability in Bouncy Castle involving Zeroisation of sensitive key material on garbage collection relies on finalization. under CWE-772: Missing Release of Resource after Effective Lifetime.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.0.2.7, 2.0.2, 2.1.3 across affected packages: org.bouncycastle:bc-fips.
What version fixes CVE-2026-13505?
Upgrading to 1.0.2.7, 2.0.2, 2.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bc-fips affected?
Yes, org.bouncycastle:bc-fips is affected in releases prior to 1.0.2.7, 2.0.2, 2.1.3. Upgrade your dependency to 1.0.2.7, 2.0.2, 2.1.3 or later.
What CWE is associated with CVE-2026-13505?
CVE-2026-13505 is classified under CWE-772: Missing Release of Resource after Effective Lifetime (The product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.).
How can I check Maven dependencies for CVE-2026-13505?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.bouncycastle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-98j2-6v39-78w8",
  "modified" : "2026-09-18T17:37:30Z",
  "published" : "2026-08-08T03:31:12Z",
  "aliases" : [ "CVE-2026-13505" ],
  "summary" : "Bouncy Castle: Zeroisation of sensitive key material on garbage collection relies on finalization.",
  "details" : "In Bouncy Castle for Java FIPS (BC-FJA) before bc-fips 1.0.2.7 (1.0.X series), 2.0.2 (2.0.X series) and 2.1.3 (2.1.X series), sensitive key material held by the AES and DESede engines, the SP 800-90A DRBGs, SymmetricSecretKey and the PBKD and scrypt parameter classes was zeroised on garbage collection by overriding Object.finalize. Finalization runs at an unspecified time and in an unspecified order and is serviced by a single finalizer thread, so where objects carrying a finalizer are allocated faster than that thread retires them the pending-finalization queue grows without bound: disposal falls arbitrarily far behind, which can contribute to an OutOfMemoryError under load, and the key material those objects hold stays resident in the heap for as long as they are queued, defeating the purpose of the zeroisation. The behaviour was not a problem on Java 8 or Java 11; it is later JVMs, on which finalization has been deprecated and progressively de-emphasised, where it becomes one. Disposal of these classes now runs from a java.lang.ref.Cleaner registered in the multi-release jdk1.9 overlay, so on Java 9 and later it no longer depends on the finalizer being scheduled. Bouncy Castle for Java (bcprov) and Bouncy Castle for Java LTS are not affected, as neither implements the finalizer-based zeroisation scheme.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/U:Amber"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bc-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.2.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bc-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bc-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-13505"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902026%E2%80%9013505"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-772" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-18T17:37:30Z",
    "nvd_published_at" : "2026-08-08T02:17:16Z"
  }
}