GnuPG — Critical GPGME Double-Free Flaw Exposes App Data via Malicious OpenPGP Keys (CVE-2026-129975)

Publication date: November 21, 2026
Category: Vulnerability / Software Security

Introduction

The GnuPG project has released an urgent security advisory following the discovery of a critical memory corruption vulnerability in GPGME (GnuPG Made Easy), the standard library utilized by numerous applications to interface with GnuPG’s encryption and signing capabilities. Tracked as CVE-2026-129975, the flaw was originally uncovered by Johan Carlsson and reported via GitLab. Although coordinated disclosure was initially scheduled for late November 2026, the timeline was accelerated due to external software maintenance factors. This vulnerability poses significant operational risks to email clients, XMPP utilities, and infrastructure software that process cryptographic inputs without strict boundary validation.

What is GPGME and Why is this a Critical Risk? (General Analysis)

GPGME serves as a high-level abstraction layer enabling software developers to integrate GnuPG cryptographic functions (such as encryption, decryption, digital signing, and verification) into their applications without directly interacting with the underlying command-line engine. Because libraries like GPGME are frequently distributed as shared libraries (.so on Linux, .dll on Windows) or statically linked directly into third-party binaries, a vulnerability in its internal logic compromises not just a single tool, but an entire ecosystem of dependent software.

The core issue stems from improper dynamic memory management when the library processes malformed data structures inside OpenPGP payloads.

Reasoned Severity Estimation (CVSS / CWE): As the NVD database has not yet published an official record with a definitive score for this identifier at the time of writing, a reasoned CVSS v3.1 vector of 8.8 (High) (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) is estimated. This score reflects the requirement for user interaction (processing signed data or a malicious key) alongside the potential for severe confidentiality disclosure and arbitrary code execution. The underlying weakness is categorized as CWE-415: Double Free.

How Does It Work? (Technical Analysis)

The security flaw resides specifically within two internal routines of the library responsible for parsing status information returned by the GnuPG engine: read_status() and read_colon_line(). These functions process status lines and key listings generated during cryptographic operations.

  • Initial Input Flow and Buffer Resizing: When GPGME processes a malicious OpenPGP key featuring an unusually long User ID, the parsing routines attempt to reallocate data into a larger buffer to accommodate the volume of incoming bytes.
  • Double-Free Mechanism: During this reallocation sequence, if an error occurs before the operation completes successfully, the routines fail to safely update the new memory pointer. Consequently, the application retains a reference to a memory block that has already been deallocated. During subsequent cleanup procedures, the system attempts to release the exact same memory block a second time (double free).
  • Execution Impact: This pointer inconsistency leads to heap corruption within the process. An attacker can leverage this state to manipulate application control flow, extract sensitive data from memory, or achieve remote code execution within the security context of the user running the vulnerable application.

Affected Systems / Environments

The vulnerability impacts a vast range of software integrating GPGME prior to version 2.3.0 (a version that was never publicly released). The affected scope includes:

  • Shared Libraries and Windows DLLs: Dynamic installations of GPGME prior to version 2.3.1.
  • Mail and Messaging Clients: Most traditional email clients and various XMPP messaging applications utilizing the library.
  • Official GnuPG Packages: Gpg4win (affecting versions prior to 5.1.2), GnuPG Desktop, and GnuPG VS-Desktop.
  • Statically Linked and Bundled Applications: Software that embeds GPGME statically or ships bundled copies. These are untouched by system-level library updates and require explicit rebuilt releases from their respective maintainers.
  • Component Note: GPGMEPP and GPGMEQT libraries require no updates.

Mitigation and Detection

Remediation

Developers and system administrators must apply updates immediately, as the project has provided no interim workarounds for software unable to update right away:

  1. Shared Library / DLL Update: Update GPGME to version 2.3.1 or higher, available through the project’s official download channels.
  2. Windows Environments: Upgrade to Gpg4win 5.1.2 or later, which bundles the patched library.
  3. Legacy Branches: For systems unable to migrate to the 2.3.x branch, a patched legacy release 1.24.4 is available. However, the project explicitly notes that it cannot guarantee ongoing security patch coverage for the legacy branch.
  4. Rebuilding Static Dependencies: Applications utilizing bundled or statically linked copies of GPGME must be recompiled by their respective maintainers using updated source code.

Detection

For incident response teams and security analysts, detection focuses on identifying anomalous OpenPGP keys and monitoring application stability during parsing tasks:

  • Inspect key import traffic and incoming signed data streams for OpenPGP structures containing disproportionately long metadata or user identifiers.
  • Monitor system event logs for segmentation faults or unexpected crashes in email clients or GnuPG-related processes immediately following the ingestion of external messages.

Blue Team Advisory: An attacker can craft malicious signed messages or keys distributed via public keyservers or email channels to passively or actively trigger the heap corruption flaw upon the client’s first validation attempt.

Wrapping Up

The CVE-2026-129975 vulnerability in GPGME highlights the persistent risks associated with processing complex inputs within low-level cryptographic libraries. A seemingly minor error in error handling and memory pointer management within helper routines can compromise the integrity of an entire security ecosystem. Rapid adoption of version 2.3.1 and rigorous dependency auditing are critical steps to neutralize code execution and data theft risks.

References