CVE-2018-5382: Bouncy Castle Improper Validation Of Integrity Check Vulnerability
MODERATECVE-2018-5382 is a MODERATE (CVSS 4.4) improper validation of integrity check vulnerability (CWE-354: Improper Validation of Integrity Check Value) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves improper validation of integrity check value in bouncy castle. Remediation is available by upgrading affected packages to version 1.50.
CVE-2018-5382 at a Glance
Security Impact
CVSS: 4.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2018-5382
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>bcprov-jdk15on</artifactId>
<version>1.50</version>
</dependency>
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-2018-5382, 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.50), 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-354: Improper Validation of Integrity Check Value, where the product does not validate or incorrectly validates the integrity check values or "checksums" of a message. this may prevent it from detecting if the data has been modified or corrupted in transmission. 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-2018-5382 Affected Bouncy Castle Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.bouncycastle:bcprov-jdk15on
|
Maven |
< 1.50
|
1.50
|
References
Frequently Asked Questions
What is CVE-2018-5382?
Which Bouncy Castle versions are affected?
What version fixes CVE-2018-5382?
Is bcprov-jdk15on affected?
What is the CVSS score of CVE-2018-5382?
What CWE is associated with CVE-2018-5382?
How can I check Maven dependencies for CVE-2018-5382?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8477-3v39-ggpm",
"modified" : "2022-06-28T23:51:50Z",
"published" : "2022-05-13T01:01:01Z",
"aliases" : [ "CVE-2018-5382" ],
"summary" : "Improper Validation of Integrity Check Value in Bouncy Castle",
"details" : "The default BKS keystore use an HMAC that is only 16 bits long, which can allow an attacker to compromise the integrity of a BKS keystore. Bouncy Castle release 1.47 changes the BKS format to a format which uses a 160 bit HMAC instead. This applies to any BKS keystore generated prior to BC 1.47. For situations where people need to create the files for legacy reasons a specific keystore type \"BKS-V1\" was introduced in 1.49. It should be noted that the use of \"BKS-V1\" is discouraged by the library authors and should only be used where it is otherwise safe to do so, as in where the use of a 16 bit checksum for the file integrity check is not going to cause a security issue in itself.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.bouncycastle:bcprov-jdk15on"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.50"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-5382"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2018:2927"
}, {
"type" : "WEB",
"url" : "https://www.bouncycastle.org/releasenotes.html"
}, {
"type" : "WEB",
"url" : "https://www.kb.cert.org/vuls/id/306792"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuoct2020.html"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/103453"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-354" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-28T23:51:50Z",
"nvd_published_at" : "2018-04-16T14:29:00Z"
}
}