Skip to main content

GnuPG’s Library Has a Critical Double Free Triggered by a Crafted OpenPGP Key

GnuPG says GPGME, the library behind most mail clients, Samba and Gpg4win, has a critical double free reachable with a crafted OpenPGP key. Which version fixes it, where updates will miss, and what to check first.

KBY News Desk7 min read
Detailed view of Ruby on Rails code highlighting software development intricacies.

The GnuPG project has warned that GPGME, the library that mail clients, Samba, file managers and the Windows tool Gpg4win use to talk to GnuPG, contains a critical memory bug that a crafted OpenPGP key can trigger. The project’s advisory, posted on Friday 20 November, says the flaw can be used to pull data out of an application that processes attacker-supplied material, such as signed data, and that remote code execution “can’t be ruled out”. It asks for an immediate update. The fixed library is GPGME 2.3.1, and Gpg4win 5.1.2 carries it for Windows. The project has not said it knows of any attacks, according to The Hacker News, and the advisory offers no workaround other than a patch for builds that cannot move to the new version.

#What the bug is

The flaw is tracked as CVE-2026-129975 (the project’s own tracker number is T8557). It is a double free: the same block of memory is released twice. The advisory says it is reached with “an OpenPGP key containing a crafted very long user id”.

The mechanics, as the project and the report in its tracker describe them, are ordinary and worth understanding because they explain why the fix matters beyond GnuPG itself. Two internal GPGME functions read status lines and key listings back from the gpg program. They start with a buffer of 1,024 bytes and grow it when the input is longer. When the buffer is moved, the function keeps using the new address, but only copies it back to the surrounding object at the very end. If the function returns early because of a read error or a callback failure, the object is left pointing at the memory that was already freed. When the object is cleaned up, that memory is freed a second time. The advisory adds a detail that makes this harder to catch: because other allocations happen in between, the usual double-free checks in memory allocators may not fire.

The tracker entry records the reporter’s view that the problem is present in the current development branch and also in GPGME 1.18.0 and later releases shipped in distributions. The advisory is written more broadly: all software using a GPGME version earlier than 2.3.0, as a shared library, a Windows DLL or statically linked, is affected. It says version 2.3.0 was never publicly available, so in practice the line to remember is “anything before 2.3.1”.

#Who is in the blast zone

The advisory’s own list of software using GPGME is Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, “most mail clients”, many XMPP clients, Samba and Flatpak. We would add the caution that “uses GPGME” and “is exposed to a hostile key” are different things, and the advisory does not say which programs hand incoming material to the library without a person importing a key first. The Hacker News makes the same point in its report. That gap is the thing we most want answered.

Our reading, which is ours and not the project’s, is that the order of concern follows how automatically a program processes strangers’ data. A desktop mail client that verifies signatures on messages you open is further up the list than an archive tool you run by hand. A server that checks signed packages or messages without a person watching is higher still. If you run anything that does the latter, patch it first and ask the vendor, in these words: “Does this product use GPGME, which version does it ship, and does it process signed or encrypted data from outside our organisation automatically?”

#How the fix reaches you, and where it will not

The project’s instructions depend on where the library sits.

  • As a shared library on Linux, update to GPGME 2.3.1 or take your distribution’s fixed package. The tracker says the project gave the reporter the fixed tarball and a patch for distribution to Linux distributions before disclosure, so some may already have updates, though we have not checked any particular distribution.
  • On Windows, the DLL comes from the updated Gpg4win. Its change history says version 5.1.2 has been available since 20 November, “fixes a severe security issue” and should be installed as soon as possible.
  • For binaries with GPGME built in statically, the advisory says to rebuild them against 2.3.1. Updating the system library does nothing for these. The same applies to an application that ships its own copy of the library.
  • For older versions that cannot move, the advisory attaches a patch that it expects will apply cleanly even to very old versions. The download page also lists a legacy 1.24.4 release, and The Hacker News reports that the legacy notes say the project cannot guarantee that branch will receive every security patch.
  • GPGMEPP and GPGMEQT need no update.

The statically linked and bundled copies are the real trouble. A package manager will tell you the system library is current and say nothing about the mail client that carries its own. If your estate relies on a vulnerability scanner that checks installed package versions, expect it to miss those too. Our entry on vulnerability management covers why dependency inventories matter, but the short version is that this week you want to know which of your applications contain GPGME, not just which machines have it installed.

#What to check today

On Linux hosts, find out which version the system carries. Distributions often backport a fix without changing the version number, so look for the CVE in the package changelog (for example rpm -q –changelog gpgme on Red Hat family systems, or apt changelog for the libgpgme package of your Debian or Ubuntu release) rather than trusting the number alone. To see which running processes have the library loaded, search /proc/[0-9]*/maps for “gpgme”. An updated library does not protect a process that is still running with the old one in memory, so restart the services that use it, Samba included, or reboot.

On Windows, look for Gpg4win and Kleopatra on laptops and install 5.1.2. In a managed fleet, that is a package to push through your software deployment tool, not something staff will do themselves.

For a small business without its own IT department, the question to put to whoever looks after your computers is short: do any of our machines use Gpg4win or GnuPG, and has it been updated since 20 November? If nobody has heard of GnuPG, the answer is probably “no”, and you can stop reading.

#What we expect

We expect distribution updates and vendor notices to arrive unevenly over the next few days, and the long tail to be the bundled copies, which will wait for each application’s own release. The advisory, the tracker and Gpg4win’s change history agree on the fix, so we see no doubt over what to install. What we cannot tell you is how easy this is to exploit in a real application: nothing we have read includes a working attack, and the project has not rated the bug in the pages we read, beyond calling it critical. If a proof of concept or reports of exploitation appear, this moves from “update this week” to “update tonight”. Until then it is a high-priority patch with an awkward tail, not an emergency.

One more detail from the advisory explains the timing. GnuPG says it was told on 12 November by GitLab, which had reported the bug found by Johan Carlsson, and had planned disclosure for 25 November. It brought that forward to 20 November, saying a separate bug, which it calls Ruby2Shell, forced GitLab to update earlier. We have not examined that other bug, and mention it only because it is why the notice arrived five days early.

Evidence trail

Sources and verification

Primary documentation and external technical references used in this article.

  1. 01GnuPG Security Advisory for GPGME (T8557, CVE-2026-129975), Werner Koch, 20 November 2026lists.gnupg.org
  2. 02GnuPG tracker, T8557: Double free in GPGME read_status/read_colon_linestatic.dev.gnupg.org
  3. 03Gpg4win change history, version 5.1.2gpg4win.org
  4. 04GnuPG download pagegnupg.org
  5. 05The Hacker News, "GnuPG Warns Critical GPGME Flaw Could Expose App Data via Malicious OpenPGP Keys"thehackernews.com

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Reader Interaction

Comments

Add a thoughtful note on GnuPG’s Library Has a Critical Double Free Triggered by a Crafted OpenPGP Key. Comments are checked for spam and held for moderation before appearing.

Loading comments...

Get new fixes by email.

New runbooks, configuration traps and fixes from KBY Technologies, about twice a week.