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… (CVE-2026-71883)
A vulnerability in Bouncy Castle for Java LTS before version 2.73.13 affects the one-shot native packet ciphers for AES modes including CBC, CCM, CFB, CTR, GCM, and GCM-SIV. The issue arises from improper handling of Java arrays in JNI calls, where input arrays are released in a way that copies key material back into the Java array, potentially overwriting ciphertext with the original key. This can cause applications encrypting in place over their key arrays to inadvertently expose raw AES keys instead of ciphertext. The pure-Java packet ciphers and streaming native modes are not affected. Bouncy Castle for Java (bcprov) is not affected as it does not include native implementations.
AI Analysis
Technical Summary
In Bouncy Castle for Java LTS versions prior to 2.73.13, the native one-shot packet ciphers for AES-CBC, CCM, CFB, CTR, GCM, and GCM-SIV use JNI's ReleaseByteArrayElements with mode 0 on input arrays that are read-only to native code. On JVMs that return a copy rather than pinning the array, this mode commits the native copy back into the Java array. When an application encrypts in place using the same Java array for input and output (e.g., encrypting over the key array), the mode-0 release writes the original key bytes over the ciphertext just produced. Consequently, the application receives the raw AES key instead of ciphertext without any API indication, risking key exposure through transmission or storage. The fix in version 2.73.13 changes the release mode for read-only input arrays to JNI_ABORT, preventing the native copy from being copied back. The pure-Java packet ciphers and streaming native modes are unaffected, and the bcprov package is not vulnerable as it lacks native code.
Potential Impact
Applications using vulnerable versions of Bouncy Castle for Java LTS that perform in-place encryption over their key arrays risk exposing raw AES keys instead of ciphertext. This can lead to unintended disclosure of cryptographic keys, compromising the confidentiality of encrypted data. The vulnerability does not affect pure-Java implementations or streaming native modes, nor does it affect the bcprov package. No known exploits are reported in the wild.
Mitigation Recommendations
Upgrade to Bouncy Castle for Java LTS version 2.73.13 or later, where the issue is fixed by changing the JNI release mode for input arrays to JNI_ABORT, preventing key material from being copied back into Java arrays. Applications should avoid encrypting in place over key arrays as a best practice. Since this is a native code issue, the pure-Java implementations remain unaffected. No other mitigation is indicated by the vendor advisory.
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… (CVE-2026-71883)
Description
A vulnerability in Bouncy Castle for Java LTS before version 2.73.13 affects the one-shot native packet ciphers for AES modes including CBC, CCM, CFB, CTR, GCM, and GCM-SIV. The issue arises from improper handling of Java arrays in JNI calls, where input arrays are released in a way that copies key material back into the Java array, potentially overwriting ciphertext with the original key. This can cause applications encrypting in place over their key arrays to inadvertently expose raw AES keys instead of ciphertext. The pure-Java packet ciphers and streaming native modes are not affected. Bouncy Castle for Java (bcprov) is not affected as it does not include native implementations.
CVSS v4.0
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
In Bouncy Castle for Java LTS versions prior to 2.73.13, the native one-shot packet ciphers for AES-CBC, CCM, CFB, CTR, GCM, and GCM-SIV use JNI's ReleaseByteArrayElements with mode 0 on input arrays that are read-only to native code. On JVMs that return a copy rather than pinning the array, this mode commits the native copy back into the Java array. When an application encrypts in place using the same Java array for input and output (e.g., encrypting over the key array), the mode-0 release writes the original key bytes over the ciphertext just produced. Consequently, the application receives the raw AES key instead of ciphertext without any API indication, risking key exposure through transmission or storage. The fix in version 2.73.13 changes the release mode for read-only input arrays to JNI_ABORT, preventing the native copy from being copied back. The pure-Java packet ciphers and streaming native modes are unaffected, and the bcprov package is not vulnerable as it lacks native code.
Potential Impact
Applications using vulnerable versions of Bouncy Castle for Java LTS that perform in-place encryption over their key arrays risk exposing raw AES keys instead of ciphertext. This can lead to unintended disclosure of cryptographic keys, compromising the confidentiality of encrypted data. The vulnerability does not affect pure-Java implementations or streaming native modes, nor does it affect the bcprov package. No known exploits are reported in the wild.
Mitigation Recommendations
Upgrade to Bouncy Castle for Java LTS version 2.73.13 or later, where the issue is fixed by changing the JNI release mode for input arrays to JNI_ABORT, preventing key material from being copied back into Java arrays. Applications should avoid encrypting in place over key arrays as a best practice. Since this is a native code issue, the pure-Java implementations remain unaffected. No other mitigation is indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-f5wg-4mfp-h458
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-71883"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ac1397da43b0b3b89d66c87
Added to database: 10/03/2026, 17:21:01 UTC
Last enriched: 10/03/2026, 17:30:25 UTC
Last updated: 10/04/2026, 04:45:56 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.