Vulnerabilities in pkg:nuget/BouncyCastle

PACKAGE
Advisory Identifier: GHSA-6xx3-rg99-gc3p
Advisory Summary

CVE-2020-15522 is a MODERATE (CVSS 5.1) timing based private key exposure vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Bouncy Castle libraries in the Maven ecosystem. The issue involves timing based private key exposure in bouncy castle. Remediation is available by upgrading affected packages to version 1.0.2.1, 1.66, 1.8.7.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:nuget/BouncyCastle

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:nuget/BouncyCastle. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6xx3-rg99-gc3p CVE-2020-15522 MODERATE Timing based private key exposure in Bouncy Castle
GHSA-8xfc-gm6g-vgpv CVE-2024-29857 MODERATE Bouncy Castle certificate parsing issues cause high CPU usage during parameter evaluation.
GHSA-m44j-cfrm-g8qc CVE-2024-30172 MODERATE Bouncy Castle crafted signature and public key can be used to trigger an infinite loop
GHSA-v435-xc8x-wvr9 CVE-2024-30171 MODERATE Bouncy Castle affected by timing side-channel for RSA key exchange ("The Marvin Attack")

CVE-2020-15522 at a Glance

CVE Identifier CVE-2020-15522
GHSA Identifier GHSA-6xx3-rg99-gc3p
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Bouncy Castle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.1

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

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

How to Fix CVE-2020-15522

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:bc-fips fixed: 1.0.2.1
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
    <version>1.0.2.1</version>
</dependency>
org.bouncycastle:bcprov-ext-jdk15on fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-ext-jdk15on</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-ext-jdk16 fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-ext-jdk16</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-jdk14 fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk14</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-jdk15 fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-jdk15on fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-jdk15to18 fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15to18</artifactId>
    <version>1.66</version>
</dependency>
org.bouncycastle:bcprov-jdk16 fixed: 1.66
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk16</artifactId>
    <version>1.66</version>
</dependency>
BouncyCastle fixed: 1.8.7
Upgrade BouncyCastle to 1.8.7
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-15522, 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.0.2.1), 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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

Bouncy Castle BC Java before 1.66, BC C# .NET before 1.8.7, BC-FJA before 1.0.2.1, BC before 1.66, BC-FNA before 1.0.1.1 have a timing issue within the EC math library that can expose information about the private key when an attacker is able to observe timing information for the generation of multiple deterministic ECDSA signatures.

CVE-2020-15522 Affected Bouncy Castle Versions

9 component(s)
Fixed Versions:
1.0.2.11.661.8.7
Product / Package Ecosystem Affected Versions Fixed Version
org.bouncycastle:bc-fips
Maven
< 1.0.2.1
1.0.2.1
org.bouncycastle:bcprov-ext-jdk15on
Maven
< 1.66
1.66
org.bouncycastle:bcprov-ext-jdk16
Maven
< 1.66
1.66
org.bouncycastle:bcprov-jdk14
Maven
< 1.66
1.66
org.bouncycastle:bcprov-jdk15
Maven
< 1.66
1.66
org.bouncycastle:bcprov-jdk15on
Maven
< 1.66
1.66
org.bouncycastle:bcprov-jdk15to18
Maven
< 1.66
1.66
org.bouncycastle:bcprov-jdk16
Maven
< 1.66
1.66
BouncyCastle
NuGet
< 1.8.7
1.8.7

References

Frequently Asked Questions

What is CVE-2020-15522?
CVE-2020-15522 is a security vulnerability in Bouncy Castle involving Timing based private key exposure in Bouncy Castle under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Bouncy Castle versions are affected?
Affected versions include releases prior to 1.0.2.1, 1.66, 1.8.7 across affected packages: org.bouncycastle:bc-fips, org.bouncycastle:bcprov-ext-jdk15on, org.bouncycastle:bcprov-ext-jdk16, org.bouncycastle:bcprov-jdk14, org.bouncycastle:bcprov-jdk15, org.bouncycastle:bcprov-jdk15on, org.bouncycastle:bcprov-jdk15to18, org.bouncycastle:bcprov-jdk16, BouncyCastle.
What version fixes CVE-2020-15522?
Upgrading to 1.0.2.1, 1.66, 1.8.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bc-fips affected?
Yes, org.bouncycastle:bc-fips is affected in releases prior to 1.0.2.1. Upgrade your dependency to 1.0.2.1 or later.
Is bcprov-ext-jdk15on affected?
Yes, org.bouncycastle:bcprov-ext-jdk15on is affected in releases prior to 1.66. Upgrade your dependency to 1.66 or later.
What is the CVSS score of CVE-2020-15522?
CVE-2020-15522 has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2020-15522?
CVE-2020-15522 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check Maven dependencies for CVE-2020-15522?
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-6xx3-rg99-gc3p",
  "modified" : "2025-07-17T22:05:07Z",
  "published" : "2021-08-13T15:22:31Z",
  "aliases" : [ "CVE-2020-15522" ],
  "summary" : "Timing based private key exposure in Bouncy Castle",
  "details" : "Bouncy Castle BC Java before 1.66, BC C# .NET before 1.8.7, BC-FJA before 1.0.2.1, BC before 1.66, BC-FNA before 1.0.1.1 have a timing issue within the EC math library that can expose information about the private key when an attacker is able to observe timing information for the generation of multiple deterministic ECDSA signatures.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bc-fips"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-ext-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-ext-jdk16"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk14"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15on"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk15to18"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.bouncycastle:bcprov-jdk16"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.66"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "BouncyCastle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15522"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-csharp/wiki/CVE-2020-15522"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bcgit/bc-java/wiki/CVE-2020-15522"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210622-0007"
  }, {
    "type" : "WEB",
    "url" : "https://www.bouncycastle.org/releasenotes.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203", "CWE-362" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T17:50:36Z",
    "nvd_published_at" : "2021-05-20T12:15:00Z"
  }
}