# CVE-2024-34447: Bouncy Castle Java Cryptography API vulnerable to DNS poisoning

> Attackers can bypass hostname verification in Bouncy Castle TLS when using HttpsURLConnection, enabling DNS poisoning attacks against Java applications.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 May 2024
- **Updated:** 17 Jun 2025
- **Also known as:** CLEANSTART-2026-WG07848, DEBIAN-CVE-2024-34447, GHSA-4h8f-2wvx-gg5w, MINI-7g5j-9696-vg78, ROOT-APP-MAVEN-CVE-2024-34447, UBUNTU-CVE-2024-34447

## What is CVE-2024-34447?

CVE-2024-34447 is a high-severity vulnerability in n/a, published on 3 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-297 (Improper Validation of Certificate with Host Mismatch)

## Which versions are affected by CVE-2024-34447?

14 open source packages ship an affected version, including org.bouncycastle:bcprov-jdk12, org.bouncycastle:bcprov-jdk14 and org.bouncycastle:bcprov-jdk15on.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.bouncycastle:bcprov-jdk12` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk12` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk14` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk14` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk15on` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk15on` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | From 1.61 | 1.78 |
| `org.bouncycastle:bcprov-lts8on` | Maven | All versions | 2.73.6 |
| `org.bouncycastle:bcprov-lts8on` | Maven | All versions | 2.73.6 |
| `org.bouncycastle:bctls-fips` | Maven | All versions | 1.0.19 |
| `org.bouncycastle:bctls-fips` | Maven | All versions | 1.0.19 |

## How do I fix CVE-2024-34447?

Upgrade org.bouncycastle:bcprov-jdk12 to 1.78 or later.

## Is CVE-2024-34447 being exploited?

There is no known exploitation of CVE-2024-34447 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-34447 and fix it if it is affected.

What it is: CVE-2024-34447 is a high-severity vulnerability in n/a, published on 3 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-34447 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.bouncycastle:bcprov-jdk12 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk12 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk14 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk14 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk15on (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk15on (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk15to18 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk15to18 (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk18on (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-jdk18on (Maven): affected from 1.61; fixed in 1.78
- org.bouncycastle:bcprov-lts8on (Maven): affected all versions; fixed in 2.73.6
- org.bouncycastle:bcprov-lts8on (Maven): affected all versions; fixed in 2.73.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-34447/ (Markdown: https://insights.sbomify.com/CVE-2024-34447/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-34447
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-34447
- OSV: https://osv.dev/vulnerability/CVE-2024-34447

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-34447/
Summaries are generated and may contain mistakes; the official description above is the record.
