Skip to content
Security 5 min read

A malicious OpenPGP key with an over-long user ID triggers a double free in GPGME

On 20 November 2026, the GnuPG project disclosed CVE-2026-129975, a double free in GPGME that a crafted OpenPGP key with an abnormally long user ID is enough to trigger, with remote code execution not ruled out. Update to GPGME 2.3.1, Gpg4win 5.1.2 or the legacy 1.24.4 branch, and re-inventory any…

20 November 2026. The GnuPG project publishes a security advisory for CVE-2026-129975, a double free in GPGME, the standard library programs use to talk to GnuPG. 21 November 2026. The fixed releases are out: GPGME 2.3.1, Gpg4win 5.1.2 and the legacy 1.24.4 branch. 25 November 2026. That is when disclosure was originally scheduled — it was pulled forward a week because the Ruby2Shell flaw forced an earlier release cycle. Why it matters: a single OpenPGP key with an over-long user ID is enough to trigger the bug, and GPGME is the pipe through which most mail clients, XMPP clients and Samba pass.

A double free at the heart of GPGME

The defect is a double free: the same block of memory is released twice. It lives in two routines, read_status() and read_colon_line(), which read status lines and key listings coming back from GnuPG. The mechanism is subtle. When input runs long, these routines move the data into a larger buffer but only record the new address if they finish cleanly. An error partway leaves a pointer to memory that was already freed, and the cleanup path then frees it a second time.

The impact is not merely instability. The project’s advisory says the flaw “could be used to steal data from affected applications,” and it notes that remote code execution cannot be ruled out. A double free is exactly the kind of bug modern allocators are willing to turn into exploitable corruption, and GPGME processes untrusted input — keys, signatures, key listings. That is the profile of a flaw that lies dormant until someone, researcher or attacker, turns a crash into something more.

No attacks exploiting the flaw have been reported, and the project states this plainly. The bug was found by Johan Carlsson and reported to the project by GitLab last week. The calendar tells the story: disclosure, set for 25 November, was pulled forward because the Ruby2Shell publication forced the release schedule to realign. A cryptography project never moves a disclosure forward for convenience.

A malicious key is enough, not an exfiltration

The entry point is as simple as it is uncomfortable. An OpenPGP key carrying an abnormally long user ID — the user ID field that holds the holder’s name and address — is enough to push read_status() or read_colon_line() onto the faulty path. The project points to signed data sent to an application as an example: the program receives a message or a key, hands it to GPGME, and the reader hits a field that is too long.

The blast radius is wide, and it is not limited to encryption software. CVE-2026-129975 affects “all software that uses GPGME before version 2.3.0,” whether the library is loaded as a shared library, a Windows DLL or statically linked into the program. The examples the project gives are telling: most mail clients, many XMPP clients, Samba, and its own Gpg4win, GnuPG Desktop and GnuPG VS-Desktop packages. A flaw in a cryptography library propagates to an entire toolchain that people assume is safe by construction.

The advisory stays deliberately cautious about the exact route: it does not enumerate which programs pass signed material to the library without a manual key import. That is the operational question left open. A mail client that verifies a signature or imports an emailed key is an obvious candidate; a daemon that exposes a key listing is another. The point is not to guess the precise vector — it is that the attack surface is the library itself, and therefore everything that bundles it.

What to update

The fixed version is GPGME 2.3.1, released this week — 2.3.0 was never made public. But remediation depends on where the library lives, and that is where teams most often go wrong.

If you load a shared library or DLL, move to GPGME 2.3.1, available from the project’s official downloads and detailed in its security advisory. On Windows, Gpg4win 5.1.2 bundles the fixed library; its release notes call the issue severe and say to update as soon as possible. If you are on an older branch that cannot move to 2.3.1, the advisory ships a patch, and the legacy branch has its own fixed release, 1.24.4 — with a caveat: the project cannot guarantee that branch will receive every future security patch. GPGMEPP and GPGMEQT need no update.

The most practical trap is bundled and statically linked copies. They are affected too, and updating the system’s shared library does not reach them: each application that embeds its own copy must ship its own rebuilt release. This is the classic case of a container, an appliance or an installer that freezes a version of GPGME and stays vulnerable years after the host was patched. Inventory is therefore half the job: ldd on binaries, a sweep of version strings inside images, and a list of transitive dependencies.

Finally, with no ambiguity: the advisory offers no interim workaround for software that cannot update yet. There is no setting, no field to disable, no configuration-based mitigation. The only exit is the fixed version, and exposure lasts as long as it is not installed.

One diagnostic trap deserves attention: gpg --version prints the version of GnuPG, not of GPGME. The library lives in a separate package — libgpgme11 on Debian and Ubuntu, gpgme elsewhere — and its version is read with gpgme-config --version or by inspecting the installed package. A host can therefore show an up-to-date GnuPG and a vulnerable GPGME, especially in minimal containers that ship the library without the command-line tool. That is the first thing to check before concluding you are protected.

The disclosure path is worth noting for its own sake. The bug was found by an independent researcher, routed through GitLab’s security process, and then released early because Ruby2Shell forced the schedule forward. That chain — third-party finder, coordinated vendor response, compressed disclosure window — is the norm for widely embedded libraries, and it means the advisory reaches you before the weaponized exploit does, but not by much. The lag between the upstream fix and your vendor’s rebuild is the real window of exposure, and it is almost entirely on you to close.

For teams that use GnuPG only through the command line and never link against GPGME, there is nothing to do — the CLI itself is not affected. The exposure is the library, not the tool, and that distinction is the fastest way to scope the work.

The verdict

If you ship or maintain software that bundles GPGME, update today. The double free is critical, the surface is the cryptography library itself, and code execution is explicitly not ruled out. The cost is a rebuild; the risk is data theft or worse in every product that ships the old library.

If you consume GPGME indirectly — mail client, XMPP, Samba, Gpg4win — watch the vendor’s builds and re-inventory your embedded copies. A system update is not enough when the application embeds a static or image-frozen copy. Treat CVE-2026-129975 as a structural reminder: in cryptography, the flaw is almost never in the algorithm but in the plumbing that loads it — and that is where patches have the hardest time reaching the binary actually running in production.

References

You are reading the Security section.

RSS Security

Walid Ettayeb

DevSecOps engineer in Paris: cloud, Kubernetes and security.

Related articles