Skip to content

GHSA-574f-3g2m-x479 CVE-2025-14813

Bouncy Castle for Java GOST 28147 CTR mode reuses keystream after 255 blocks

High Maven
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.32%
Chance of exploitation in the next 30 days. Higher than 24.97% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-323 Reusing a Nonce, Key Pair in Encryption
CWE-327 Use of a Broken or Risky Cryptographic Algorithm
Fix
Available
6 packages have a fixed version

Description

The GOST 28147-2015 CTR mode implementation (G3413CTRBlockCipher) in the Legion of the Bouncy Castle BC-JAVA bcprov core module only increments the final byte of the counter, so the counter wraps after 255 blocks and the keystream is reused. Reusing CTR keystream allows an attacker who can observe two ciphertexts produced with the same key/IV to recover the XOR of the plaintexts, breaking confidentiality. Affects BC-JAVA from 1.59 before 1.84 (with backported fixes in 1.80.2 and 1.81.1).

Affected versions

Maven

PackageVulnerableFixed in
org.bouncycastle:bcprov-debug-jdk14
>= 1.59, <= 1.80.1
No fix yet
org.bouncycastle:bcprov-debug-jdk14 1 listed versions No fix yet
org.bouncycastle:bcprov-debug-jdk14
>= 1.82, < 1.84
1.84
org.bouncycastle:bcprov-debug-jdk15on
<= 1.7.0
No fix yet
org.bouncycastle:bcprov-debug-jdk15to18
>= 1.59, <= 1.80.1
No fix yet
org.bouncycastle:bcprov-debug-jdk15to18 1 listed versions No fix yet
org.bouncycastle:bcprov-debug-jdk15to18
>= 1.82, < 1.84
1.84
org.bouncycastle:bcprov-debug-jdk18on
>= 1.59, <= 1.80.1
No fix yet
org.bouncycastle:bcprov-debug-jdk18on 1 listed versions No fix yet
org.bouncycastle:bcprov-debug-jdk18on
>= 1.82, < 1.84
1.84
org.bouncycastle:bcprov-ext-debug-jdk14
>= 1.59, <= 1.74
No fix yet
org.bouncycastle:bcprov-ext-debug-jdk15to18
>= 1.59, <= 1.77
No fix yet
org.bouncycastle:bcprov-ext-debug-jdk18on
>= 1.59, <= 1.77
No fix yet
org.bouncycastle:bcprov-ext-jdk14
>= 1.59, <= 1.78.1
No fix yet
org.bouncycastle:bcprov-ext-jdk15to18
>= 1.59, <= 1.78.1
No fix yet
org.bouncycastle:bcprov-ext-jdk18on
>= 1.59, <= 1.78.1
No fix yet
org.bouncycastle:bcprov-jdk14
>= 1.59, <= 1.80.1
No fix yet
org.bouncycastle:bcprov-jdk14 1 listed versions No fix yet
org.bouncycastle:bcprov-jdk14
>= 1.82, < 1.84
1.84
org.bouncycastle:bcprov-jdk15on
<= 1.7.0
No fix yet
org.bouncycastle:bcprov-jdk15to18
>= 1.59, <= 1.80.1
No fix yet
org.bouncycastle:bcprov-jdk15to18 1 listed versions No fix yet
org.bouncycastle:bcprov-jdk15to18
>= 1.82, < 1.84
1.84
org.bouncycastle:bcprov-jdk18on
>= 1.59, < 1.80.2
1.80.2
org.bouncycastle:bcprov-jdk18on
>= 1.81.0, < 1.81.1
1.81.1
org.bouncycastle:bcprov-jdk18on
>= 1.82, < 1.84
1.84

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-debug-jdk14 Maven → 1.84

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

org.bouncycastle:bcprov-debug-jdk15to18 Maven → 1.84

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

org.bouncycastle:bcprov-debug-jdk18on Maven → 1.84

maven
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-debug-jdk18on</artifactId><version>1.84</version></dependency>
gradle
implementation("org.bouncycastle:bcprov-debug-jdk18on:1.84")

org.bouncycastle:bcprov-jdk14 Maven → 1.84

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

org.bouncycastle:bcprov-jdk15to18 Maven → 1.84

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

org.bouncycastle:bcprov-jdk18on Maven → 1.80.2

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

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N/RE:M/U:Red

Attack vector
Local
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
High
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
High
Integrity (subsequent systems)
High
Availability (subsequent systems)
None

CVSS 3.1 7.5

CVSS:3.1/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-323: Reusing a Nonce, Key Pair in Encryption

Nonces should be used for the present occasion and only once.

How to prevent it
  • Implementation: Refuse to reuse nonce values.
  • Implementation: Use techniques such as requiring incrementing, time based and/or challenge response to assure uniqueness of nonces.

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

Packages

Other links

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-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
GHSA-wjxj-5m7g-mg7q
Bouncy Castle Denial of Service (DoS)
Medium 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