CVE-2020-25125
📋 TL;DR
GnuPG 2.2.21-2.2.22 has a buffer overflow vulnerability when processing OpenPGP keys with AEAD preferences. An attacker can cause a crash or potentially execute arbitrary code by tricking a victim into importing a malicious key. Users of GnuPG 2.2.x and Gpg4win 3.1.12 are affected.
💻 Affected Systems
- GnuPG
- Gpg4win
📦 What is this software?
Gnupg by Gnupg
Gnupg by Gnupg
Gpg4win by Gpg4win
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise if the overflow can be controlled to execute arbitrary code.
Likely Case
Application crash (denial of service) when importing malicious keys, potentially corrupting keyrings.
If Mitigated
No impact if patched versions are used or if key import from untrusted sources is prevented.
🎯 Exploit Status
Exploitation requires the victim to import a specially crafted OpenPGP key. No public exploit code has been released.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: GnuPG 2.2.23 or later, Gpg4win 3.1.13 or later
Vendor Advisory: https://dev.gnupg.org/T5050
Restart Required: No
Instructions:
1. Update GnuPG using your package manager: 'sudo apt update && sudo apt upgrade gnupg' (Debian/Ubuntu) or 'sudo yum update gnupg2' (RHEL/CentOS). 2. For Gpg4win, download and install the latest version from the official website. 3. Verify the update with 'gpg --version'.
🔧 Temporary Workarounds
Disable key import from untrusted sources
allPrevent users from importing OpenPGP keys from unknown or untrusted sources through policy or training.
Use GnuPG 2.3.x branch
linuxUpgrade to GnuPG 2.3.x which is not affected by this vulnerability.
Follow distribution-specific instructions to install GnuPG 2.3.x
🧯 If You Can't Patch
- Implement strict policies against importing OpenPGP keys from untrusted sources.
- Monitor for crash logs in gpg processes and investigate any related to key import operations.
🔍 How to Verify
Check if Vulnerable:
Run 'gpg --version' and check if the version is 2.2.21 or 2.2.22. For Gpg4win, check the installed version in the About dialog.
Check Version:
gpg --version | head -1
Verify Fix Applied:
After updating, run 'gpg --version' to confirm version is 2.2.23 or higher, or 2.3.x.
📡 Detection & Monitoring
Log Indicators:
- Application crashes (segmentation faults) in gpg processes during key import operations
- Error messages related to key parsing or AEAD preferences in system logs
Network Indicators:
- Unusual key import activities from external sources
- Network traffic containing OpenPGP key material to internal systems
SIEM Query:
Process:gpg AND (EventID:1000 OR Signal:SIGSEGV) OR LogMessage:"key-check.c"
🔗 References
- http://www.openwall.com/lists/oss-security/2020/09/03/4
- http://www.openwall.com/lists/oss-security/2020/09/03/5
- https://bugzilla.opensuse.org/show_bug.cgi?id=1176034
- https://dev.gnupg.org/T5050
- https://dev.gnupg.org/rG8ec9573e57866dda5efb4677d4454161517484bc
- https://lists.gnupg.org/pipermail/gnupg-announce/2020q3/000448.html
- http://www.openwall.com/lists/oss-security/2020/09/03/4
- http://www.openwall.com/lists/oss-security/2020/09/03/5
- https://bugzilla.opensuse.org/show_bug.cgi?id=1176034
- https://dev.gnupg.org/T5050
- https://dev.gnupg.org/rG8ec9573e57866dda5efb4677d4454161517484bc
- https://lists.gnupg.org/pipermail/gnupg-announce/2020q3/000448.html