Security & privacy

Critical GPGME flaw exposes app data via malicious OpenPGP keys

A double-free bug in the GPGME library, tracked as CVE-2026-129975, allows data theft through malformed OpenPGP keys. Developers must update to version 2.3.1 or apply patches immediately.

Illustration of a broken security shield representing the GPGME vulnerability
Illustration generated for this article

The GnuPG project has issued an urgent warning regarding a critical vulnerability in GPGME, the standard library used by applications to interact with GnuPG encryption tools. Discovered last week and tracked as CVE-2026-129975, this flaw allows attackers to steal data from affected software by sending a malicious OpenPGP key with an unusually long user ID. Fixed versions were released this week to address the issue across multiple platforms.

What happened

The vulnerability affects all software utilizing GPGME versions prior to 2.3.0, regardless of whether the library is loaded as a shared library, a Windows DLL, or statically linked into the application binary. The GnuPG project identified that most mail clients, many XMPP messaging clients, Samba, and its own desktop packages like Gpg4win and GnuPG VS-Desktop are potentially vulnerable. While no active exploits have been reported yet, the advisory explicitly states that remote code execution cannot be ruled out.

The trigger for this bug is signed data sent to an application, which then passes the material to the GPGME library. The advisory does not specify which programs might process such data without requiring a manual key import first, leaving some ambiguity about the exact attack surface for end-users. The disclosure timeline was accelerated from November 25 to November 20 because GitLab needed to patch a separate Ruby2Shell bug, prompting earlier coordination.

Johan Carlsson discovered the flaw and reported it to the project via GitLab. The GnuPG team responded by releasing GPGME 2.3.1, noting that version 2.3.0 was never publicly available. For systems unable to upgrade to the latest major version, a legacy fix has been issued as version 1.24.4, though the project warns that the legacy branch may not receive every future security patch.

How it works

At its core, this vulnerability is a "double free" memory corruption bug. This occurs when a program attempts to release the same block of memory twice, leading to undefined behavior that attackers can exploit to read sensitive data or potentially execute arbitrary code. The defect resides in two specific routines within GPGME: read_status() and read_colon_line(). These functions are responsible for parsing status lines and key listings returned by the underlying GnuPG engine.

When these routines encounter input data that exceeds their initial buffer size, they allocate a larger buffer to accommodate the extra information. However, the code only updates the internal pointer to this new memory location if the operation completes without errors. If an error occurs during the resizing process, the pointer remains pointing to the old, already-freed memory address. When the cleanup phase runs, it attempts to free this stale pointer again, causing the double free condition. This mechanism allows a crafted key with a long user ID to destabilize the memory management of the host application.

Key details

  • Vulnerability ID: CVE-2026-129975 affects all GPGME versions before 2.3.0.
  • Root Cause: A double-free error in read_status() and read_colon_line() routines triggered by long user IDs in OpenPGP keys.
  • Fixed Versions: Update to GPGME 2.3.1 for current systems, or GPGME 1.24.4 for legacy branches.
  • Windows Users: Install Gpg4win 5.1.2, which bundles the patched library.
  • Static Linking: Applications with statically linked GPGME copies must be rebuilt with the new library; system-level updates are insufficient.
  • Exempt Components: GPGMEPP and GPGMEQT do not require updates as they are not affected by this specific flaw.

Why it matters

For software engineers and IT leads, this incident highlights the hidden risks of dependency management, particularly with low-level libraries like GPGME that handle cryptographic operations. Because GPGME is often statically linked or bundled within applications, simply updating the system-wide shared library may not protect all installed software. Teams need to audit their supply chain to identify which applications embed their own copies of GPGME and ensure those vendors release updated builds. Failure to do so leaves gaps that system administrators cannot close with standard package manager updates.

The potential for remote code execution elevates this from a simple data leak to a severe infrastructure threat. Email and messaging clients are high-value targets because they routinely process untrusted data from external sources. If an attacker can craft a signed message or key that triggers this memory corruption, they could gain control over the client machine. This underscores the importance of robust input validation and memory safety in libraries that parse complex, user-supplied formats like OpenPGP.

What you can do

  • Check your system for GPGME installations and verify if the version is older than 2.3.1 or 1.24.4.
  • Windows users should immediately upgrade to Gpg4win 5.1.2 to ensure the bundled library is patched.
  • Identify any applications in your environment that statically link GPGME and contact vendors for updated builds.
  • Apply the official patch provided in the GnuPG security advisory if you cannot upgrade to the latest version immediately.
  • Monitor logs for unusual crashes in mail or XMPP clients, which could indicate attempted exploitation.
  • Note that no interim workaround exists for vulnerable software that cannot be updated or patched right now.
  • #security
  • #gnupg
  • #vulnerability
  • #memory-safety
  • #openpgp

Tools from the Bytechap store

Keep reading

All stories