CVE-2020-28052: Bouncy Castle Logic Error Vulnerability

HIGH
Advisory Identifier: GHSA-73xv-w5gp-frxh
CVSS 8.1
CWE-670
Published
Advisory Summary

CVE-2020-28052 is a HIGH (CVSS 8.1) logic error vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves logic error in legion of the bouncy castle bc java. Remediation is available by upgrading affected packages to version 1.67.

CVE-2020-28052 at a Glance

CVE Identifier CVE-2020-28052
GHSA Identifier GHSA-73xv-w5gp-frxh
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-670: Always-Incorrect Control Flow Implementation
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

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:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
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-2020-28052

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-jdk15to18 fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15to18</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-jdk15 fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-jdk15on fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-ext-jdk15on fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-ext-jdk15on</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-jdk14 fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk14</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-jdk16 fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk16</artifactId>
    <version>1.67</version>
</dependency>
org.bouncycastle:bcprov-ext-jdk16 fixed: 1.67
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-ext-jdk16</artifactId>
    <version>1.67</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-2020-28052, 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.67), 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-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. 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

An issue was discovered in Legion of the Bouncy Castle BC Java 1.65 and 1.66. The OpenBSDBCrypt.checkPassword utility method compared incorrect data when checking the password, allowing incorrect passwords to indicate they were matching with previously hashed ones that were different.

CVE-2020-28052 Affected Bouncy Castle Versions

7 component(s)
Fixed Versions:
1.67
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bcprov-jdk15to18
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-jdk15
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-jdk15on
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-ext-jdk15on
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-jdk14
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-jdk16
Maven
≥ 1.65
< 1.67
1.67
org.bouncycastle:bcprov-ext-jdk16
Maven
≥ 1.65
< 1.67
1.67

References

NVD — CVE-2020-28052 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-28052
Security Fix Commit FIX COMMIT
https://github.com/bcgit/bc-java/commit/97578f9b7ed277e6ecb58834e85e3d18385a4219
Bouncy Castle Security Information SECURITY
https://www.synopsys.com/blogs/software-security/cve-2020-28052-bouncy-castle
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2022.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
Bouncy Castle Security Information SECURITY
https://www.oracle.com//security-alerts/cpujul2021.html
Bouncy Castle Release RELEASE
https://www.bouncycastle.org/releasenotes.html
lists.apache.org/thread.html/rfc0db1... WEB
https://lists.apache.org/thread.html/rfc0db1f3c375087e69a239f9284ded72d04fbb55849eadde58fa9dc2@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/rf9abfc... WEB
https://lists.apache.org/thread.html/rf9abfc0223747a56694825c050cc6b66627a293a32ea926b3de22402@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/rdfd290... WEB
https://lists.apache.org/thread.html/rdfd2901b8b697a3f6e2c9c6ecc688fd90d7f881937affb5144d61d6e@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/rddd223... WEB
https://lists.apache.org/thread.html/rddd2237b8636a48d573869006ee809262525efb2b6ffa6eff50d2a2d@%3Cjira.kafka.apache.org%3E
lists.apache.org/thread.html/rdcbad6... WEB
https://lists.apache.org/thread.html/rdcbad6d8ce72c79827ed8c635f9a62dd919bb21c94a0b64cab2efc31@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/rcd37d9... WEB
https://lists.apache.org/thread.html/rcd37d9214b08067a2e8f2b5b4fd123a1f8cb6008698d11ef44028c21@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/rc9e441... WEB
https://lists.apache.org/thread.html/rc9e441c1576bdc4375d32526d5cf457226928e9c87b9f54ded26271c@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/r954d80... WEB
https://lists.apache.org/thread.html/r954d80fd18e9dafef6e813963eb7e08c228151c2b6268ecd63b35d1f@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r8c36ba... WEB
https://lists.apache.org/thread.html/r8c36ba34e80e05eecb1f80071cc834d705616f315b634ec0c7d8f42e@%3Cissues.solr.apache.org%3E
lists.apache.org/thread.html/r77af3a... WEB
https://lists.apache.org/thread.html/r77af3ac7c3bfbd5454546e13faf7aec21d627bdcf36c9ca240436b94@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/r4e1619... WEB
https://lists.apache.org/thread.html/r4e1619cfefcd031fac62064a3858f5c9229eef907bd5d8ef14c594fc@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/r37d332... WEB
https://lists.apache.org/thread.html/r37d332c0bf772f4982d1fdeeb2f88dd71dab6451213e69e43734eadc@%3Ccommits.pulsar.apache.org%3E
lists.apache.org/thread.html/r30a139... WEB
https://lists.apache.org/thread.html/r30a139c165b3da6e0d5536434ab1550534011b1fdfcd2f5d95892c5b@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/r2ddabd... WEB
https://lists.apache.org/thread.html/r2ddabd06d94b60cfb0141e4abb23201c628ab925e30742f61a04d013@%3Cissues.karaf.apache.org%3E
lists.apache.org/thread.html/r25d53a... WEB
https://lists.apache.org/thread.html/r25d53acd06f29244b8a103781b0339c5e7efee9099a4d52f0c230e4a@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r175f5a... WEB
https://lists.apache.org/thread.html/r175f5a25d100dbe2b1bd3459b3ce882a84c3ff91b120ed4ff2d57b53@%3Ccommits.pulsar.apache.org%3E
lists.apache.org/thread.html/r167dbc... WEB
https://lists.apache.org/thread.html/r167dbc42ef7c59802c2ca1ac14735ef9cf687c25208229993d6206fe@%3Cissues.karaf.apache.org%3E
GitHub Advisory / Wiki ADVISORY
https://github.com/bcgit/bc-java/wiki/CVE-2020-28052
Bouncy Castle Source Repository REPOSITORY
https://github.com/bcgit/bc-java

Frequently Asked Questions

What is CVE-2020-28052?
CVE-2020-28052 is a security vulnerability in Bouncy Castle involving Logic error in Legion of the Bouncy Castle BC Java under CWE-670: Always-Incorrect Control Flow Implementation.
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.67 across affected packages: org.bouncycastle:bcprov-jdk15to18, org.bouncycastle:bcprov-jdk15, org.bouncycastle:bcprov-jdk15on, org.bouncycastle:bcprov-ext-jdk15on, org.bouncycastle:bcprov-jdk14, org.bouncycastle:bcprov-jdk16, org.bouncycastle:bcprov-ext-jdk16.
What version fixes CVE-2020-28052?
Upgrading to 1.67 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bcprov-jdk15to18 affected?
Yes, org.bouncycastle:bcprov-jdk15to18 is affected in releases prior to 1.67. Upgrade your dependency to 1.67 or later.
Is bcprov-jdk15 affected?
Yes, org.bouncycastle:bcprov-jdk15 is affected in releases prior to 1.67. Upgrade your dependency to 1.67 or later.
What is the CVSS score of CVE-2020-28052?
CVE-2020-28052 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-28052?
CVE-2020-28052 is classified under CWE-670: Always-Incorrect Control Flow Implementation (The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.).
How can I check Maven dependencies for CVE-2020-28052?
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-73xv-w5gp-frxh",
  "modified" : "2022-02-08T22:01:10Z",
  "published" : "2021-04-30T16:14:15Z",
  "aliases" : [ "CVE-2020-28052" ],
  "summary" : "Logic error in Legion of the Bouncy Castle BC Java",
  "details" : "An issue was discovered in Legion of the Bouncy Castle BC Java 1.65 and 1.66. The OpenBSDBCrypt.checkPassword utility method compared incorrect data when checking the password, allowing incorrect passwords to indicate they were matching with previously hashed ones that were different.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15to18"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-ext-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk14"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk16"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-ext-jdk16"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65"
      }, {
        "fixed" : "1.67"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-28052"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/commit/97578f9b7ed277e6ecb58834e85e3d18385a4219"
  }, {
    "type" : "WEB",
    "url" : "https://www.synopsys.com/blogs/software-security/cve-2020-28052-bouncy-castle"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com//security-alerts/cpujul2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.bouncycastle.org/releasenotes.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rfc0db1f3c375087e69a239f9284ded72d04fbb55849eadde58fa9dc2@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf9abfc0223747a56694825c050cc6b66627a293a32ea926b3de22402@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rdfd2901b8b697a3f6e2c9c6ecc688fd90d7f881937affb5144d61d6e@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rddd2237b8636a48d573869006ee809262525efb2b6ffa6eff50d2a2d@%3Cjira.kafka.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rdcbad6d8ce72c79827ed8c635f9a62dd919bb21c94a0b64cab2efc31@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rcd37d9214b08067a2e8f2b5b4fd123a1f8cb6008698d11ef44028c21@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc9e441c1576bdc4375d32526d5cf457226928e9c87b9f54ded26271c@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r954d80fd18e9dafef6e813963eb7e08c228151c2b6268ecd63b35d1f@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8c36ba34e80e05eecb1f80071cc834d705616f315b634ec0c7d8f42e@%3Cissues.solr.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r77af3ac7c3bfbd5454546e13faf7aec21d627bdcf36c9ca240436b94@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4e1619cfefcd031fac62064a3858f5c9229eef907bd5d8ef14c594fc@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r37d332c0bf772f4982d1fdeeb2f88dd71dab6451213e69e43734eadc@%3Ccommits.pulsar.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r30a139c165b3da6e0d5536434ab1550534011b1fdfcd2f5d95892c5b@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r2ddabd06d94b60cfb0141e4abb23201c628ab925e30742f61a04d013@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r25d53acd06f29244b8a103781b0339c5e7efee9099a4d52f0c230e4a@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r175f5a25d100dbe2b1bd3459b3ce882a84c3ff91b120ed4ff2d57b53@%3Ccommits.pulsar.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r167dbc42ef7c59802c2ca1ac14735ef9cf687c25208229993d6206fe@%3Cissues.karaf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/wiki/CVE-2020-28052"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bcgit/bc-java"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-670" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-19T00:15:55Z",
    "nvd_published_at" : "2020-12-18T01:15:00Z"
  }
}