CVE-2025-9341: Bouncy Castle Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-jfcv-jv9g-2vx2
CWE-400
Published
Advisory Summary

CVE-2025-9341 is a MODERATE remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves bouncy castle for java has uncontrolled resource consumption vulnerability. Remediation is available by upgrading affected packages to version 2.1.1, 2.73.8.

CVE-2025-9341 at a Glance

CVE Identifier CVE-2025-9341
GHSA Identifier GHSA-jfcv-jv9g-2vx2
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2025-9341

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: 2.1.1
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
    <version>2.1.1</version>
</dependency>
org.bouncycastle:bctls-fips fixed: 2.73.8
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bctls-fips</artifactId>
    <version>2.73.8</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-2025-9341, 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 2.1.1), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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

Uncontrolled Resource Consumption vulnerability in Legion of the Bouncy Castle Inc. Bouncy Castle for Java FIPS bc-fips on All (API modules) allows Excessive Allocation. This vulnerability is associated with program files org/bouncycastle/crypto/fips/AESNativeCBC.Java. This issue affects Bouncy Castle for Java FIPS: from BC-FJA 2.1.0 through 2.1.0.

CVE-2025-9341 Affected Bouncy Castle Versions

2 component(s)
Fixed Versions:
2.1.12.73.8
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bc-fips
Maven
≥ 2.1.0
< 2.1.1
All 1 versions
2.1.0
2.1.1
org.bouncycastle:bctls-fips
Maven
≥ 2.73.7
< 2.73.8
All 1 versions
2.73.7
2.73.8

References

Frequently Asked Questions

What is CVE-2025-9341?
CVE-2025-9341 is a security vulnerability in Bouncy Castle involving Bouncy Castle for Java has Uncontrolled Resource Consumption Vulnerability under CWE-400: Uncontrolled Resource Consumption.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 2.1.1, 2.73.8 across affected packages: org.bouncycastle:bc-fips, org.bouncycastle:bctls-fips.
What version fixes CVE-2025-9341?
Upgrading to 2.1.1, 2.73.8 (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 2.1.1. Upgrade your dependency to 2.1.1 or later.
Is bctls-fips affected?
Yes, org.bouncycastle:bctls-fips is affected in releases prior to 2.73.8. Upgrade your dependency to 2.73.8 or later.
What CWE is associated with CVE-2025-9341?
CVE-2025-9341 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2025-9341?
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-jfcv-jv9g-2vx2",
  "modified" : "2025-08-22T20:30:47Z",
  "published" : "2025-08-22T09:30:41Z",
  "aliases" : [ "CVE-2025-9341" ],
  "summary" : "Bouncy Castle for Java has Uncontrolled Resource Consumption Vulnerability",
  "details" : "Uncontrolled Resource Consumption vulnerability in Legion of the Bouncy Castle Inc. Bouncy Castle for Java FIPS bc-fips on All (API modules) allows Excessive Allocation. This vulnerability is associated with program files org/bouncycastle/crypto/fips/AESNativeCBC.Java.\n\nThis issue affects Bouncy Castle for Java FIPS: from BC-FJA 2.1.0 through 2.1.0.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:P/AU:N/R:U/V:C/RE:M/U:Amber"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bc-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ],
    "versions" : [ "2.1.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bctls-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.73.7"
      }, {
        "fixed" : "2.73.8"
      } ]
    } ],
    "versions" : [ "2.73.7" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-9341"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902025%E2%80%909341"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-22T20:30:47Z",
    "nvd_published_at" : "2025-08-22T09:15:34Z"
  }
}