CVE-2024-34447: Bouncy Castle Bouncy Castle Java Cryptography API Vulnerability

MODERATE
Advisory Identifier: GHSA-4h8f-2wvx-gg5w
CVSS 5.9
CWE-297
Published
Advisory Summary

CVE-2024-34447 is a MODERATE (CVSS 5.9) bouncy castle java cryptography api vulnerability (CWE-297: Improper Validation of Certificate with Host Mismatch) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves bouncy castle java cryptography api vulnerable to dns poisoning. Remediation is available by upgrading affected packages to version 1.78, 1.0.19, 2.73.6.

CVE-2024-34447 at a Glance

CVE Identifier CVE-2024-34447
GHSA Identifier GHSA-4h8f-2wvx-gg5w
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-297: Improper Validation of Certificate with Host Mismatch
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-34447

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:bcprov-jdk18on fixed: 1.78
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk18on</artifactId>
    <version>1.78</version>
</dependency>
org.bouncycastle:bcprov-jdk15to18 fixed: 1.78
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15to18</artifactId>
    <version>1.78</version>
</dependency>
org.bouncycastle:bcprov-jdk14 fixed: 1.78
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk14</artifactId>
    <version>1.78</version>
</dependency>
org.bouncycastle:bcprov-jdk12 fixed: 1.78
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk12</artifactId>
    <version>1.78</version>
</dependency>
org.bouncycastle:bctls-fips fixed: 1.0.19
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bctls-fips</artifactId>
    <version>1.0.19</version>
</dependency>
org.bouncycastle:bcprov-lts8on fixed: 2.73.6
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-lts8on</artifactId>
    <version>2.73.6</version>
</dependency>
org.bouncycastle:bcprov-jdk15on fixed: 1.78
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.78</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-2024-34447, 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.78), 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-297: Improper Validation of Certificate with Host Mismatch, where the product communicates with a host that provides a certificate, but the product does not properly ensure that the certificate is actually associated with that host. 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

An issue was discovered in the Bouncy Castle Crypto Package For Java before BC TLS Java 1.0.19 (ships with BC Java 1.78, BC Java (LTS) 2.73.6) and before BC FIPS TLS Java 1.0.19. When endpoint identification is enabled in the BCJSSE and an SSL socket is created without an explicit hostname (as happens with HttpsURLConnection), hostname verification could be performed against a DNS-resolved IP address in some situations, opening up a possibility of DNS poisoning.

CVE-2024-34447 Affected Bouncy Castle Versions

7 component(s)
Fixed Versions:
1.781.0.192.73.6
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bcprov-jdk18on
Maven
≥ 1.61
< 1.78
1.78
org.bouncycastle:bcprov-jdk15to18
Maven
≥ 1.61
< 1.78
1.78
org.bouncycastle:bcprov-jdk14
Maven
≥ 1.61
< 1.78
1.78
org.bouncycastle:bcprov-jdk12
Maven
≥ 1.61
< 1.78
1.78
org.bouncycastle:bctls-fips
Maven
< 1.0.19
1.0.19
org.bouncycastle:bcprov-lts8on
Maven
< 2.73.6
2.73.6
org.bouncycastle:bcprov-jdk15on
Maven
≥ 1.61
< 1.78
1.78

References

Frequently Asked Questions

What is CVE-2024-34447?
CVE-2024-34447 is a security vulnerability in Bouncy Castle involving Bouncy Castle Java Cryptography API vulnerable to DNS poisoning under CWE-297: Improper Validation of Certificate with Host Mismatch.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.78, 1.0.19, 2.73.6 across affected packages: org.bouncycastle:bcprov-jdk18on, org.bouncycastle:bcprov-jdk15to18, org.bouncycastle:bcprov-jdk14, org.bouncycastle:bcprov-jdk12, org.bouncycastle:bctls-fips, org.bouncycastle:bcprov-lts8on, org.bouncycastle:bcprov-jdk15on.
What version fixes CVE-2024-34447?
Upgrading to 1.78, 1.0.19, 2.73.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bcprov-jdk18on affected?
Yes, org.bouncycastle:bcprov-jdk18on is affected in releases prior to 1.78. Upgrade your dependency to 1.78 or later.
Is bcprov-jdk15to18 affected?
Yes, org.bouncycastle:bcprov-jdk15to18 is affected in releases prior to 1.78. Upgrade your dependency to 1.78 or later.
What is the CVSS score of CVE-2024-34447?
CVE-2024-34447 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2024-34447?
CVE-2024-34447 is classified under CWE-297: Improper Validation of Certificate with Host Mismatch (The product communicates with a host that provides a certificate, but the product does not properly ensure that the certificate is actually associated with that host.).
How can I check Maven dependencies for CVE-2024-34447?
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-4h8f-2wvx-gg5w",
  "modified" : "2026-04-17T13:22:45Z",
  "published" : "2024-05-03T18:30:37Z",
  "aliases" : [ "CVE-2024-34447" ],
  "summary" : "Bouncy Castle Java Cryptography API vulnerable to DNS poisoning",
  "details" : "An issue was discovered in the Bouncy Castle Crypto Package For Java before BC TLS Java 1.0.19 (ships with BC Java 1.78, BC Java (LTS) 2.73.6) and before BC FIPS TLS Java 1.0.19. When endpoint identification is enabled in the BCJSSE and an SSL socket is created without an explicit hostname (as happens with HttpsURLConnection), hostname verification could be performed against a DNS-resolved IP address in some situations, opening up a possibility of DNS poisoning.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk18on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.61"
      }, {
        "fixed" : "1.78"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15to18"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.61"
      }, {
        "fixed" : "1.78"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk14"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.61"
      }, {
        "fixed" : "1.78"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.61"
      }, {
        "fixed" : "1.78"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bctls-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.19"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-lts8on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.73.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.61"
      }, {
        "fixed" : "1.78"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34447"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/issues/1656"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902024%E2%80%9034447"
  }, {
    "type" : "WEB",
    "url" : "https://www.bouncycastle.org/latest_releases.html"
  }, {
    "type" : "WEB",
    "url" : "http://security.netapp.com/advisory/ntap-20240614-0007"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-297" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-03T20:34:32Z",
    "nvd_published_at" : "2024-05-03T16:15:11Z"
  }
}