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

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).

Basic information

Type
reviewed
Severity
critical
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Browse source ↗
Published (advisory)
2026-04-17 18:31:50 UTC
Updated
2026-06-30 19:45:24 UTC
GitHub reviewed
2026-06-30 19:45:20 UTC
NVD published
2026-04-15

EPSS Score

Score Percentile
0.31% 22.99%

CVSS Scores

Base score Version Severity Vector
9.3 4.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 Click to expand
Attack vector (AV:L)
Attacker needs local access on the target system.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:N)
No additional preconditions are required beyond normal reachability.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:H)
High confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:H)
High integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:H)
High confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:H)
High integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Vulnerability response effort (supplemental) (RE:M)
Moderate effort (remote update, disable subsystem, simple upgrade with minor service impact).
Provider urgency (supplemental) (U:RED)
Red: provider rates highest urgency.

Identifiers

CWEs

CWE id Name
CWE-323 Reusing a Nonce, Key Pair in Encryption

Credits

  • simon-reisinger-dynatrace (analyst)

Affected packages (24)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
maven org.bouncycastle:bcprov-jdk14 >= 1.59, <= 1.80.1
maven org.bouncycastle:bcprov-jdk15to18 >= 1.59, <= 1.80.1
maven org.bouncycastle:bcprov-jdk18on >= 1.59, <= 1.80.1 1.80.2
maven org.bouncycastle:bcprov-debug-jdk14 >= 1.59, <= 1.80.1
maven org.bouncycastle:bcprov-debug-jdk15to18 >= 1.59, <= 1.80.1
maven org.bouncycastle:bcprov-debug-jdk18on >= 1.59, <= 1.80.1
maven org.bouncycastle:bcprov-ext-jdk14 >= 1.59, <= 1.78.1
maven org.bouncycastle:bcprov-ext-jdk15to18 >= 1.59, <= 1.78.1
maven org.bouncycastle:bcprov-ext-jdk18on >= 1.59, <= 1.78.1
maven org.bouncycastle:bcprov-ext-debug-jdk14 >= 1.59, <= 1.74
maven org.bouncycastle:bcprov-ext-debug-jdk15to18 >= 1.59, <= 1.77
maven org.bouncycastle:bcprov-ext-debug-jdk18on >= 1.59, <= 1.77
maven org.bouncycastle:bcprov-jdk14 = 1.81.0
maven org.bouncycastle:bcprov-jdk15to18 = 1.81.0
maven org.bouncycastle:bcprov-jdk18on = 1.81.0 1.81.1
maven org.bouncycastle:bcprov-debug-jdk14 = 1.81.0
maven org.bouncycastle:bcprov-debug-jdk15to18 = 1.81.0
maven org.bouncycastle:bcprov-debug-jdk18on = 1.81.0
maven org.bouncycastle:bcprov-jdk14 >= 1.82, <= 1.83 1.84
maven org.bouncycastle:bcprov-jdk15to18 >= 1.82, <= 1.83 1.84
maven org.bouncycastle:bcprov-jdk18on >= 1.82, <= 1.83 1.84
maven org.bouncycastle:bcprov-debug-jdk14 >= 1.82, <= 1.83 1.84
maven org.bouncycastle:bcprov-debug-jdk15to18 >= 1.82, <= 1.83 1.84
maven org.bouncycastle:bcprov-debug-jdk18on >= 1.82, <= 1.83 1.84

References

cvelogic Threat Intelligence