# CVE-2026-129975: how to find and patch the GPGME double free

> A crafted OpenPGP key can trigger a double free in GPGME. Here is how to find affected software and update to 2.3.1 or apply the patch.

- Published: 2026-11-21
- Topic: [Security](https://futuretechnologyhq.com/topic/security/)
- URL: https://futuretechnologyhq.com/article/cve-2026-129975-how-to-find-and-patch-the-gpgme-double-free/
- Publisher: [Future Technology HQ](https://futuretechnologyhq.com/), free to read. Quote as "Future Technology HQ" with a link to the article.

## Key points

- Every GPGME version prior to 2.3.0 is affected by a critical double free, whether shared, DLL or statically linked
- Statically linked binaries must be rebuilt against 2.3.1; updating the system library alone will not fix them
- Red Hat Enterprise Linux 9 seems to have patched the double free five years ago but apparently never sent the fix upstream

## Article

After reading this, an IT team should be able to find software that depends on GPGME, update or patch it, and confirm that nothing is still running a vulnerable build.

GnuPG announced GPGME 2.3.1 on 20 November 2026 to fix a critical double free, tracked as CVE-2026-129975. A double free is a memory bug where the same block of memory is announced twice, which can corrupt a program's memory. GPGME (GnuPG Made Easy) is the library that many applications use to talk to GnuPG, so the exposure is wide.

## What you need before starting

- **Difficulty:** moderate. Updating a distribution package is easy; auditing statically linked software takes more effort.
- **Access:** admin rights on affected machines, plus your vendor's update channels.
- **Inventory:** a list of software that may link GPGME. GnuPG names Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpak as examples.
- **Cost:** none. The fix is free and open source.

## What the bug does

An attacker needs only an OpenPGP key containing a crafted, very long user ID. Processing it triggers the double free, which GnuPG says can be used to exfiltrate data from applications, for example by sending signed data. It also says remote code execution cannot be ruled out, hence the advice to update immediately.

The root cause is in two internal functions that read status lines and key listings from gpg. They start with a 1024-byte buffer and reallocate it when more space is needed. The new pointer is only written back to the context object at the end of the function. If the function exits early, for instance on a read error, the context keeps a stale pointer to freed memory, and the memory is freed a second time when the context is announced. Because other allocations happen in between, the usual double-free checks in memory allocators may not catch it.

All software using a GPGME version prior to 2.3.0 is affected, as a shared library, a DLL or statically linked. Version 2.3.0 was never publicly available, so 2.3.1 is the version to aim for.

## Step-by-step process

### Step 1: Inventory what uses GPGME

List installed packages that depend on the library, including mail clients, XMPP clients and Samba on servers. Check Flatpak installs separately, as they may carry their own copy. Note anything built in-house that links GPGME statically.

### Step 2: Update shared-library installs

Update the GPGME shared library to 2.3.1 through your distribution's package manager. GnuPG also provides Debian-style packages for several Debian variants at repos.gnupg.org.

### Step 3: Update Windows installs

Windows users should install Gpg4win 5.1.2, which includes the fixed GPGME, the Kleopatra GUI and a PDF reader. If your own software bundles a GPGME DLL, GnuPG says you can take the fixed one from the updated Gpg4win. New GnuPG Desktop and GnuPG VS-Desktop versions have also been announced.

### Step 4: Patch old versions where you cannot upgrade

GnuPG says its attached patch likely applies cleanly even to very old versions. The attachment did not make it into the announcement mail, but a commit on the GitHub mirror was pointed out on the gnupg-devel list: github.com/gpg/gpgme/commit/14499348b966cd7b3d72afee15a5cd51cdd0a727.

### Step 5: Rebuild statically linked binaries

Updating the system library does nothing for a binary that carries its own copy. Rebuild each one against GPGME 2.3.1 and redeploy.

### Step 6: Verify the download

If you fetch the tarball, check its OpenPGP signature and the published checksum. GnuPG lists the SHA-1 checksum for gpgme-2.3.1.tar.bz2 as 1134a407b50204ee6fb9efaa6e1451c2460e543e. The tarball is 1393k.

## Common mistakes to avoid

- **Assuming the OS package covers everything.** Statically linked and bundled copies are the usual stragglers.
- **Updating GPGMEPP or GPGMEQT.** GnuPG says this is unnecessary.
- **Waiting for 2.3.0.** It was never publicly available.

## Tips that make a difference

- Start with internet-facing and mail-processing systems, since the trigger is a crafted OpenPGP key.
- If a vendor product bundles GPGME, ask the vendor for a rebuilt package rather than swapping files yourself.

## Disclosure timeline and a downstream footnote

The flaw was discovered by Johan Carlsson, and GitLab informed GnuPG on 12 November 2026. A coordinated disclosure was first set for 25 November 2026, but GitLab had to update earlier because of a separate Ruby2Shell bug, so GnuPG disclosed on 20 November.

There is an awkward footnote. Todd Zullinger pointed out on gnupg-devel that Red Hat Enterprise Linux 9 patched the same double free five years ago, after a Coverity scan flagged it, in a patch against gpgme 1.15.1. That fix is in RHEL 9 but not earlier or later releases, and it was apparently never submitted upstream or shared with Fedora. Sam James of Gentoo relayed the point to oss-sec.

## UK and compliance angle

For UK organisations, this is routine vulnerability management with a data-protection edge. The ICO says UK GDPR's security principle requires appropriate technical and organisational measures, and its checklist includes testing your measures.

## Next steps

Add GPGME to your software bill of materials so the next advisory takes minutes to triage. Subscribe to the gnupg-announce list. For other recent patch-or-mitigate cases, see [how to check and patch servers for CVE-2026-123007](/article/nginx2root-how-to-check-and-patch-servers-for-cve-2026-123007/) and [the unfixed EDK II bug CVE-2026-97631](/article/cve-2026-97631-a-16-year-old-edk-ii-bug-with-no-stable-fix/).

## Summary

You now know what CVE-2026-129975 is, which software it touches, and how to fix it: update to GPGME 2.3.1, install Gpg4win 5.1.2 on Windows, patch old builds where you must, and rebuild anything statically linked.

## Sources

- [GnuPG announce list](https://lists.gnupg.org/pipermail/gnupg-announce/2026q4/000517.html)
- [oss-sec mailing list](https://seclists.org/oss-sec/2026/q4/805)
- [NCSC, Cyber Essentials overview](https://www.ncsc.gov.uk/cyberessentials/overview)
- [ICO, A guide to data security](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/security/a-guide-to-data-security/)
- [legislation.gov.uk, UK GDPR Article 32, Security of processing](https://www.legislation.gov.uk/eur/2016/679/article/32)
