CVE-2022-3219 Overview
CVE-2022-3219 is a denial of service vulnerability affecting GnuPG (GNU Privacy Guard), a widely used free implementation of the OpenPGP standard. The vulnerability allows an attacker to cause GnuPG to enter an excessive processing loop by supplying a relatively small, specially crafted input—such as a public key containing thousands of signatures compressed to just a few kilobytes.
Critical Impact
Local attackers with low privileges can cause resource exhaustion and denial of service conditions by providing maliciously crafted compressed public keys to GnuPG, potentially disrupting cryptographic operations and system availability.
Affected Products
- GnuPG (GNU Privacy Guard)
- Systems and applications relying on GnuPG for OpenPGP cryptographic operations
- Package managers and software distribution systems using GnuPG for signature verification
Discovery Timeline
- 2023-02-23 - CVE-2022-3219 published to NVD
- 2025-03-12 - Last updated in NVD database
Technical Details for CVE-2022-3219
Vulnerability Analysis
This vulnerability stems from how GnuPG processes OpenPGP public keys that contain an excessive number of signatures. When a public key is crafted with thousands of attached signatures and then compressed using standard compression algorithms, the resulting file can be reduced to just a few kilobytes while decompressing into a much larger data structure during processing.
When GnuPG attempts to process such a key, it must iterate through and validate each signature, causing the application to "spin" or enter an extended processing loop. This algorithmic complexity attack exploits the asymmetry between the compressed input size and the computational resources required to process the decompressed content.
The vulnerability is classified under CWE-787 (Out-of-Bounds Write), though the primary observable impact is denial of service through resource exhaustion. The local attack vector requires an attacker to provide the malicious key file to a victim's GnuPG installation, which could occur through various means such as importing keys from untrusted keyservers or processing email attachments.
Root Cause
The root cause lies in GnuPG's signature processing routine, which does not implement adequate limits or early termination conditions when handling public keys with an abnormally high number of attached signatures. The compression of these signatures amplifies the attack by allowing an attacker to deliver a small payload that expands into a computationally expensive operation.
Attack Vector
The attack requires local access and involves providing a specially crafted public key file to GnuPG for processing. Attack scenarios include:
- An attacker uploads a malicious public key to a keyserver, which is then retrieved by the victim
- A malicious key is included in an email or document that triggers automatic GnuPG processing
- The crafted key is placed in a location where GnuPG operations are automated, such as package verification systems
The vulnerability mechanism involves creating a public key with thousands of signatures, then compressing the entire structure. When decompressed and processed by GnuPG, the signature validation loop consumes excessive CPU cycles, causing the application to become unresponsive. Detailed technical analysis is available in the GnuPG Development Update D556 and GnuPG Task Update T5993.
Detection Methods for CVE-2022-3219
Indicators of Compromise
- Unusually high CPU usage by gpg or gpg-agent processes over extended periods
- GnuPG operations timing out or becoming unresponsive during key import or verification operations
- Presence of unusually small key files (few KB) that cause extended processing times
- Log entries indicating stalled or prolonged cryptographic operations
Detection Strategies
- Monitor system processes for abnormal CPU consumption by GnuPG-related binaries
- Implement file size vs. processing time ratio analysis for incoming key files
- Use application-level monitoring to detect GnuPG operations exceeding normal duration thresholds
- Deploy behavioral analysis to identify patterns consistent with algorithmic complexity attacks
Monitoring Recommendations
- Configure alerting for GnuPG processes consuming excessive CPU resources for more than expected durations
- Implement logging for all key import operations including source and processing time metrics
- Monitor keyserver communications for unusual patterns or repeated retrieval of the same keys
- Review automated systems that process OpenPGP keys for signs of performance degradation
How to Mitigate CVE-2022-3219
Immediate Actions Required
- Update GnuPG to the latest available version that includes the fix referenced in GnuPG Development Update D556
- Review and restrict sources from which public keys are automatically imported
- Implement resource limits (CPU time, memory) for processes handling untrusted cryptographic material
- Audit systems that automatically process OpenPGP keys from external sources
Patch Information
The GnuPG development team has addressed this vulnerability. Patches and updates are tracked in the GnuPG Task Update T5993. Users should consult their Linux distribution's security advisories, including the Red Hat CVE-2022-3219 Advisory and NetApp Security Advisory NTAP-20230324-0001 for distribution-specific patches.
Workarounds
- Implement timeout limits for GnuPG operations processing keys from untrusted sources
- Use containerization or sandboxing to limit the impact of resource exhaustion attacks
- Configure keyserver settings to use trusted sources only and disable automatic key retrieval where possible
- Apply process resource limits using system tools such as ulimit or cgroups
# Configuration example - Limit GnuPG process resources
# Add to shell profile or wrapper script for gpg operations
# Set CPU time limit (in seconds)
ulimit -t 60
# Set maximum memory limit (in KB)
ulimit -v 1048576
# Example cgroup configuration for systemd service
# Add to /etc/systemd/system/gpg-processing.service.d/limits.conf
# [Service]
# CPUQuota=50%
# MemoryMax=512M
# TimeoutSec=120
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


