Bouncy Castle for Java: Missing truncation error in OpenPGP message processing
Summary
Bouncy Castle for Java accepts a truncated OpenPGP encrypted message without reporting an error. With SEIPDv1 (MDC) messages, the integrity check is skipped entirely and altered plaintext is released to the application. With SEIPDv2 and v5 AEAD messages, trailing packets such as signatures can be silently dropped, so a signed and encrypted message can be read as unsigned. The attacker must be able to cut or modify a message in transit or in storage; the vendor describes this as a missing error, not a forgery.
Affected
- BC-JAVA before 1.86 (affected from 1.74; SEIPDv1 route from 1.81)
- BC-LTS-JAVA (Bouncy Castle for Java LTS) before 2.73.13 (AEAD route only)
- BC-FJA (Bouncy Castle FIPS) before bcpg-fips 1.0.14 (1.0.X series), 2.0.14.1 (2.0.X series) and 2.1.14 (2.1.X series), AEAD route only
- Low-level API (direct PGPEncryptedData.verify() calls) is not affected
Fixed in
- BC-JAVA 1.86
- BC-LTS-JAVA 2.73.13
- BC-FJA bcpg-fips 1.0.14, 2.0.14.1 and 2.1.14
- Debian and SUSE distribution versions: check the vendor's distribution tracker, as fixed revisions could not be confirmed
Workaround
Unknown.
Exploitation
- No reports of exploitation in the wild found in the sources checked.
- No public proof-of-concept found in the sources checked.
- CISA SSVC: exploitation none, automatable no, technical impact partial.
- EPSS 0.00157.
Our recommendation
- Inventory Java applications and find bundled bcpg jars, for example bcpg-jdk18on-1.80.jar.
- Upgrade to BC-JAVA 1.86, BC-LTS-JAVA 2.73.13 or the fixed BC-FJA version.
- Prioritise applications that decrypt or verify OpenPGP data from external parties, especially where a valid signature is a trust decision.
- Until patched, do not rely on the absence of signatures or on the absence of errors alone as proof of integrity in such applications.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- Vendor advisory CVE-2026-85515 github.com
- Fix commit ab7a235 github.com
- Bouncy Castle Java 1.86 release www.bouncycastle.org
- Fix announcement discussion 2449 github.com
- OSV Debian record osv.dev
- SUSE CVE record via Vulners vulners.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 17:04.
Original description (NVD)
In Bouncy Castle for Java before 1.86, a truncated OpenPGP encrypted message was accepted with no error reported, and on the SEIPD version 1 path with no integrity check performed at all. RFC 9580 sec. 13.7 permits an implementation to release the cleartext of the fully authenticated chunks when streaming but requires it to indicate a clear error as soon as the truncation is detected, and to report suspect integrity when it discovers malleable ciphertext. The truncation was detected and then discarded: when a message is truncated but the length field of the enclosing packet is left unchanged, BCPGInputStream.PartialInputStream raises an EOFException for the missing ciphertext, and BCPGInputStream.nextPacketTag() reports an EOFException as a clean end of message, so the packet stream above it stopped as though no packets remained. On the AEAD path (SEIPD version 2 and the version 5 AEAD packet), when the literal data packet ended on an AEAD chunk boundary and the consumer read in increments smaller than one chunk, the look-ahead for the packet after the literal triggered the truncated chunk read, so BcAEADUtil and JceAEADUtil never reached the trailing message tag of sec. 5.13.2 that authenticates the total plaintext length; the caller received the plaintext of the fully authenticated chunks, every packet following the literal was silently dropped, and no exception was raised, so a signed and encrypted message read back as a well-formed unsigned one. Every byte released on that path remained individually authenticated, making this a missing truncation error rather than a forgery, and it is a residual of CVE-2026-12817, which closed the same outcome for an attacker who corrects the outer packet length. On the SEIPD version 1 path the consequence was more serious: IntegrityProtectedInputStream verifies the modification detection code from close(), and reached close() only by closing itself when a read of it returned -1, which a truncated message never produces, so PGPEncryptedData.verify() never ran and the recipient was handed CFB-decrypted plaintext on which no integrity check of any kind had been performed. Measured on a message truncated into that shape, 136 distinct single-byte modifications of the ciphertext produced accepted, altered plaintext with no exception raised. Reachability is a property of the message rather than of attacker-supplied input: the AEAD shape held for 3 of 131 consecutive payload lengths measured, and the SEIPD version 1 shape for one payload length in sixteen, at a truncation offset that did not move with the payload length. The low-level API is unaffected, a caller that invokes PGPEncryptedData.verify() directly getting the check regardless, as are consumers reading in increments of a whole AEAD chunk or more. The AEAD decryption streams now re-throw such an EOFException as a plain IOException, which nextPacketTag() does not launder; OpenPGPMessageInputStream.close() now closes its layer's integrity-protected stream itself rather than relying on that stream having seen the end of its data; and IntegrityProtectedInputStream.close() was made idempotent, as java.io.Closeable requires, which that depends on, since the stream is genuinely closed twice on the ordinary path and PGPEncryptedData.verify() consumes the digest state behind it and cannot be run a second time. This issue also affects Bouncy Castle for Java LTS before 2.73.13, on the AEAD route only, as that edition does not ship the high-level OpenPGP API the SEIPDv1 route runs through. It also affects Bouncy Castle for Java FIPS (BC-FJA) before bcpg-fips 1.0.14 (1.0.X series), 2.0.14.1 (2.0.X series) and 2.1.14 (2.1.X series), on the AEAD route only, as those editions do not ship the high-level OpenPGP API.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
