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
pgpcrate < 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 }
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:
- Locate the
pgpdependency in yourCargo.toml. - Update the version constraint to
>= 0.19.0. - Run
cargo updateto pull the patched version. - 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)