Description
In Bouncy Castle for Java LTS before 2.73.13, the one-shot native packet ciphers for AES-CBC, CCM, CFB, CTR, GCM and GCM-SIV released the caller's key, IV and additional authenticated data arrays with JNI's ReleaseByteArrayElements in mode 0, which commits the native copy back into the Java array. Those arrays are read-only to the native code, and on a JVM that returns a copy rather than a pin the copy still holds the input bytes as they were read. The output buffer is taken through a separate critical region and committed first, so where an application passed the same Java array as both an input and the destination - encrypting in place over KeyParameter.getKey(), for example - the later mode-0 release of the key wrote the unchanged key bytes over the ciphertext that had just been produced. The call still returned the correct output length, so an application encrypting in place over its own key array was handed the raw AES key where it expected ciphertext, with nothing in the API to indicate it, and would transmit or store the key in place of the message. The read-only input arrays are now released with JNI_ABORT, freeing the native copy without copying it back, and mode 0 is reserved for arrays the native code wrote. The pure-Java packet ciphers and the streaming native modes are not affected. Bouncy Castle for Java (bcprov) is not affected, as it ships no native implementations.
Published: 2026-10-03
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: Data Exposure
Action: Patch immediately
AI Analysis

Impact

Bouncy Castle for Java LTS before 2.73.13 contains native AES packet ciphers that incorrectly release key, IV, and additional authenticated data arrays back into Java memory using JNI's ReleaseByteArrayElements in mode 0. This commits the native copy into the Java array, and when the caller passes the same array for input and output—common when encrypting in place over a key array—the released key bytes overwrite the ciphertext that had just been produced. This vulnerability is a CWE-200 information exposure flaw and consequently the caller receives the raw AES key instead of ciphertext, exposing cryptographic keys or causing unintended transmission of keys in place of secret data.

Affected Systems

Legion of the Bouncy Castle Inc. products featuring the bc-LTS-JAVA module, specifically versions prior to 2.73.13.

Risk and Exploitability

The CVSS score of 8.2 indicates high severity, and the vulnerability is not listed in CISA's KEV catalog. The exploit path relies on developers using native packet ciphers with overlapping input and output arrays; it does not provide remote code execution or privilege escalation. The vulnerability is straightforward to exploit for an application that encrypts in place over its own key array, leading to significant confidentiality risk for applications using this library.

Generated by OpenCVE AI on October 3, 2026 at 10:50 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Legion of the Bouncy Castle Java LTS package to version 2.73.13 or newer.
  • When encrypting with native packet ciphers, avoid reusing the same byte array for both input and output; always use separate buffers.
  • If possible, use pure‑Java packet ciphers or streaming native modes, which are not affected by this issue.

Generated by OpenCVE AI on October 3, 2026 at 10:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 05 Oct 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sun, 04 Oct 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Legion Of The Bouncy Castle Inc.
Legion Of The Bouncy Castle Inc. bc-lts-java
Vendors & Products Legion Of The Bouncy Castle Inc.
Legion Of The Bouncy Castle Inc. bc-lts-java

Sat, 03 Oct 2026 08:45:00 +0000

Type Values Removed Values Added
Description In Bouncy Castle for Java LTS before 2.73.13, the one-shot native packet ciphers for AES-CBC, CCM, CFB, CTR, GCM and GCM-SIV released the caller's key, IV and additional authenticated data arrays with JNI's ReleaseByteArrayElements in mode 0, which commits the native copy back into the Java array. Those arrays are read-only to the native code, and on a JVM that returns a copy rather than a pin the copy still holds the input bytes as they were read. The output buffer is taken through a separate critical region and committed first, so where an application passed the same Java array as both an input and the destination - encrypting in place over KeyParameter.getKey(), for example - the later mode-0 release of the key wrote the unchanged key bytes over the ciphertext that had just been produced. The call still returned the correct output length, so an application encrypting in place over its own key array was handed the raw AES key where it expected ciphertext, with nothing in the API to indicate it, and would transmit or store the key in place of the message. The read-only input arrays are now released with JNI_ABORT, freeing the native copy without copying it back, and mode 0 is reserved for arrays the native code wrote. The pure-Java packet ciphers and the streaming native modes are not affected. Bouncy Castle for Java (bcprov) is not affected, as it ships no native implementations.
Title Native AES packet cipher returns the raw AES key on an alias
Weaknesses CWE-200
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/U:Amber'}


Subscriptions

Legion Of The Bouncy Castle Inc. Bc-lts-java
cve-icon MITRE

Status: PUBLISHED

Assigner: bcorg

Published:

Updated: 2026-10-05T16:05:53.087Z

Reserved: 2026-08-08T00:06:06.982Z

Link: CVE-2026-71883

cve-icon Vulnrichment

Updated: 2026-10-05T16:05:48.088Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-03T09:17:04.570

Modified: 2026-10-06T14:49:40.823

Link: CVE-2026-71883

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-04T20:30:18Z

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor