CVE-2024-30171: Bouncy Castle Bouncy Castle Affected By Timing Vulnerability
MODERATECVE-2024-30171 is a MODERATE (CVSS 5.9) bouncy castle affected by timing vulnerability (CWE-203: Observable Discrepancy) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves bouncy castle affected by timing side-channel for rsa key exchange ("the marvin attack"). Remediation is available by upgrading affected packages to version 1.0.19, 1.78, 2.3.1.
CVE-2024-30171 at a Glance
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:H/I:N/A:N).
How to Fix CVE-2024-30171
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.
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bctls-fips</artifactId>
<version>1.0.19</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk14</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bctls-jdk18on</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bctls-jdk14</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bctls-jdk15to18</artifactId>
<version>1.78</version>
</dependency>
Upgrade BouncyCastle to Latest secure release
Upgrade BouncyCastle.Cryptography to 2.3.1
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-30171, 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.0.19), 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-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. 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
CVE-2024-30171 Affected Bouncy Castle Versions
10 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.bouncycastle:bctls-fips
|
Maven |
< 1.0.19
|
1.0.19
|
|
org.bouncycastle:bcprov-jdk18on
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bcprov-jdk15on
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bcprov-jdk15to18
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bcprov-jdk14
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bctls-jdk18on
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bctls-jdk14
|
Maven |
< 1.78
|
1.78
|
|
org.bouncycastle:bctls-jdk15to18
|
Maven |
< 1.78
|
1.78
|
|
BouncyCastle
|
NuGet |
|
|
|
BouncyCastle.Cryptography
|
NuGet |
< 2.3.1
|
2.3.1
|
References
Frequently Asked Questions
What is CVE-2024-30171?
Which Bouncy Castle versions are affected?
What version fixes CVE-2024-30171?
Is bctls-fips affected?
Is bcprov-jdk18on affected?
What is the CVSS score of CVE-2024-30171?
What CWE is associated with CVE-2024-30171?
How can I check Maven dependencies for CVE-2024-30171?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v435-xc8x-wvr9",
"modified" : "2024-09-09T21:27:50Z",
"published" : "2024-05-14T15:32:54Z",
"aliases" : [ "CVE-2024-30171" ],
"summary" : "Bouncy Castle affected by timing side-channel for RSA key exchange (\"The Marvin Attack\")",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"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-jdk18on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcprov-jdk15on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcprov-jdk15to18"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcprov-jdk14"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bctls-jdk18on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bctls-jdk14"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bctls-jdk15to18"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.78"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "BouncyCastle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 2.3.1"
}
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "BouncyCastle.Cryptography"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-30171"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-csharp/commit/c984b8bfd8544dfc55dba91a02cbbbb9c580c217"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-java/commit/d7d5e735abd64bf0f413f54fd9e495fc02400fb0"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-java/commit/e0569dcb1dea9d421d84fc4c5c5688fe101afa2d"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-csharp/wiki/CVE%E2%80%902024%E2%80%9030171"
}, {
"type" : "WEB",
"url" : "https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902024%E2%80%9030171"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240614-0008"
}, {
"type" : "WEB",
"url" : "https://www.bouncycastle.org/latest_releases.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-203" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-14T20:22:03Z",
"nvd_published_at" : "2024-05-14T15:21:52Z"
}
}