# CVE-2024-29857: Bouncy Castle certificate parsing issues cause high CPU usage during parameter evaluation.

> Attackers can cause excessive CPU consumption and denial of service by importing EC certificates with crafted F2m parameters in Bouncy Castle libraries.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 May 2024
- **Updated:** 13 Feb 2025
- **Also known as:** CLEANSTART-2026-GK84785, CLEANSTART-2026-YK68946, CLSA-2026-1781052750, DEBIAN-CVE-2024-29857, GHSA-8xfc-gm6g-vgpv, MINI-783x-vwmm-xfm8, MINI-9xmp-p644-88qh, MINI-v62r-q6qv-f9r6, MINI-wv5h-xc2h-xhc5, ROOT-APP-MAVEN-CVE-2024-29857, UBUNTU-CVE-2024-29857, openSUSE-SU-2025:15739-1

## What is CVE-2024-29857?

CVE-2024-29857 is a high-severity denial of service vulnerability in n/a, published on 9 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 ECCurve.java and ECCurve.cs in Bouncy Castle Java (BC Java) before 1.78, BC Java LTS before 2.73.6, BC-FJA before 1.0.2.5, and BC C# .Net before 2.3.1. Importing an EC certificate with crafted F2m parameters can lead to excessive CPU consumption during the evaluation of the curve parameters.

Weakness: CWE-125 (Out-of-bounds Read)

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

20 open source packages ship an affected version, including org.bouncycastle:bc-fips, org.bouncycastle:bcprov-jdk14 and org.bouncycastle:bcprov-jdk15on.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.bouncycastle:bc-fips` | Maven | All versions | 1.0.2.5 |
| `org.bouncycastle:bc-fips` | Maven | All versions | 1.0.2.5 |
| `org.bouncycastle:bcprov-jdk14` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk14` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk15on` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk15on` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk15to18` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | All versions | 1.78 |
| `org.bouncycastle:bcprov-jdk18on` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk14` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk14` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk15to18` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk15to18` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk18on` | Maven | All versions | 1.78 |
| `org.bouncycastle:bctls-jdk18on` | Maven | All versions | 1.78 |
| `BouncyCastle` | NuGet | All versions | None |
| `BouncyCastle` | NuGet | All versions | None |
| `BouncyCastle.Cryptography` | NuGet | All versions | 2.3.1 |
| `BouncyCastle.Cryptography` | NuGet | All versions | 2.3.1 |
| `itextpdf` | openSUSE:Tumbleweed | All versions | 5.5.13.4-1.1 |

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

Upgrade org.bouncycastle:bc-fips to 1.0.2.5 or later.

## Is CVE-2024-29857 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-29857 is a high-severity denial of service vulnerability in n/a, published on 9 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-29857 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.bouncycastle:bc-fips (Maven): affected all versions; fixed in 1.0.2.5
- org.bouncycastle:bc-fips (Maven): affected all versions; fixed in 1.0.2.5
- org.bouncycastle:bcprov-jdk14 (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk14 (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk15on (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk15on (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk15to18 (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk15to18 (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk18on (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bcprov-jdk18on (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bctls-jdk14 (Maven): affected all versions; fixed in 1.78
- org.bouncycastle:bctls-jdk14 (Maven): affected all versions; fixed in 1.78

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-29857/ (Markdown: https://insights.sbomify.com/CVE-2024-29857/index.md)
```

## Sources

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

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