# CVE-2024-30171: Bouncy Castle affected by timing side-channel for RSA key exchange ("The Marvin Attack")

> CVE-2024-30171 (GitHub advisory GHSA-v435-xc8x-wvr9) is a medium-severity vulnerability with a CVSS 3.1 base score of 5.9, classed as Observable Discrepancy (CWE-203), in 10 packages, including org.bouncycastle:bctls-fips (Maven) and org.bouncycastle:bcprov-jdk18on (Maven). Fixed versions: org.bouncycastle:bctls-fips 1.0.19; org.bouncycastle:bcprov-jdk18on 1.78; and 7 more packages.

Canonical page: https://cveminer.com/vulnerabilities/CVE-2024-30171

| Field | Value |
| --- | --- |
| CVE | CVE-2024-30171 |
| GHSA | GHSA-v435-xc8x-wvr9 |
| Severity | Medium |
| CVSS 3.1 | 5.9 `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N` (GitHub Advisory Database) |
| CWE | CWE-203 Observable Discrepancy |
| EPSS | 0.9% (higher than 57% of CVEs) |
| CISA KEV | Not listed |
| SSVC | exploitation none, automatable no, technical impact partial |
| Published | 9 May 2024 |
| Modified | 9 Sept 2024 |

## Description

An issue was discovered in Bouncy Castle Java TLS API and JSSE Provider before 1.78. Timing-based leakage may occur in RSA based handshakes because of exception processing.

## Affected packages

| Package | Ecosystem | PURL | Vulnerable versions | Fixed in |
| --- | --- | --- | --- | --- |
| org.bouncycastle:bctls-fips | Maven | `pkg:maven/org.bouncycastle/bctls-fips` | < 1.0.19 | 1.0.19 |
| org.bouncycastle:bcprov-jdk18on | Maven | `pkg:maven/org.bouncycastle/bcprov-jdk18on` | < 1.78 | 1.78 |
| org.bouncycastle:bcprov-jdk15on | Maven | `pkg:maven/org.bouncycastle/bcprov-jdk15on` | < 1.78 | 1.78 |
| org.bouncycastle:bcprov-jdk15to18 | Maven | `pkg:maven/org.bouncycastle/bcprov-jdk15to18` | < 1.78 | 1.78 |
| org.bouncycastle:bcprov-jdk14 | Maven | `pkg:maven/org.bouncycastle/bcprov-jdk14` | < 1.78 | 1.78 |
| org.bouncycastle:bctls-jdk18on | Maven | `pkg:maven/org.bouncycastle/bctls-jdk18on` | < 1.78 | 1.78 |
| org.bouncycastle:bctls-jdk14 | Maven | `pkg:maven/org.bouncycastle/bctls-jdk14` | < 1.78 | 1.78 |
| org.bouncycastle:bctls-jdk15to18 | Maven | `pkg:maven/org.bouncycastle/bctls-jdk15to18` | < 1.78 | 1.78 |
| BouncyCastle | NuGet | `pkg:nuget/BouncyCastle` | < 2.3.1 | no fix |
| BouncyCastle.Cryptography | NuGet | `pkg:nuget/BouncyCastle.Cryptography` | < 2.3.1 | 2.3.1 |

## Fix commits

- Patch: https://github.com/bcgit/bc-csharp/commit/c984b8bfd8544dfc55dba91a02cbbbb9c580c217
- Patch: https://github.com/bcgit/bc-java/commit/d7d5e735abd64bf0f413f54fd9e495fc02400fb0
- Patch: https://github.com/bcgit/bc-java/commit/e0569dcb1dea9d421d84fc4c5c5688fe101afa2d

## Questions

**What is the GHSA ID for CVE-2024-30171?**

GitHub tracks CVE-2024-30171 as GHSA-v435-xc8x-wvr9.

**What is the CVSS score of CVE-2024-30171?**

CVE-2024-30171 has a CVSS 3.1 base score of 5.9 (Medium), vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.

**Which versions are affected by CVE-2024-30171?**

org.bouncycastle:bctls-fips (Maven): < 1.0.19. org.bouncycastle:bcprov-jdk18on (Maven): < 1.78. org.bouncycastle:bcprov-jdk15on (Maven): < 1.78. org.bouncycastle:bcprov-jdk15to18 (Maven): < 1.78. org.bouncycastle:bcprov-jdk14 (Maven): < 1.78. org.bouncycastle:bctls-jdk18on (Maven): < 1.78. 4 more packages are listed on the page.

**How do I fix CVE-2024-30171?**

Upgrade each package to its fixed version: org.bouncycastle:bctls-fips 1.0.19; org.bouncycastle:bcprov-jdk18on 1.78; org.bouncycastle:bcprov-jdk15on 1.78; org.bouncycastle:bcprov-jdk15to18 1.78; and 5 more packages. The fix is in commits c984b8b, d7d5e73 and e0569dc.

**What is the Package URL (PURL) for CVE-2024-30171?**

The affected packages' PURLs are pkg:maven/org.bouncycastle/bctls-fips, pkg:maven/org.bouncycastle/bcprov-jdk18on, pkg:maven/org.bouncycastle/bcprov-jdk15on, pkg:maven/org.bouncycastle/bcprov-jdk15to18, pkg:maven/org.bouncycastle/bcprov-jdk14 and pkg:maven/org.bouncycastle/bctls-jdk18on and more.

**Is CVE-2024-30171 exploited in the wild?**

CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2024-30171. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. CISA's SSVC assessment rates exploitation as "none". EPSS estimates a 0.9% chance of exploitation in the next 30 days, higher than 57% of CVEs.

## References

- https://github.com/bcgit/bc-csharp/commit/c984b8bfd8544dfc55dba91a02cbbbb9c580c217 (fix)
- https://github.com/bcgit/bc-java/commit/d7d5e735abd64bf0f413f54fd9e495fc02400fb0 (fix)
- https://github.com/bcgit/bc-java/commit/e0569dcb1dea9d421d84fc4c5c5688fe101afa2d (fix)
- https://nvd.nist.gov/vuln/detail/CVE-2024-30171 (advisory)
- https://security.netapp.com/advisory/ntap-20240614-0008 (advisory)
- https://github.com/advisories/GHSA-v435-xc8x-wvr9 (advisory)
- https://github.com/bcgit/bc-csharp/wiki/CVE%E2%80%902024%E2%80%9030171
- https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902024%E2%80%9030171
- https://www.bouncycastle.org/latest_releases.html

---

Source: CVEminer (https://cveminer.com/vulnerabilities/CVE-2024-30171), compiled from OSV (GitHub advisory), GitHub Advisory Database, OSV (CVE record), CVE.org, CISA KEV catalog. OSV and GitHub Advisory Database content is licensed CC BY 4.0.
