Quick answers
- Is CVE-2025-8916 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2025-8916 being exploited in the wild.
- How severe is CVE-2025-8916?
- Medium severity, with a CVSS score of 4, published 13 August 2025.
- Which products and versions are affected?
- Legion of the Bouncy Castle Bouncy Castle Java Cryptography APIs 1.44 through 1.78; Legion of the Bouncy Castle Bouncy Castle Java PKI APIs 1.44 through 1.78; Legion of the Bouncy Castle Inc. BCPKIX FIPS 1.0.0 through 1.0.7, 2.0.0 through 2.0.7; Legion of the Bouncy Castle Inc. Bouncy Castle Java 1.44 through 1.78; and 5 more.
- Is there a fix for CVE-2025-8916?
- Yes. org.bouncycastle:bcpkix-fips (Maven): upgrade to 1.0.8 or later; org.bouncycastle:bcpkix-jdk15on (Maven): upgrade to 1.79 or later; org.bouncycastle:bcpkix-jdk15to18 (Maven): upgrade to 1.79 or later; org.bouncycastle:bcpkix-jdk18on (Maven): upgrade to 1.79 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2025-8916 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2025-8916?
- Check whether you run Legion of the Bouncy Castle Bouncy Castle Java Cryptography APIs, Legion of the Bouncy Castle Bouncy Castle Java PKI APIs, Legion of the Bouncy Castle Inc. BCPKIX FIPS 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:bcpkix-fips (Maven): upgrade to 1.0.8 or later
# set org.bouncycastle:bcpkix-fips to 1.0.8 in your pom.xml or build.gradle - org.bouncycastle:bcpkix-jdk15on (Maven): upgrade to 1.79 or later
# set org.bouncycastle:bcpkix-jdk15on to 1.79 in your pom.xml or build.gradle - org.bouncycastle:bcpkix-jdk15to18 (Maven): upgrade to 1.79 or later
# set org.bouncycastle:bcpkix-jdk15to18 to 1.79 in your pom.xml or build.gradle - org.bouncycastle:bcpkix-jdk18on (Maven): upgrade to 1.79 or later
# set org.bouncycastle:bcpkix-jdk18on to 1.79 in your pom.xml or build.gradle
Technical details
The vulnerability is classified as CWE-770 (Allocation of Resources Without Limits or Throttling). The PKIXCertPathReviewer class fails to enforce a size limit on Name Constraints objects within ASN.1 structures. An attacker can exploit this by submitting certificate paths containing maliciously large name constraints or Subject Alternative Name extensions. If the application processes these untrusted certificate paths without prior validation, the library will attempt to allocate excessive memory, resulting in a Denial of Service (DoS). The issue is fixed in Bouncy Castle Java 1.79 and BCPKIX FIPS 1.0.8 and 2.0.8 by implementing caps on the size of these extensions.
Affected products
- Legion of the Bouncy Castle Inc. Bouncy Castle for Java (bcpkix, bcprov) 1.44 through 1.78
- Legion of the Bouncy Castle Inc. BCPKIX FIPS (bcpkix-fips) 1.0.0 through 1.0.7, 2.0.0 through 2.0.7
Identifiers
- CVE-2025-8916
- GHSA-4cx2-fc23-5wg6
Timeline
- 2025-08-13: advisory: Initial disclosure and GitHub Advisory publication
- 2025-08-13: patched: Fixes released in versions 1.79, 1.0.8, and 2.0.8