CVE-2026-71883: Native AES packet cipher returns the raw AES key on an alias

Published Oct 3, 2026
·
Updated

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 JNIABORT, 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.

Affected Software

1 affected component
Bouncy Castle Bouncy Castle for Java LTS<2.73.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Bouncy Castle for Java LTS to a version that resolves this vulnerability.

    Fixed in 2.73.13

Event History

Oct 3, 2026
CVE Published
via MITRE·08:38 AM
Data Sourced
via MITRE·08:38 AM
DescriptionWeakness

Frequently Asked Questions

1

Which applications are exposed to key disclosure?

Exposure requires use of a one-shot native AES packet cipher in an affected Bouncy Castle for Java LTS release, with the same Java array supplied as both a read-only input and the output destination. An example is encrypting in place over the array returned by KeyParameter.getKey(). The overwrite behavior occurs on JVMs that return a copy for JNI byte-array access rather than pinning the array.

2

What must happen for an attacker to obtain the AES key?

The application must subsequently transmit, store, or otherwise expose the output buffer after the aliasing call. In the affected case, that buffer can contain the raw AES key instead of the expected ciphertext, despite the call reporting the correct output length.

3

What can be done before upgrading?

Do not use the same Java array for the key, IV, or additional authenticated data and the destination buffer. Allocate and use a separate output array for encryption results.

4

How can this issue be identified in existing code or output?

Review calls to the affected native one-shot AES-CBC, CCM, CFB, CTR, GCM, or GCM-SIV packet ciphers for array aliasing between a read-only input and the output destination. The API does not signal the problem: the call returns the expected output length, so output inspection is needed to determine whether key bytes replaced ciphertext.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203