CVE-2018-1000613: Bouncy Castle Deserialization Of Untrusted Data Vulnerability

CRITICAL
Advisory Identifier: GHSA-4446-656p-f54g
CVSS 9.8
CWE-470 CWE-502
Published
Advisory Summary

CVE-2018-1000613 is a CRITICAL (CVSS 9.8) deserialization of untrusted data vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves deserialization of untrusted data in bouncy castle. Remediation is available by upgrading affected packages to version 1.60.

CVE-2018-1000613 at a Glance

CVE Identifier CVE-2018-1000613
GHSA Identifier GHSA-4446-656p-f54g
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2018-1000613

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.

org.bouncycastle:bcprov-jdk15on fixed: 1.60
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.60</version>
</dependency>
Verify Direct and Transitive Dependencies

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-1000613, 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.60), 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-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. 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

Legion of the Bouncy Castle Java Cryptography APIs starting in version 1.57 and prior to version 1.60 contains a CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in XMSS/XMSS^MT private key deserialization that can result in Deserializing an XMSS/XMSS^MT private key can result in the execution of unexpected code. This attack appear to be exploitable via A handcrafted private key can include references to unexpected classes which will be picked up from the class path for the executing application. This vulnerability appears to have been fixed in 1.60 and later.

CVE-2018-1000613 Affected Bouncy Castle Versions

1 component(s)
Fixed Versions:
1.60
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bcprov-jdk15on
Maven
≥ 1.57
< 1.60
1.60

References

NVD — CVE-2018-1000613 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-1000613
Security Fix Commit FIX COMMIT
https://github.com/bcgit/bc-java/commit/4092ede58da51af9a21e4825fbad0d9a3ef5a223#diff-2c06e2edef41db889ee14899e12bd574
Security Fix Commit FIX COMMIT
https://github.com/bcgit/bc-java/commit/cc9f91c41be67e88fca4e38f4872418448950fd9
Security Fix Commit FIX COMMIT
https://github.com/bcgit/bc-java/commit/cd98322b171b15b3f88c5ec871175147893c31e6#diff-148a6c098af0199192d6aede960f45dc
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-4446-656p-f54g
Bouncy Castle Source Repository REPOSITORY
https://github.com/bcgit/bc-java
lists.apache.org/thread.html/rf1bbc0... WEB
https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2%40%3Cissues.geode.apache.org%3E
lists.apache.org/thread.html/rf1bbc0... WEB
https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2@%3Cissues.geode.apache.org%3E
Bouncy Castle Security Information SECURITY
https://security.netapp.com/advisory/ntap-20190204-0003
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2020.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2020.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
Bouncy Castle Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00011.html

Frequently Asked Questions

What is CVE-2018-1000613?
CVE-2018-1000613 is a security vulnerability in Bouncy Castle involving Deserialization of Untrusted Data in Bouncy castle under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.60 across affected packages: org.bouncycastle:bcprov-jdk15on.
What version fixes CVE-2018-1000613?
Upgrading to 1.60 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bcprov-jdk15on affected?
Yes, org.bouncycastle:bcprov-jdk15on is affected in releases prior to 1.60. Upgrade your dependency to 1.60 or later.
What is the CVSS score of CVE-2018-1000613?
CVE-2018-1000613 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-1000613?
CVE-2018-1000613 is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.).
How can I check Maven dependencies for CVE-2018-1000613?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.bouncycastle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4446-656p-f54g",
  "modified" : "2025-05-12T21:40:33Z",
  "published" : "2018-10-17T16:23:12Z",
  "aliases" : [ "CVE-2018-1000613" ],
  "summary" : "Deserialization of Untrusted Data in Bouncy castle",
  "details" : "Legion of the Bouncy Castle Java Cryptography APIs starting in version 1.57 and prior to version 1.60 contains a CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in XMSS/XMSS^MT private key deserialization that can result in Deserializing an XMSS/XMSS^MT private key can result in the execution of unexpected code. This attack appear to be exploitable via A handcrafted private key can include references to unexpected classes which will be picked up from the class path for the executing application. \n\nThis vulnerability appears to have been fixed in 1.60 and later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.57"
      }, {
        "fixed" : "1.60"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1000613"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/commit/4092ede58da51af9a21e4825fbad0d9a3ef5a223#diff-2c06e2edef41db889ee14899e12bd574"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/commit/cc9f91c41be67e88fca4e38f4872418448950fd9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/commit/cd98322b171b15b3f88c5ec871175147893c31e6#diff-148a6c098af0199192d6aede960f45dc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-4446-656p-f54g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2%40%3Cissues.geode.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2@%3Cissues.geode.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20190204-0003"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00011.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-470", "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:57:10Z",
    "nvd_published_at" : "2018-07-09T20:29:00Z"
  }
}