Skip to main content
Vulnerability Database/CVE-2026-71883

CVE-2026-71883: Bouncy Castle Java Information Disclosure

CVE-2026-71883 is an information disclosure flaw in Bouncy Castle for Java LTS affecting AES packet ciphers that can expose encryption keys when encrypting in place. This post covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-71883 Overview

CVE-2026-71883 affects Bouncy Castle for Java LTS versions before 2.73.13. The one-shot native packet ciphers for AES-CBC, CCM, CFB, CTR, GCM, and GCM-SIV mishandle JNI array release semantics. When an application encrypts in place over its own key array, the library overwrites the ciphertext with the raw AES key bytes. The call returns the correct output length, so applications receive the symmetric key where they expect ciphertext. The flaw is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.

Critical Impact

Applications encrypting in place over KeyParameter.getKey() may transmit or store the raw AES key instead of ciphertext, exposing secret keys to any downstream recipient or storage system.

Affected Products

  • Bouncy Castle for Java LTS versions prior to 2.73.13
  • One-shot native packet ciphers for AES-CBC, CCM, CFB, CTR, GCM, and GCM-SIV
  • Applications using in-place encryption over caller-supplied key arrays

Discovery Timeline

  • 2026-10-03 - CVE-2026-71883 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-71883

Vulnerability Analysis

The vulnerability stems from incorrect use of the Java Native Interface (JNI) ReleaseByteArrayElements function. The native packet ciphers release the caller's key, initialization vector (IV), and additional authenticated data (AAD) arrays using mode 0. Mode 0 commits the native copy back into the Java array. These arrays are read-only to the native code and should never be committed back.

On a JVM that returns a copy rather than a pin, the copy still holds the input bytes as they were originally read. The output buffer is taken through a separate critical region and committed first. When an application passes the same Java array as both input and destination, the subsequent mode-0 release of the key array writes the unchanged key bytes over the ciphertext that was just produced.

The cipher call still returns the correct output length. Nothing in the API signals the overwrite. An application encrypting in place over its own key array receives the raw AES key where ciphertext should reside, then transmits or stores the key in place of the message.

Root Cause

The root cause is misuse of JNI release modes for read-only input buffers. Read-only inputs should be released with JNI_ABORT to free the native copy without copying it back. The native cipher implementations instead used mode 0, treating input arrays as if they were output arrays the native code had written to.

Attack Vector

Exploitation does not require an active attacker on the wire. Any application pattern that reuses a KeyParameter.getKey() buffer as the in-place destination for native one-shot encryption will emit the key instead of ciphertext. A network-adjacent recipient, log aggregator, or persistent store that receives the output will observe the raw symmetric key. The pure-Java packet ciphers, the streaming native modes, and bcprov (which ships no native implementations) are not affected. Technical details are documented in the Bouncy Castle CVE-2026-71883 Wiki.

Detection Methods for CVE-2026-71883

Indicators of Compromise

  • Ciphertext fields in logs, message queues, or storage containing byte sequences matching known AES key material (16, 24, or 32 bytes repeating at offset 0 of outputs)
  • Decryption failures on recipients where the sender used Bouncy Castle native one-shot packet ciphers
  • Application telemetry showing output buffers that match the input key register after encryption calls

Detection Strategies

  • Audit application code for calls that pass KeyParameter.getKey() or any shared key byte array as the destination buffer for native packet cipher operations
  • Compare encrypted output against the original key array in test harnesses to confirm whether the deployed Bouncy Castle version exhibits the overwrite behavior
  • Inventory dependency manifests (pom.xml, build.gradle) for Bouncy Castle for Java LTS artifacts below 2.73.13

Monitoring Recommendations

  • Monitor outbound traffic and object storage for payloads whose first bytes match registered AES key fingerprints
  • Alert on dependency scanner findings that flag bc-lts-java artifacts prior to 2.73.13
  • Track decryption-failure rates on peers to surface silent key-for-ciphertext substitution

How to Mitigate CVE-2026-71883

Immediate Actions Required

  • Upgrade Bouncy Castle for Java LTS to version 2.73.13 or later across all services
  • Rotate any AES keys that may have been transmitted or persisted by vulnerable call sites
  • Review and refactor code paths that reuse a key array as the in-place encryption destination

Patch Information

Bouncy Castle for Java LTS 2.73.13 releases the read-only input arrays with JNI_ABORT, freeing the native copy without committing it back. Mode 0 is now reserved for arrays the native code actually wrote. Refer to the Bouncy Castle CVE-2026-71883 Wiki for release notes and upgrade guidance.

Workarounds

  • Switch to the pure-Java packet ciphers or the streaming native modes, which are not affected
  • Use separate input and output byte arrays rather than encrypting in place over the key buffer
  • Migrate to bcprov, which ships no native implementations and is not affected
bash
# Maven dependency upgrade example
# Update bc-lts-java to the fixed release
mvn versions:use-dep-version \
  -Dincludes=org.bouncycastle:bc-lts-jdk18on \
  -DdepVersion=2.73.13 \
  -DforceVersion=true

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.