Skip to content

GPGME CVE-2026-129975: How to Check and Update GPGME

By Bikram Bhujel

On Friday evening GnuPG put out a security advisory for GPGME, and it was not the usual "please update when convenient" note. A crafted OpenPGP key with a very long user ID can trigger a double free inside the library, and the GnuPG team says they can't rule out remote code execution. GPGME is the piece most apps use to talk to GnuPG, so this reaches a lot further than people who type gpg at a terminal.

This post covers what CVE-2026-129975 actually is, how to find out whether your Linux machines and Windows PCs have a vulnerable GPGME, and how to update it properly. The part people skip is restarting the programs that already loaded the old library, and I'll show you how to find them.

Terminal showing the installed GPGME package version being checked before updating to fix CVE-2026-129975

Quick answer

CVE-2026-129975 is a double free in GPGME, the library that mail clients, Kleopatra, Samba, Flatpak and many XMPP clients use to call GnuPG. A key with a crafted long user ID can trigger it to leak data, and RCE can't be ruled out. Every GPGME before 2.3.1 is affected (2.3.0 was never public). On Linux, install your distribution's patched gpgme / libgpgme package; on Windows, install Gpg4win 5.1.2. Then restart every app that had the old library loaded, or the fix does nothing yet.

What CVE-2026-129975 is, in plain words

GPGME (GnuPG Made Easy) is a small C library. Instead of every program parsing GnuPG's output on its own, they link GPGME and let it start gpg, read its status lines and hand back clean results. That's why one bug in it touches so many programs at once.

According to the GnuPG advisory from Werner Koch, two internal functions that read status lines and key listings from gpg start with a 1024 byte buffer and grow it when needed. When the buffer is reallocated, the new pointer was only saved back to the context at the end of the function. If the function returned early, for example on a read error, the context kept the old pointer to memory that had already been freed. Later the context is released and that memory is freed a second time.

An attacker gets there with an OpenPGP key carrying a crafted, very long user ID. The advisory says the double free can be used to exfiltrate data from applications, and that a full RCE "can't be ruled out". The patch notes call it a 24 year old bug. Johan Carlsson found it, GitLab told the GnuPG team on 12 November, and disclosure was pulled forward to 20 November because of the separate Ruby2Shell problem GitLab was dealing with at the same time.

DetailValue
CVECVE-2026-129975 (GnuPG task T8557)
Bug typeDouble free in read_status() and read_colon_line()
TriggerOpenPGP key with a crafted, very long user ID
AffectedAll GPGME before 2.3.0, shared, DLL or statically linked
Fixed inGPGME 2.3.1 (19 November 2026), Gpg4win 5.1.2
Not neededGPGMEPP and GPGMEQT don't need updating

Who should care about this

The advisory names Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpak. In practice that means:

  • Linux desktops where KMail, Evolution, Mutt with GPGME, Kleopatra or a Jabber client handle signed or encrypted mail.
  • Windows PCs with Gpg4win or Kleopatra installed, which is common in offices that sign documents or exchange encrypted files.
  • Servers running Samba, and any box using Flatpak.
  • Anything you built yourself and linked statically against an old GPGME. Those binaries carry the bug inside them, so a system update won't fix them.

If you only use gpg on the command line and nothing else on the machine links GPGME, you're less exposed. Most desktop Linux installs pull GPGME in as a dependency anyway, so check rather than assume.

Step 1: Check which GPGME version you have on Linux

Ask the package manager, not the upstream version number. Distributions usually backport the fix into their existing version, so the version may still say 1.x and be patched. The changelog is the thing that tells you.

Debian and Ubuntu

dpkg -l | grep -i gpgme
apt changelog libgpgme11t64 2>/dev/null | grep -i CVE-2026-129975 || apt changelog libgpgme11 | grep -i CVE-2026-129975

On Ubuntu 24.04 and newer the library package is called libgpgme11t64; on older releases and Debian 12 it's libgpgme11. If the changelog grep returns a line, your installed package has the fix. Debian tracks the status per release on its security tracker page for CVE-2026-129975.

Fedora, RHEL, Rocky and Alma

rpm -q gpgme
rpm -q --changelog gpgme | grep -i CVE-2026-129975

Arch Linux

pacman -Q gpgme

Arch ships upstream versions, so here you're looking for 2.3.1 or later.

Step 2: Update GPGME

# Debian / Ubuntu
sudo apt update && sudo apt install --only-upgrade 'libgpgme*'

# Fedora / RHEL family
sudo dnf upgrade gpgme

# Arch
sudo pacman -Syu

# Flatpak runtimes
flatpak update

If your distribution hasn't shipped a fix yet, GnuPG offers two other routes. They publish their own Debian-style packages at repos.gnupg.org, and the advisory includes a small patch that the authors say "likely applies cleanly even to very old versions". For a production server I'd rather wait a day for the distro package than mix in a third-party repo, but for a mail server that receives keys from strangers, that day matters.

Step 3: Restart whatever loaded the old library

This is the step that gets missed. A program that started before the update still has the old libgpgme mapped in memory. The file on disk is new; the running process isn't. Find those processes:

sudo lsof 2>/dev/null | grep -i 'libgpgme' | grep -i deleted

Anything listed is still using the deleted old copy. Close and reopen desktop apps, and restart services such as Samba:

sudo systemctl restart smbd
# Debian/Ubuntu have a helper that finds these for you
sudo needrestart -r l

On a desktop, logging out and back in (or a reboot) is the lazy and reliable way.

Step 4: Update Gpg4win on Windows

Windows doesn't get this through Windows Update. Gpg4win bundles its own GPGME DLL, so you need the new installer.

  1. Open Kleopatra and go to Help > About Gpg4win to see your version.
  2. If it's older than 5.1.2, download the new installer from gpg4win.org. Check its signature before you run it if you're doing this for an office.
  3. Close Kleopatra and Outlook (GpgOL plugs into Outlook) before installing, then run the installer over the top. Your keys stay where they are.

For a fleet, push the new installer the same way you deploy other software. The GnuPG team also points out that anyone who needs just the DLL for their own app can take it from the updated Gpg4win.

The catch with statically linked binaries

A static binary has its own copy of GPGME compiled in. Updating the system package does nothing for it. The advisory is clear on this: rebuild those programs against GPGME 2.3.1. If you ship an internal tool, a container image or an appliance that bundles GPGME, that's on you or the vendor, not on apt.

The same goes for container images. If an image has GPGME inside it, updating the host doesn't touch it. Rebuild the image or pull the maintainer's updated tag.

What to do if the update breaks something

This is a bug-fix release, so breakage is unlikely. If a mail client or Kleopatra starts misbehaving right after the update, restart it first, since half-updated processes cause odd errors. If it really is the update, you can pin the previous package temporarily (sudo apt install libgpgme11t64=<old-version>, or reinstall the previous Gpg4win). I'd treat that as a few hours of workaround while you report the problem, not a way to stay. The old version has a double free that a stranger's key can reach.

A few things I learned

  • The library matters more than gpg itself. Most people check gpg --version and feel safe. This bug is in the layer above it.
  • Version numbers lie on Debian and Ubuntu. A backported fix keeps the old version string, so grep the changelog for the CVE.
  • Updating is half the job. Running processes keep the old code until they restart.
  • Windows needs its own step. Gpg4win isn't covered by Windows Update or most Linux habits.

This is the second big open-source library fix in a week. I covered the 948 Linux kernel vulnerabilities and the Ubuntu 24.04 to 26.04 upgrade earlier this month, and my Homelab Intelligence page tracks how I keep my own machines patched. If you'd like someone to look after patching for your office, that's part of my IT support services.

Frequently asked questions

What is CVE-2026-129975?

CVE-2026-129975 is a double free bug in GPGME, the library many apps use to talk to GnuPG. An OpenPGP key with a crafted, very long user ID can trigger it. GnuPG says it can be used to steal data from applications and that remote code execution can't be ruled out. It is fixed in GPGME 2.3.1.

Which GPGME versions are affected by CVE-2026-129975?

Every GPGME version before 2.3.0 is affected, whether it's used as a shared library, a Windows DLL or linked statically. Version 2.3.0 was never released publicly, so the first fixed upstream release is GPGME 2.3.1 from 19 November 2026. Distributions may backport the fix into older version numbers.

Do I need to update gpg itself to fix this?

No, the bug is in GPGME, not in the gpg program. You need the patched GPGME library from your distribution or GPGME 2.3.1. On Windows, install Gpg4win 5.1.2, which includes the fixed GPGME. The C++ and Qt bindings, GPGMEPP and GPGMEQT, don't need updating.

How do I check if my Ubuntu or Debian GPGME is patched?

Run dpkg -l | grep -i gpgme to see the installed package, then search its changelog for the CVE, for example apt changelog libgpgme11t64 | grep CVE-2026-129975. If the CVE appears, the fix is in. Debian's security tracker also lists the fixed version for each release.

Do I need to restart after updating GPGME?

Yes. Programs that were already running keep the old library in memory until they restart. Run sudo lsof | grep libgpgme | grep deleted to find them, then restart those apps and services such as Samba, or simply reboot. On Debian and Ubuntu, needrestart can find them for you.

Comments

Questions and corrections are welcome. I read every comment before it appears, and remove spam and promotional links.