GHSA-xqj7-j8j5-f2xr CVE-2018-1000180
Bouncy Castle has a flaw in the Low-level interface to RSA key pair generator
- Severity
- 7.5 / 10
- High · CVSS 3.0
- Exploit chance (EPSS)
- 3.42%
- Chance of exploitation in the next 30 days. Higher than 88.90% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-327 Use of a Broken or Risky Cryptographic Algorithm
- Fix
- Available
- 3 packages have a fixed version
Description
Bouncy Castle BC 1.54 - 1.59, BC-FJA 1.0.0, BC-FJA 1.0.1 and earlier have a flaw in the Low-level interface to RSA key pair generator, specifically RSA Key Pairs generated in low-level API with added certainty may have less M-R tests than expected. This appears to be fixed in versions BC 1.60 beta 4 and later, BC-FJA 1.0.2 and later.
Affected versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.bouncycastle:bcprov-jdk14 | < 1.60 |
1.60 |
| org.bouncycastle:bcprov-jdk15 | < 1.60 |
1.60 |
| org.bouncycastle:bcprov-jdk15on | < 1.60 |
1.60 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.bouncycastle:bcprov-jdk14 Maven → 1.60
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk14</artifactId><version>1.60</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk14:1.60")
org.bouncycastle:bcprov-jdk15 Maven → 1.60
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15</artifactId><version>1.60</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk15:1.60")
org.bouncycastle:bcprov-jdk15on Maven → 1.60
- maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.60</version></dependency>- gradle
implementation("org.bouncycastle:bcprov-jdk15on:1.60")
Severity breakdown
CVSS 3.0 7.5
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-327: Use of a Broken or Risky Cryptographic Algorithm
The product uses a broken or risky cryptographic algorithm or protocol.
How to prevent it
- Architecture and Design: When there is a need to store or transmit sensitive data, use strong, up-to-date cryptographic algorithms to encrypt that data. Select a well-vetted algorithm that is currently considered to be strong by experts in the field, and use well-tested implementations. As with all cryptographic mechanisms, the source code should be available for analysis. For example, US government systems require FIPS 140-2 certification [REF-1192]. Do not develop custom or private cryptographic algorithms. They will likely be exposed to attacks that are well-understood by cryptographers. Reverse engineering techniques are mature. If the algorithm can be compromised if attackers find out how it works, then it is especially weak. Periodically ensure that the cryptography has not become obsolete. Some older algorithms, once thought to require a billion years of computing time, can now be broken in days or hours. This includes MD4, MD5, SHA1, DES, and other algorithms that were once regarded as strong. [REF-267]
- Architecture and Design: Ensure that the design allows one cryptographic algorithm to be replaced with another in the next generation or version. Where possible, use wrappers to make the interfaces uniform. This will make it easier to upgrade to stronger algorithms. With hardware, design the product at the Intellectual Property (IP) level so that one cryptographic algorithm can be replaced with another in the next generation of the hardware product.
- Architecture and Design: Carefully manage and protect cryptographic keys (see CWE-320). If the keys can be guessed or stolen, then the strength of the cryptography itself is irrelevant.
- Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Industry-standard implementations will save development time and may be more likely to avoid errors that can occur during implementation of cryptographic algorithms. Consider the ESAPI Encryption feature.
- Implementation, Architecture and Design: When using industry-approved techniques, use them correctly. Don't cut corners by skipping resource-intensive steps (CWE-325). These steps are often essential for preventing common attacks.
References
Advisories
Other links
- github.com/bcgit/bc-java/commit/22467b6e8fe19717ecdf201c0cf91bacf04a55ad
- github.com/bcgit/bc-java/commit/73780ac522b7795fc165630aba8d5f5729acc839
- oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
- oracle.com/technetwork/security-advisory/cpujan2019-5072801.html
- oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html
- oracle.com/security-alerts/cpuoct2020.html
- oracle.com/security-alerts/cpuapr2020.html
- oracle.com/security-alerts/cpuApr2021.html
- debian.org/security/2018/dsa-4233
- bountysource.com/issues/58293083-rsa-key-generation-computation-of-iterations-for-mr-…
- security.netapp.com/advisory/ntap-20190204-0003
- lists.apache.org/thread.html/708d94141126eac03011144a971a6411fcac16d9c248d1d535a39451…
- github.com/bcgit/bc-java/wiki/CVE-2018-1000180
- access.redhat.com/errata/RHSA-2019:0877
- access.redhat.com/errata/RHSA-2018:2669
- access.redhat.com/errata/RHSA-2018:2643
- access.redhat.com/errata/RHSA-2018:2428
- access.redhat.com/errata/RHSA-2018:2425
- access.redhat.com/errata/RHSA-2018:2424
- access.redhat.com/errata/RHSA-2018:2423
- securityfocus.com/bid/106567
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-p93r-85wp-75v3 Bouncy Castle Has Covert Timing Channel Vulnerability | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-c3fc-8qff-9hwx Bouncy Castle has an LDAP injection | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-574f-3g2m-x479 Bouncy Castle for Java GOST 28147 CTR mode reuses keystream after 255 blocks | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-67mf-3cr5-8w23 Bouncy Castle for Java on All (API modules) allows Excessive Allocation | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-m44j-cfrm-g8qc Bouncy Castle crafted signature and public key can be used to trigger an infinite loop | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-v435-xc8x-wvr9 Bouncy Castle affected by timing side-channel for RSA key exchange ("The Marvin Attack") | Medium | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-8xfc-gm6g-vgpv Bouncy Castle certificate parsing issues cause high CPU usage during parameter evaluation. | High | Also affects org.bouncycastle:bcprov-jdk14 |
| GHSA-4h8f-2wvx-gg5w Bouncy Castle Java Cryptography API vulnerable to DNS poisoning | High | Also affects org.bouncycastle:bcprov-jdk14 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor