GHSA-cvx8-9ff6-54xq

Suggest an improvement
Source
https://github.com/advisories/GHSA-cvx8-9ff6-54xq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cvx8-9ff6-54xq/GHSA-cvx8-9ff6-54xq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cvx8-9ff6-54xq
Aliases
Published
2026-11-19T00:53:49Z
Modified
2026-11-19T01:30:03Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
PGPainless: Unbounded Compressed Packet Descent in inline-detach and MessageInspector leads to Denial of Service (DoS)
Details

Summary

An architectural security boundary bypass in inline-detach and MessageInspector allows remote, unauthenticated attackers to force unbounded recursive decompression routines. By supplying a specially crafted OpenPGP message containing deeply nested compressed packet structures, an attacker can completely bypass the library's built-in DoS protections (MAX_LAYER_DEPTH = 16), leading to resource exhaustion, thread blocking, and potential Out-of-Memory (OOM) application crashes.

Details

The pg-painless core processing pipeline implements a defensive threshold constraint to prevent decompression bomb sequences (Zip Bombs) and arbitrary resource consumption:

Enforcement Location: pgpainless-main/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageMetadata.kt

Threshold Constant: MAX_LAYER_DEPTH = 16

However, a code architecture review revealed two specific packet-walking implementations that unpack and step through PGPCompressedData packets manually, entirely failing to track or increment a layer depth index counter against the static compliance limits:

In InlineDetachImpl.kt (Line ~78-93): The logic loops over data packets via compressedData.dataStream. Because it processes the incoming data block-by-block without leveraging or passing constraints down to the guarded OpenPgpMessageInputStream tracking mechanism, it accepts infinite nesting.

In MessageInspector.kt (Line ~95): The inspector utility descends recursively down nested compressed packet layouts to ascertain inner content classification markers (e.g., determining encryption states) without referencing or respecting maximum layer depth boundaries.

PoC

The vulnerability can be verified by constructing an inline-signed binary message wrapped recursively inside multiple layers of compression packets:

Generate a standard, valid OpenPGP public/private keypair.

Sign a plaintext document sample utilizing binary inline-signing configurations (.noArmor()).

Programmatically loop 64 times over the output payload. In each iteration, encapsulate the previous binary output into a new PGPCompressedDataGenerator context configured with CompressionAlgorithmTags.ZIP.

Pass the final 64-layer nested byte array stream directly to the SOP interface via sop.inlineDetach().message(nestedBytes).toByteArrayAndResult().

Observed Result: The library completely parses the highly nested structures, returning a successful outcome without raising any execution constraints. The code fails to throw the expected SOPGPException.BadData, proving that the 16-layer boundary constraint was completely bypassed during the streaming packet loop.

Impact

Who is impacted: Any downstream application, gateway, or mail client (such as FlowCrypt or any framework integrating the library's SOP wrapper interface/MessageInspector modules) that handles untrusted, incoming external user files or signed attachment streams. An attacker can use this behavior to systematically freeze application threads, exhaust target heap allocation metrics, and disrupt backend infrastructure services.

Database specific
{
    "cwe_ids":  [
        "CWE-400"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-11-19T00:53:49Z",
    "nvd_published_at":  "2026-11-18T21:18:02Z",
    "severity":  "HIGH"
}
References

Affected packages

Maven / org.pgpainless:pgpainless-core

Package

Name
org.pgpainless:pgpainless-core
View open source insights on deps.dev
Purl
pkg:maven/org.pgpainless/pgpainless-core

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.7.8

Affected versions

0.*
0.0.1-alpha1
0.0.1-alpha2
0.0.1-alpha3
0.0.1-alpha4
0.0.1-alpha5
0.0.1-alpha6
0.0.1-alpha7
0.0.1-alpha8
0.0.1-alpha9
0.0.1-alpha10
0.0.1-alpha11
0.0.1-alpha12
0.1.0
0.2.0-alpha1
0.2.0-alpha2
0.2.0-alpha3
0.2.0-alpha4
0.2.0-alpha5
0.2.0-alpha6
0.2.0-alpha7
0.2.0-alpha8
0.2.0-alpha9
0.2.0-alpha10
0.2.0-alpha11
0.2.0-alpha12
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.2.5
0.2.6
0.2.7
0.2.8
0.2.9
0.2.10
0.2.11
0.2.12
0.2.13
0.2.14
0.2.15
0.2.16
0.2.17
0.2.18
0.2.19
1.*
1.0.0-rc1
1.0.0-rc2
1.0.0-rc3
1.0.0-rc4
1.0.0-rc5
1.0.0-rc6
1.0.0-rc7
1.0.0-rc8
1.0.0-rc9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.1.0
1.1.1-alpha1
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.2.0
1.2.1
1.2.2
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.3.7
1.3.8
1.3.9
1.3.10
1.3.11
1.3.12
1.3.13
1.3.14
1.3.15
1.3.16
1.3.17
1.3.18
1.4.0-rc1
1.4.0-rc2
1.4.0
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.4.6
1.5.0
1.5.1
1.5.2-rc1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.5.7
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.7.0
1.7.1
1.7.2
1.7.3
1.7.4
1.7.5
1.7.6
1.7.7

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cvx8-9ff6-54xq/GHSA-cvx8-9ff6-54xq.json"

Maven / org.pgpainless:pgpainless-core

Package

Name
org.pgpainless:pgpainless-core
View open source insights on deps.dev
Purl
pkg:maven/org.pgpainless/pgpainless-core

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.0.0
Fixed
2.0.4

Affected versions

2.*
2.0.0
2.0.1
2.0.2
2.0.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cvx8-9ff6-54xq/GHSA-cvx8-9ff6-54xq.json"