CVE-2007-6721: Bouncy Castle Legion Of The Bouncy Castle Vulnerability

HIGH
Advisory Identifier: GHSA-m26p-m559-g5j5
CWE-203
Published
Advisory Summary

CVE-2007-6721 is a HIGH legion of the bouncy castle vulnerability (CWE-203: Observable Discrepancy) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves legion of the bouncy castle java cryptography api bleichenbacher oracle vulnerability. Remediation is available by upgrading affected packages to version 1.38.

CVE-2007-6721 at a Glance

CVE Identifier CVE-2007-6721
GHSA Identifier GHSA-m26p-m559-g5j5
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-203: Observable Discrepancy
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2007-6721

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.

bouncycastle:bcprov-jdk14 fixed: 1.38
<dependency>
    <groupId>bouncycastle</groupId>
    <artifactId>bcprov-jdk14</artifactId>
    <version>1.38</version>
</dependency>
bouncycastle:bcprov-jdk15 fixed: 1.38
<dependency>
    <groupId>bouncycastle</groupId>
    <artifactId>bcprov-jdk15</artifactId>
    <version>1.38</version>
</dependency>
bouncycastle:bcprov-jdk16 fixed: 1.38
<dependency>
    <groupId>bouncycastle</groupId>
    <artifactId>bcprov-jdk16</artifactId>
    <version>1.38</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=bouncycastle

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2007-6721, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=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.38), your application is affected.

Note: The mvn dependency:tree -Dincludes=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

The Legion of the Bouncy Castle Java Cryptography API before release 1.38, as used in Crypto Provider Package before 1.36, has unknown impact and remote attack vectors related to "a Bleichenbacher vulnerability in simple RSA CMS signatures without signed attributes."

CVE-2007-6721 Affected Bouncy Castle Versions

3 component(s)
Fixed Versions:
1.38
Product / Package Ecosystem Affected Versions Fixed Version
bouncycastle:bcprov-jdk14
Maven
< 1.38
1.38
bouncycastle:bcprov-jdk15
Maven
< 1.38
1.38
bouncycastle:bcprov-jdk16
Maven
< 1.38
1.38

References

Frequently Asked Questions

What is CVE-2007-6721?
CVE-2007-6721 is a security vulnerability in Bouncy Castle involving Legion of the Bouncy Castle Java Cryptography API Bleichenbacher Oracle Vulnerability under CWE-203: Observable Discrepancy.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.38 across affected packages: bouncycastle:bcprov-jdk14, bouncycastle:bcprov-jdk15, bouncycastle:bcprov-jdk16.
What version fixes CVE-2007-6721?
Upgrading to 1.38 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bcprov-jdk14 affected?
Yes, bouncycastle:bcprov-jdk14 is affected in releases prior to 1.38. Upgrade your dependency to 1.38 or later.
Is bcprov-jdk15 affected?
Yes, bouncycastle:bcprov-jdk15 is affected in releases prior to 1.38. Upgrade your dependency to 1.38 or later.
What CWE is associated with CVE-2007-6721?
CVE-2007-6721 is classified under 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 can I check Maven dependencies for CVE-2007-6721?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=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-m26p-m559-g5j5",
  "modified" : "2023-09-21T22:46:17Z",
  "published" : "2022-05-01T18:45:52Z",
  "aliases" : [ "CVE-2007-6721" ],
  "summary" : "Legion of the Bouncy Castle Java Cryptography API Bleichenbacher Oracle Vulnerability",
  "details" : "The Legion of the Bouncy Castle Java Cryptography API before release 1.38, as used in Crypto Provider Package before 1.36, has unknown impact and remote attack vectors related to \"a Bleichenbacher vulnerability in simple RSA CMS signatures without signed attributes.\"",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "bouncycastle:bcprov-jdk14"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.38"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "bouncycastle:bcprov-jdk15"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.38"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "bouncycastle:bcprov-jdk16"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.38"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2007-6721"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20071022023551/http://www.bouncycastle.org/csharp"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20080316202318/http://www.bouncycastle.org:80/releasenotes.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.bouncycastle.org/devmailarchive/msg08195.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-21T22:46:17Z",
    "nvd_published_at" : "2009-03-30T01:30:00Z"
  }
}