CVE-2015-7940: Bouncy Castle Bcprov-jdk14 And Org.bouncycastle:bcprov-jdk15 Vulnerability

MODERATE
Advisory Identifier: GHSA-4mv7-cq75-3qjm
CWE-200
Published
Advisory Summary

CVE-2015-7940 is a MODERATE bcprov-jdk14 and org.bouncycastle:bcprov-jdk15 vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves bcprov-jdk14 and org.bouncycastle:bcprov-jdk15. Remediation is available by upgrading affected packages to version 1.51.

CVE-2015-7940 at a Glance

CVE Identifier CVE-2015-7940
GHSA Identifier GHSA-4mv7-cq75-3qjm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2015-7940

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-jdk15 fixed: 1.51
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15</artifactId>
    <version>1.51</version>
</dependency>
org.bouncycastle:bcprov-jdk14 fixed: 1.51
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk14</artifactId>
    <version>1.51</version>
</dependency>
org.bouncycastle:bcprov-jdk15on fixed: 1.51
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.51</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-2015-7940, 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.51), 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. 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

The Bouncy Castle Java library before 1.51 does not validate a point is withing the elliptic curve, which makes it easier for remote attackers to obtain private keys via a series of crafted elliptic curve Diffie Hellman (ECDH) key exchanges, aka an "invalid curve attack."

CVE-2015-7940 Affected Bouncy Castle Versions

3 component(s)
Fixed Versions:
1.51
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bcprov-jdk15
Maven
< 1.51
1.51
org.bouncycastle:bcprov-jdk14
Maven
< 1.51
1.51
org.bouncycastle:bcprov-jdk15on
Maven
< 1.51
1.51

References

NVD — CVE-2015-7940 NVD
https://nvd.nist.gov/vuln/detail/CVE-2015-7940
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-4mv7-cq75-3qjm
usn.ubuntu.com/3727-1 WEB
https://usn.ubuntu.com/3727-1
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2020.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-January/174915.html
Bouncy Castle Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2015-11/msg00012.html
rhn.redhat.com/errata/rhsa-2016-20... WEB
http://rhn.redhat.com/errata/RHSA-2016-2035.html
rhn.redhat.com/errata/rhsa-2016-20... WEB
http://rhn.redhat.com/errata/RHSA-2016-2036.html
Bouncy Castle Security Information SECURITY
http://web-in-security.blogspot.ca/2015/09/practical-invalid-curve-attacks.html
Bouncy Castle Security Information SECURITY
http://www.debian.org/security/2015/dsa-3417
Bouncy Castle Security Information SECURITY
http://www.openwall.com/lists/oss-security/2015/10/22/7
Bouncy Castle Security Information SECURITY
http://www.openwall.com/lists/oss-security/2015/10/22/9
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpujan2018-3236628.html
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html
Bouncy Castle Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html
Bouncy Castle Security Information SECURITY
http://www.securityfocus.com/bid/79091
Bouncy Castle Security Information SECURITY
http://www.securitytracker.com/id/1037036
Bouncy Castle Security Information SECURITY
http://www.securitytracker.com/id/1037046
Bouncy Castle Security Information SECURITY
http://www.securitytracker.com/id/1037053

Frequently Asked Questions

What is CVE-2015-7940?
CVE-2015-7940 is a security vulnerability in Bouncy Castle involving bcprov-jdk14 and org.bouncycastle:bcprov-jdk15 under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.51 across affected packages: org.bouncycastle:bcprov-jdk15, org.bouncycastle:bcprov-jdk14, org.bouncycastle:bcprov-jdk15on.
What version fixes CVE-2015-7940?
Upgrading to 1.51 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bcprov-jdk15 affected?
Yes, org.bouncycastle:bcprov-jdk15 is affected in releases prior to 1.51. Upgrade your dependency to 1.51 or later.
Is bcprov-jdk14 affected?
Yes, org.bouncycastle:bcprov-jdk14 is affected in releases prior to 1.51. Upgrade your dependency to 1.51 or later.
What CWE is associated with CVE-2015-7940?
CVE-2015-7940 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Maven dependencies for CVE-2015-7940?
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-4mv7-cq75-3qjm",
  "modified" : "2025-09-12T19:30:13Z",
  "published" : "2018-10-17T16:27:50Z",
  "aliases" : [ "CVE-2015-7940" ],
  "summary" : "Moderate severity vulnerability that affects org.bouncycastle:bcprov-jdk14 and org.bouncycastle:bcprov-jdk15",
  "details" : "The Bouncy Castle Java library before 1.51 does not validate a point is withing the elliptic curve, which makes it easier for remote attackers to obtain private keys via a series of crafted elliptic curve Diffie Hellman (ECDH) key exchanges, aka an \"invalid curve attack.\"",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.51"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk14"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.51"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.51"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-7940"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-4mv7-cq75-3qjm"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/3727-1"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-January/174915.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2015-11/msg00012.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2016-2035.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2016-2036.html"
  }, {
    "type" : "WEB",
    "url" : "http://web-in-security.blogspot.ca/2015/09/practical-invalid-curve-attacks.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2015/dsa-3417"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2015/10/22/7"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2015/10/22/9"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpujan2018-3236628.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/79091"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1037036"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1037046"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1037053"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:58:37Z",
    "nvd_published_at" : "2015-11-09T16:59:09Z"
  }
}