CVE-2025-8916: Bouncy Castle Bouncy Castle For Java Bcpkix, Vulnerability
MODERATECVE-2025-8916 is a MODERATE bouncy castle for java bcpkix, vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves bouncy castle for java bcpkix, bcprov, bcpkix-fips on all (api modules) allows excessive allocation. Remediation is available by upgrading affected packages to version 1.79, 1.0.8, 2.0.8.
CVE-2025-8916 at a Glance
How to Fix CVE-2025-8916
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.
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.79</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15to18</artifactId>
<version>1.79</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.79</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-fips</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-fips</artifactId>
<version>2.0.8</version>
</dependency>
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-8916, 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.79), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. 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
CVE-2025-8916 Affected Bouncy Castle Versions
5 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.bouncycastle:bcpkix-jdk15on
|
Maven |
≥ 1.44
< 1.79
|
1.79
|
|
org.bouncycastle:bcpkix-jdk15to18
|
Maven |
≥ 1.44
< 1.79
|
1.79
|
|
org.bouncycastle:bcpkix-jdk18on
|
Maven |
≥ 1.44
< 1.79
|
1.79
|
|
org.bouncycastle:bcpkix-fips
|
Maven |
≥ 1.0.0
< 1.0.8
|
1.0.8
|
|
org.bouncycastle:bcpkix-fips
|
Maven |
≥ 2.0.0
< 2.0.8
|
2.0.8
|
References
Frequently Asked Questions
What is CVE-2025-8916?
Which Bouncy Castle versions are affected?
What version fixes CVE-2025-8916?
Is bcpkix-jdk15on affected?
Is bcpkix-jdk15to18 affected?
What CWE is associated with CVE-2025-8916?
How can I check Maven dependencies for CVE-2025-8916?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4cx2-fc23-5wg6",
"modified" : "2026-05-13T16:23:20Z",
"published" : "2025-08-13T12:31:30Z",
"aliases" : [ "CVE-2025-8916" ],
"summary" : "Bouncy Castle for Java bcpkix, bcprov, bcpkix-fips on All (API modules) allows Excessive Allocation",
"details" : "Allocation of Resources Without Limits or Throttling vulnerability in Legion of the Bouncy Castle Inc. Bouncy Castle for Java bcpkix, bcprov, bcpkix-fips on All (API modules) allows Excessive Allocation. This vulnerability is associated with program files https://github.Com/bcgit/bc-java/blob/main/pkix/src/main/java/org/bouncycastle/pkix/jcajce/PKIXCertP... https://github.Com/bcgit/bc-java/blob/main/pkix/src/main/java/org/bouncycastle/pkix/jcajce/PKIXCertPathReviewer.java , https://github.Com/bcgit/bc-java/blob/main/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathRevi... https://github.Com/bcgit/bc-java/blob/main/prov/src/main/java/org/bouncycastle/x509/PKIXCertPathReviewer.java .\n\nThis issue affects Bouncy Castle for Java: from BC 1.44 through 1.78, from BCPKIX FIPS 1.0.0 through 1.0.7, from BCPKIX FIPS 2.0.0 through 2.0.7.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/S:P/R:U/RE:M/U:Amber"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcpkix-jdk15on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.44"
}, {
"fixed" : "1.79"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcpkix-jdk15to18"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.44"
}, {
"fixed" : "1.79"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcpkix-jdk18on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.44"
}, {
"fixed" : "1.79"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcpkix-fips"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.0.8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.0.7"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcpkix-fips"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.7"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-8916"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-java/commit/310b30a4fbf36d13f6cc201ffa7771715641e67e"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-java/commit/ff444a479942d88de64004dc82c3ee32a9e9075a"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-032379.html"
}, {
"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%908916"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-13T22:52:42Z",
"nvd_published_at" : "2025-08-13T10:15:27Z"
}
}