DEV Community

CVE Reports
CVE Reports

Posted on • Originally published at cvereports.com

GHSA-8H58-W33P-WQ3G: The Matryoshka Crash: Recursive Ruin in rPGP

The Matryoshka Crash: Recursive Ruin in rPGP

Vulnerability ID: GHSA-8H58-W33P-WQ3G
CVSS Score: 7.5
Published: 2026-02-13

A high-severity Denial of Service vulnerability in the rPGP Rust library caused by uncontrolled recursion during OpenPGP packet parsing. Attackers can exhaust the stack and crash applications by submitting maliciously nested signature packets.

TL;DR

rPGP versions < 0.19.0 contain a stack overflow vulnerability. The packet parser used unbounded recursion to handle nested OpenPGP structures. By crafting a message with thousands of nested One-Pass Signature packets, an attacker can trigger a stack overflow, crashing any service relying on the library.


⚠️ Exploit Status: POC

Technical Details

  • CWE ID: CWE-674
  • Vulnerability Type: Stack Exhaustion / Uncontrolled Recursion
  • CVSS: 7.5 (High)
  • Attack Vector: Network / Local File
  • Impact: Denial of Service (DoS)
  • Patch Commit: e82f2c7494ba277d62fd372d69b2c008473bbef8

Affected Systems

  • Rust applications using the pgp crate < 0.19.0
  • OpenPGP email gateways using rPGP
  • Secure software supply chain tools using rPGP for signature verification
  • rPGP: < 0.19.0 (Fixed in: 0.19.0)

Code Analysis

Commit: e82f2c7

Refactor parser to be iterative instead of recursive to prevent stack overflow

fn next(packets: PacketParser) ... { // REMOVED RECURSION }
Enter fullscreen mode Exit fullscreen mode

Exploit Details

  • GitHub: Fuzzer generated crash test case in the repository

Mitigation Strategies

  • Switch from recursive to iterative parsing logic.
  • Implement depth limits for nested structures if recursion is unavoidable.
  • Use heap allocation for tracking nested state instead of the call stack.

Remediation Steps:

  1. Locate the pgp dependency in your Cargo.toml.
  2. Update the version constraint to >= 0.19.0.
  3. Run cargo update to pull the patched version.
  4. Rebuild and deploy your application.

References


Read the full report for GHSA-8H58-W33P-WQ3G on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)