GHSA-v435-xc8x-wvr9 CVE-2024-30171
Bouncy Castle affected by timing side-channel for RSA key exchange ("The Marvin Attack")
- Severity
- 5.9 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.90%
- Chance of exploitation in the next 30 days. Higher than 59.72% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-203 Observable Discrepancy
- Fix
- Available
- 9 packages have a fixed version
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 versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.bouncycastle:bcprov-jdk14 | < 1.78 |
1.78 |
| org.bouncycastle:bcprov-jdk15on | < 1.78 |
1.78 |
| org.bouncycastle:bcprov-jdk15to18 | < 1.78 |
1.78 |
| org.bouncycastle:bcprov-jdk18on | < 1.78 |
1.78 |
| org.bouncycastle:bctls-fips | < 1.0.19 |
1.0.19 |
| org.bouncycastle:bctls-jdk14 | < 1.78 |
1.78 |
| org.bouncycastle:bctls-jdk15to18 | < 1.78 |
1.78 |
| org.bouncycastle:bctls-jdk18on | < 1.78 |
1.78 |
NuGet
| Package | Vulnerable | Fixed in |
|---|---|---|
| BouncyCastle | all versions |
No fix yet |
| BouncyCastle.Cryptography | < 2.3.1 |
2.3.1 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.bouncycastle:bcprov-jdk14 Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk14</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk14:1.78")
org.bouncycastle:bcprov-jdk15on Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk15on:1.78")
org.bouncycastle:bcprov-jdk15to18 Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15to18</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk15to18:1.78")
org.bouncycastle:bcprov-jdk18on Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk18on</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk18on:1.78")
org.bouncycastle:bctls-fips Maven → 1.0.19
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bctls-fips</artifactId><version>1.0.19</version></dependency>- gradle
implementation("org.bouncycastle:bctls-fips:1.0.19")
org.bouncycastle:bctls-jdk14 Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bctls-jdk14</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bctls-jdk14:1.78")
org.bouncycastle:bctls-jdk15to18 Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bctls-jdk15to18</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bctls-jdk15to18:1.78")
org.bouncycastle:bctls-jdk18on Maven → 1.78
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bctls-jdk18on</artifactId><version>1.78</version></dependency>- gradle
implementation("org.bouncycastle:bctls-jdk18on:1.78")
BouncyCastle.Cryptography NuGet → 2.3.1
- dotnet
dotnet add package BouncyCastle.Cryptography --version 2.3.1
Severity breakdown
CVSS 3.1 5.9
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-203: Observable Discrepancy
The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- Implementation: Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
References
Advisories
Other links
- github.com/bcgit/bc-csharp/commit/c984b8bfd8544dfc55dba91a02cbbbb9c580c217
- github.com/bcgit/bc-java/commit/d7d5e735abd64bf0f413f54fd9e495fc02400fb0
- github.com/bcgit/bc-java/commit/e0569dcb1dea9d421d84fc4c5c5688fe101afa2d
- github.com/bcgit/bc-csharp/wiki/CVE%E2%80%902024%E2%80%9030171
- github.com/bcgit/bc-java/wiki/CVE%E2%80%902024%E2%80%9030171
- security.netapp.com/advisory/ntap-20240614-0008
- bouncycastle.org/latest_releases.html
- security.netapp.com/advisory/ntap-20240614-0008
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-p93r-85wp-75v3 Bouncy Castle Has Covert Timing Channel Vulnerability | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-c3fc-8qff-9hwx Bouncy Castle has an LDAP injection | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-574f-3g2m-x479 Bouncy Castle for Java GOST 28147 CTR mode reuses keystream after 255 blocks | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-67mf-3cr5-8w23 Bouncy Castle for Java on All (API modules) allows Excessive Allocation | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-m44j-cfrm-g8qc Bouncy Castle crafted signature and public key can be used to trigger an infinite loop | High | Also affects BouncyCastle |
| GHSA-8xfc-gm6g-vgpv Bouncy Castle certificate parsing issues cause high CPU usage during parameter evaluation. | High | Also affects BouncyCastle |
| GHSA-4h8f-2wvx-gg5w Bouncy Castle Java Cryptography API vulnerable to DNS poisoning | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-wjxj-5m7g-mg7q Bouncy Castle Denial of Service (DoS) | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor