Skip to content

GHSA-72m5-fvvv-55m6 CVE-2020-26939

Observable Differences in Behavior to Error Inputs in Bouncy Castle

Medium Maven
Severity
5.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.92%
Chance of exploitation in the next 30 days. Higher than 60.45% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-203 Observable Discrepancy
Fix
Available
8 packages have a fixed version

Description

In Legion of the Bouncy Castle BC before 1.55 and BC-FJA before 1.0.2, attackers can obtain sensitive information about a private exponent because of Observable Differences in Behavior to Error Inputs. This occurs in org.bouncycastle.crypto.encodings.OAEPEncoding. Sending invalid ciphertext that decrypts to a short payload in the OAEP Decoder could result in the throwing of an early exception, potentially leaking some information about the private exponent of the RSA private key performing the encryption.

Affected versions

Maven

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:bc-fips Maven → 1.0.2

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bc-fips</artifactId><version>1.0.2</version></dependency>
gradle
implementation("org.bouncycastle:bc-fips:1.0.2")

org.bouncycastle:bcprov-ext-jdk15on Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-ext-jdk15on</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-ext-jdk15on:1.61")

org.bouncycastle:bcprov-ext-jdk16 Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-ext-jdk16</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-ext-jdk16:1.61")

org.bouncycastle:bcprov-jdk14 Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk14</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-jdk14:1.61")

org.bouncycastle:bcprov-jdk15 Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-jdk15:1.61")

org.bouncycastle:bcprov-jdk15on Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-jdk15on:1.61")

org.bouncycastle:bcprov-jdk15to18 Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15to18</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-jdk15to18:1.61")

org.bouncycastle:bcprov-jdk16 Maven → 1.61

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk16</artifactId><version>1.61</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-jdk16:1.61")

Severity breakdown

CVSS 3.1 5.3

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Weakness

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 to prevent it
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
  • Implementation: Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy 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:bc-fips
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:bc-fips
GHSA-4h8f-2wvx-gg5w
Bouncy Castle Java Cryptography API vulnerable to DNS poisoning
High Also affects org.bouncycastle:bcprov-jdk14
Is this in your code?

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