GHSA-574f-3g2m-x479 CVE-2025-14813
Bouncy Castle for Java GOST 28147 CTR mode reuses keystream after 255 blocks
- 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
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
- github.com/bcgit/bc-java/commit/b42574345414e4b7c8051b16fa1fafe01c29871f
- github.com/bcgit/bc-java/commit/701686cb0184cd9ae103c801b3581fdf95c6d4f3
- access.redhat.com/errata/RHSA-2026:11720
- access.redhat.com/errata/RHSA-2026:60248
- access.redhat.com/errata/RHSA-2026:60249
- access.redhat.com/errata/RHSA-2026:60250
- access.redhat.com/errata/RHSA-2026:60251
- access.redhat.com/errata/RHSA-2026:60252
- access.redhat.com/errata/RHSA-2026:60254
- access.redhat.com/errata/RHSA-2026:60256
- access.redhat.com/errata/RHSA-2026:60259
- access.redhat.com/errata/RHSA-2026:66488
- access.redhat.com/security/cve/CVE-2025-14813
- bugzilla.redhat.com/show_bug.cgi
- github.com/bcgit/bc-java/wiki/CVE%E2%80%902025%E2%80%9014813
- security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-14813.json
- access.redhat.com/errata/RHSA-2026:11721
- access.redhat.com/errata/RHSA-2026:13631
- access.redhat.com/errata/RHSA-2026:14272
- access.redhat.com/errata/RHSA-2026:14276
- access.redhat.com/errata/RHSA-2026:17668
- access.redhat.com/errata/RHSA-2026:18054
- access.redhat.com/errata/RHSA-2026:18055
- access.redhat.com/errata/RHSA-2026:18059
- access.redhat.com/errata/RHSA-2026:21772
- access.redhat.com/errata/RHSA-2026:24977
- access.redhat.com/errata/RHSA-2026:53644
- access.redhat.com/errata/RHSA-2026:53645
- access.redhat.com/errata/RHSA-2026:53646
- access.redhat.com/errata/RHSA-2026:53806
- access.redhat.com/errata/RHSA-2026:60239
- access.redhat.com/errata/RHSA-2026:60246
- access.redhat.com/errata/RHSA-2026:60247
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-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 |
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