GnuPG patches critical GPGME double free; RCE not ruled out

On 20 November 2026 Werner Koch, writing for "Your GnuPG hackers", posted a security advisory on the gnupg-announce list. It announces GPGME 2.3.1, which fixes what the advisory calls a critical security bug found in all prior versions. The bug is tracked internally as T8557 and carries the identifier CVE-2026-129975. GPGME is the library that other programs use to talk to GnuPG.

The flaw: an OpenPGP key containing a crafted, very long user id can trigger a double free. The advisory says this can be used to exfiltrate data from applications, for example by sending signed data. It also says that exploiting the bug to mount a remote code execution (RCE) attack can't be ruled out, and that an immediate update is therefore highly suggested. The advisory does not claim RCE has been demonstrated.

The root cause sits in two GPGME internal functions that read status lines and key listings from gpg. Each starts with a 1024-byte buffer and reallocates it when more space is needed. After a reallocation, the function uses the new pointer but assigns it back to the context object only at the end. If the function returns early, because of a read error or another event, the context still holds the stale pointer to the freed memory. When the context is released, that memory is freed a second time. Because other allocations happen in between, the usual double-free checks in memory allocators may not fire.

The Impact section says any software using a GPGME version prior to 2.3.0, whether as a shared library, a DLL or statically linked, is affected. It adds that version 2.3.0 was never publicly available. Listed examples of software that uses GPGME are Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpack (spelled that way in the advisory).

The fix is to update the GPGME shared library to 2.3.1. Anyone who needs a DLL can take it from the updated Gpg4win, and statically linked binaries must be rebuilt against GPGME 2.3.1. If GPGME can't be updated, an attached patch can be applied; the advisory says it likely applies cleanly even to very old versions. GPGMEPP and GPGMEQT need no update. Alongside the library, the team released Gpg4win 5.1.2, a Windows installer that includes the fixed GPGME, the Kleopatra GUI and a PDF reader, plus new GnuPG Desktop and GnuPG VS-Desktop versions. The source tarball is gpgme-2.3.1.tar.bz2 (1393k), and Debian-style packages are offered for several Debian variants.

The release notes for 2.3.1 (dated 19 November 2026, compared with 2.2.0) list the double-free fix in the status line read code and three new constants, GPGME_PK_MLKEM, GPGME_PK_MLDSA and GPGME_PK_DLTHM, with mappings for algorithms used by backends.

On timing: the vulnerability was discovered by Johan Carlsson, and GitLab informed the GnuPG team on 12 November 2026. A coordinated disclosure was first planned for 25 November. The advisory says that because of the new Ruby2Shell bug, GitLab had to update earlier, so the GPGME bug was disclosed on 20 November instead.

Key facts

  • GPGME 2.3.1 fixes a critical double free (CVE-2026-129975, internal ID T8557) that an OpenPGP key with a crafted, very long user id can trigger.
  • The advisory says the bug can be used to exfiltrate data from applications and that RCE can't be ruled out; it urges an immediate update.
  • Cause: a buffer starts at 1024 bytes and is reallocated, but the new pointer is saved to the context only at the end of the function, so an early return leaves a stale pointer that gets freed twice.
  • Affected: software using GPGME as a shared library, DLL or static build, including Gpg4win, GnuPG Desktop, most mail clients, many XMPP clients and Samba.
  • Johan Carlsson found the bug and GitLab informed GnuPG on 2026-11-12; disclosure moved from 2026-11-25 to 2026-11-20 because GitLab had to update earlier due to the Ruby2Shell bug.

Why it matters

GPGME sits underneath a lot of software that handles OpenPGP, so one memory-safety bug in it reaches many programs at once. The trigger is a key with a crafted, very long user id, the kind of data an application may process when it reads keys or verifies signed content. The advisory calls the bug critical, says it can be used to exfiltrate data from applications, and says RCE can't be ruled out. The disclosure date was also pulled forward, from 25 November to 20 November, because GitLab had to update earlier due to the new Ruby2Shell bug.

Who it affects

Anyone running software that uses GPGME, whether as a shared library, a DLL or statically linked. The advisory names Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpack. Maintainers who ship GPGME in their own binaries are affected too, since static builds carry the bug until rebuilt. The advisory says GPGMEPP and GPGMEQT need no update.

How to use it

Update the GPGME shared library to 2.3.1 (source tarball gpgme-2.3.1.tar.bz2, with an OpenPGP signature alongside). Windows users can get the fixed GPGME in Gpg4win 5.1.2, and a DLL can be taken from that release. Anyone shipping statically linked binaries should rebuild them against GPGME 2.3.1. If updating isn't possible, apply the patch attached to the advisory, which the advisory says likely applies cleanly even to very old versions. Debian-style packages are also provided for several Debian variants.

How solid is it

This is the official advisory from the GnuPG team, posted by Werner Koch on the gnupg-announce list, with a CVE identifier, an internal tracker ID (T8557) and a detailed root-cause description. The discoverer, Johan Carlsson, is named. The advisory does not claim RCE has been demonstrated, only that it can't be ruled out. No evidence of exploitation in the wild is given.

Risks and caveats

The scope wording is slightly uneven: the introduction says all prior versions are affected, while the Impact section says versions prior to 2.3.0, and notes that 2.3.0 was never publicly available. In practice the instruction is simply to move to 2.3.1. No CVSS score or severity rating beyond the word critical is given. The advisory notes that common double-free checks in memory allocators may not catch the bug because of other allocations in between, so such checks are no safeguard. Exact patched version numbers for GnuPG Desktop and GnuPG VS-Desktop are not given.

“Thus an immediate update is highly suggested.”

— Werner Koch, GnuPG security advisory for GPGME