Skip to content
Shipworthy

GPGME double free (CVE-2026-129975): what to patch

GPGME 2.3.1 fixes a 24-year-old double free that a crafted OpenPGP key can trigger. Which software uses the library, how to check yours and what to update.

By · · Updated · 24 min read


On Friday 20 November 2026 the GnuPG project released GPGME 2.3.1 to fix a double free, tracked as CVE-2026-129975. The advisory calls it a "critical security bug found in all prior versions". An OpenPGP key with a crafted, very long user ID can trigger it. GnuPG says the bug can be used to pull data out of an application, and that remote code execution "can't be ruled out".

GPGME is not the gpg command. It is the library that mail clients, package managers and services use to drive gpg. If you only run gpg in a terminal, this bug is not in your path. If software on your machines verifies signatures or imports keys through GPGME, update the library and restart that software. The story reached the Hacker News front page on 21 November under the title "RCE in Gnupg", which claimed more than the advisory does. The thread has since been retitled "GnuPG Security Advisory for GPGME".

What GnuPG says

The advisory was sent to the gnupg-announce list by Werner Koch, GnuPG's lead developer. Its claims, in its own words where it matters:

  • The trigger: "By using an OpenPGP key containing a crafted very long user id it is possible to trigger a double free."
  • The impact: the double free "can be used exfiltrate data from applications by sending for example signed data."
  • Code execution: "Exploiting this bug to mount an Remote Code Execution attack (RCE) can't be ruled out. Thus an immediate update is highly suggested."
  • Who is affected: all software that uses a GPGME version before 2.3.1, "either as shared libary, DLL, or statically linked". The advisory writes "prior to 2.3.0" in one place, and also says 2.3.0 was never publicly available.

Two things are missing. There is no CVSS score in the advisory, and NVD had no entry for the CVE until 23 November. The entry it has now carries Red Hat's score, covered under the open questions below. There is also no public exploit and no report of attacks that I could find.

On Hacker News the argument is about the word "RCE". One side says a double free reachable from a signed message is as serious as it gets. The other says nobody has shown code execution and the title oversells it. Both are consistent with the advisory. A double free in a library is a memory corruption bug, and what an attacker can do with it depends on the program that links the library. Treat it as serious and patch, without assuming every affected program can be taken over.

What the bug is

GPGME runs gpg as a child process and reads back two streams of text from it: status lines and key listings. Two functions in src/engine-gpg.c do the reading, read_status() and read_colon_line().

Each one starts with a 1,024-byte buffer and grows it with realloc() when a line is longer than the buffer. The functions worked on a local copy of the buffer pointer and saved the new pointer back to the shared engine object only at the very end. If the function returned early in between, for example because of a read error or a callback error, the engine object kept the old pointer. realloc() may already have freed that old block. When the engine object was later cleaned up, the same memory was freed a second time.

The fix is ten changed lines. It saves the new pointer and size right after realloc(). The commit message says it "fixes a 24 years old bug", and the commit it names as the origin is from July 2002. Debian's tracker puts the first affected release at GPGME 0.3.9.

GitLab's version of the patch describes how an attacker reaches the code. The status buffer grows from "attacker-controlled gpg status output", so the bug is reachable "by feeding a crafted OpenPGP signature to gpgme_op_verify, and likewise via key import and listing." In plain terms, the risky actions are verifying a signature, importing a key and listing keys, when the data comes from someone you do not trust.

Who uses GPGME

The advisory gives this list of examples: Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, "most mail clients", "many XMPP clients", Samba and Flatpak.

A few more that matter to developers, each checked against its own source today:

  • Arch Linux's pacman. The Arch package database lists gpgme as a dependency of pacman. A Hacker News commenter adds that Arch uses it to verify downloaded packages.
  • GitLab. GitLab verifies signed commits on the server and bundles its own GPGME in the Omnibus package. GitLab is the party that told GnuPG about the bug. Red Hat's bug report says the finder reported it to GitLab through HackerOne.
  • The Ruby gpgme gem. By default it builds its own private copy of GPGME and links it statically. See the section below.
  • Container signing tools. The containers/image Go library, which Skopeo and Podman build on, says in its README that signature verification uses a "cgo/gpgme-based implementation" by default. Build tags can switch it to a Go-only or Sequoia-PGP implementation.

Git is not on the list. Git's documentation for gpg.program says git runs the gpg program itself to sign and verify. Signing your commits locally does not go through GPGME.

Fixed versions

WhereFixed versionStatus when I checked (21 November unless a later date is given)
GPGME upstream2.3.1Released. The tarball is dated 19 November
GPGME legacy branch1.24.4Listed on gnupg.org, dated 20 November
Gpg4win (Windows)5.1.2Released 20 November, includes GPGME 2.3.1
Debian 12 bookworm1.18.0-3+deb12u1In the security archive (DLA-4924-1)
Debian 13 trixie1.24.2-3+deb13u1In the security archive (DSA-6646-1)
Debian unstable (sid)2.3.1-1Fixed
Debian testing (forky)none yetStill on 2.2.0-2, listed as vulnerable
Homebrew2.3.1The formula is on the fixed version
Arch Linux2.3.1-1Fixed. The package was built on 21 November and was in the core repository when I checked on 23 November
Alpine Linux2.3.1-r0Fixed in the edge and 3.24 community repositories, per Alpine's tracker on 23 November. Older branches are not listed there
Ruby gpgme gem2.0.27Published on RubyGems on 23 November. It bundles GPGME 2.3.1
SUSE and openSUSE2.3.1-1.1, openSUSE Tumbleweed onlyOn 25 November SUSE's page listed Tumbleweed under released packages. SUSE Linux Enterprise builds were still in QA, such as 1.23.0-150600.3.8.1 for SLE 15 SP6 and SP7, openSUSE Leap was shown as affected, and the overall state was still "Pending"
Ubuntunone yetUbuntu published its page on 23 November. Every release from 14.04 to 26.10 is "Needs evaluation", and the priority is Medium
Red Hat Enterprise Linuxnone yetRed Hat's data of 23 November lists gpgme in RHEL 7, 8, 9 and 10 as affected with no fix available
Fedora and EPELIn testing: 2.3.1-1.fc45, 2.0.1-6.fc44, 1.24.3-7.fc43On 25 November Fedora's update system showed security updates for Fedora 45, 44 and 43, all pushed to testing that morning and none yet stable. Fedora 44 and 43 get the fix as a backport, so their version numbers stay at 2.0.1 and 1.24.3. The Fedora 46 (rawhide) build of 2.3.1 was also still in testing. There was no EPEL update

The advisory adds that GnuPG Desktop and GnuPG VS-Desktop have new versions too, and that there is "no need to udpate GPGMEPP or GPGMEQT", the C++ and Qt wrappers.

As with the nginx bugs earlier this week, the upstream version number does not tell you much on Debian. The fixed bookworm package still says 1.18.0. Compare the full package version with your distribution's security tracker.

Check your machines

Start with which GPGME version is installed:

# Debian and Ubuntu
dpkg -l | grep -i gpgme

# Fedora, RHEL and openSUSE
rpm -qa | grep -i gpgme

# Arch
pacman -Q gpgme

# macOS with Homebrew
brew list --versions gpgme

On Linux, this lists the running processes that have the shared library loaded. Run it before and after the update:

sudo grep -l libgpgme /proc/[0-9]*/maps 2>/dev/null

Each line of output is a path like /proc/1234/maps, and ps -p 1234 shows which program that is. Anything still listed after the update is running the old code until it restarts.

Then look for copies the package manager does not know about:

# Ruby projects: is the gpgme gem installed?
gem list gpgme

# Self-managed GitLab: which version is running?
sudo gitlab-rake gitlab:env:info

What to do, in order

1. Update GPGME from your package manager, then restart what uses it. On Debian that is the usual sudo apt update && sudo apt upgrade. On macOS it is brew upgrade gpgme. On Windows, install Gpg4win 5.1.2. Updating the package is not enough on its own, because a running mail client or daemon keeps the old library in memory until it restarts.

2. If your distribution has no fix yet, be careful with untrusted keys and signatures. This is my reading of the trigger and not advice from the advisory, which offers no workaround. The bug needs GPGME to process attacker-supplied OpenPGP data. Until the package arrives, avoid importing keys from strangers in GPGME-based apps, and think about any service that verifies signatures or imports keys automatically.

3. Rebuild anything that links GPGME statically. The advisory is explicit: "For statically linked binaries remmeber to build them against GPGME 2.3.1." A system package update does not reach a static copy inside another binary. For the Ruby gpgme gem, the rebuild is an update to gem version 2.0.27. The section below has the details.

4. If you maintain a build that cannot move to 2.3.1, apply the patch. The advisory says the fix "likley applies cleanly even to very old versions". The patch was missing from the announcement email, according to a reply on the gnupg-devel list. It is commit 14499348 on the GitHub mirror of GPGME.

5. Self-managed GitLab: install the latest patch release. GitLab released 19.6.1, 19.5.8 and 19.4.10 on 20 November and says GitLab.com is already patched. Those three releases carry the GPGME patch. The GitLab section below explains how I confirmed that.

The Ruby gem builds its own copy

This one is easy to miss. The gpgme gem's build script prints a notice during installation: the gem "uses locally built versions of required C libraries, namely libgpg-error, libassuan, and gpgme." It downloads a GPGME source tarball, builds it with --disable-shared --enable-static, and links it into the gem.

When I first read the script on the gem's master branch, on 21 November, the pinned GPGME version was 2.0.0. The newest gem on RubyGems was 2.0.26, published in February 2026. So a default install of that gem carries a GPGME that predates the fix, and updating your system's GPGME does not change it.

A new gem release fixes that. I checked on 24 November. Version 2.0.27 was published on RubyGems on 23 November. The commit behind it is titled "Bump bundled gpgme to 2.3.1 to fix CVE-2026-129975", and the build script at the v2.0.27 tag pins GPGME 2.3.1. If your project uses the gem, update it to 2.0.27, for example with bundle update gpgme, then redeploy and restart the app. Gem versions up to 2.0.26 keep their old bundled copy. I have not installed 2.0.27 or tested it.

If you cannot update the gem yet, the build script itself documents an alternative, which is to link against the system library:

gem install gpgme -- --use-system-libraries

The script also reads a RUBY_GPGME_USE_SYSTEM_LIBRARIES environment variable for the same purpose. Either way, this helps only once the system library is the patched one. I have not tested the reinstall, and I did not check which GPGME each gem version before 2.0.26 pins.

GitLab

GitLab verifies commit signatures on the server, so a crafted key or signature can reach its GPGME from the outside. That is why it was the reporter. The Omnibus repository has a commit dated 18 November titled "Patch gpgme to fix double free in the gpg engine", with the changelog label "security".

When I first wrote this post I could not confirm which GitLab release carries that patch. The 19.6.1, 19.5.8 and 19.4.10 release notes list one security fix, a Ruby bug tracked as CVE-2026-132825, and do not mention GPGME. They still do not.

The Omnibus changelogs settle it. I read them on 23 November. The entries for 19.6.1, 19.5.8 and 19.4.10, all dated 19 November, each list two security changes: the Ruby update and a "Backport of 'Patch gpgme to fix double free in the gpg engine'". So if you run GitLab yourself, any of those three releases gives you both fixes. The release notes also say GitLab.com and GitLab Dedicated are already on a patched version.

How it was found and disclosed

  • 12 November: GitLab informs GnuPG. The advisory credits the discovery to Johan Carlsson.
  • 13 November: GnuPG opens its tracker entry, T8557, with a patch from the reporter attached.
  • 18 November: GnuPG notes that 2.3.1 is built and the announcement is planned for 25 November.
  • 20 November: the advisory goes out five days early. In its words: "due to the new Ruby2Shell bug GitLab had to update earlier and thus we also disclosed the GPGME bug".

Ruby2Shell is a separate bug in the Ruby interpreter, fixed in the GitLab releases named above. Its only link to GPGME is the timing.

One detail from the oss-security list is worth knowing. Todd Zullinger pointed out that Red Hat Enterprise Linux 9 has carried a fix for this double free for about five years. A Coverity scan flagged the code, and Red Hat added a patch to its own GPGME 1.15.1 package. I read that patch in the CentOS Stream 9 repository. It moves the same two assignments to the same place, with a comment saying it is there "to prevent memory leaks". According to Zullinger, the patch was never sent upstream and is not in earlier or later RHEL releases. (The first part of that has since been corrected by Red Hat. See the update at the end of this section.) I have not checked the other RHEL releases myself. Red Hat's own vulnerability data, published on 23 November, lists gpgme in RHEL 9 as affected, along with RHEL 7, 8 and 10. That does not sit easily with a five-year-old fix in RHEL 9, and I could not work out which is right. If you run RHEL, go by Red Hat's CVE page. Asked on the list whether GnuPG ever received it, Werner Koch replied on 22 November: "Not that I can remember." He said the finding may have slipped through because "it was mostly about memory leakage in error paths".

Update, 25 November: the patch was sent upstream in 2021. Michal Hlavinka of Red Hat wrote to the GnuPG developers' list on 24 November: "I was able to find out that patch was sent" to that list, "and probably went unnoticed." He links the message. I read it: a post of 19 July 2021 titled "[gpgme] Memory leaks fixes", offering fixes for "several memory leaks found by static code analyzers (mainly Coverity and Clang)" with the words "Please feel free to merge." So the earlier account, that Red Hat kept the fix to itself, was wrong. The fix was offered as a memory-leak cleanup and nobody picked it up.

Hlavinka also explains why only RHEL 9 has it. In his words, "It was found during rhel9 beta", and his "guess" is that it was applied at once to meet a deadline. Because it never landed upstream, Fedora did not carry it and RHEL 10 did not inherit it. He adds that at the time "it was a corner case double free, not a security issue". Red Hat's CVE data still listed RHEL 9 as affected on 25 November, so that contradiction is not resolved.

What is still unknown

  • Whether code execution is practical. GnuPG says it cannot be ruled out, and nobody has published exploit code. The data theft is better documented now. Red Hat's bug for the CVE, opened on 17 November and made public on 23 November, describes the chain used against GitLab: the freed buffer is handed to a live Ruby object, the attacker points that object at a key elsewhere in the process, and "the key bytes are returned in an ordinary HTTP response." The report says GitLab's Linux package runs Ruby on jemalloc, where "that reuse is deterministic", and that on other systems "glibc is not a safety net here". The diagram it refers to is not public, and the text does not say which key. Red Hat's own statement is more cautious about code execution: reliable exploitation "depends heavily on process heap layout and allocator behavior". On 25 November a second public repository carried the CVE's name and called itself a proof of concept. I read its files and did not run them. It triggers the bug inside its own small test program and prints a memory checker's report. It does not attack a real GPGME installation, and it shows no data theft and no code execution.
  • An official severity score. Partly answered. The CVE record was published on 23 November by Red Hat, with a CVSS 3.1 score of 8.1 and a severity of "Important". NVD's entry, created the same day, repeats Red Hat's score and is marked "Awaiting Analysis", so NVD has not scored it itself. SUSE publishes the same 8.1 and the same vector, which assumes a network attacker and high attack complexity. Red Hat calls its score "preliminary and subject to review".
  • Ubuntu, Fedora, SUSE and Red Hat fixes. Partly answered on 25 November. openSUSE Tumbleweed has a released fix. Fedora has security updates in testing for Fedora 43, 44 and 45, which you can install from the updates-testing repository before they reach stable. Still nothing released for Ubuntu, where every release is "Needs evaluation", for SUSE Linux Enterprise, where builds are in QA, for openSUSE Leap, for EPEL, or for RHEL 7 to 10, which Red Hat lists as affected with no fix available. Check your distribution's security page.
  • Debian testing. Still on 2.2.0-2 on 25 November, but the blocker is gone. Debian's package tracker no longer reports a missing riscv64 build, and gives the migration status of 2.3.1-1 as "Will attempt migration".

Answered since this post was first published: the GitLab releases that carry the patch (see the GitLab section), the status of Arch and Alpine (see the table), whether there is a CVE record with a score, and the Ruby gem, which bundles a fixed GPGME from version 2.0.27 (see the Ruby gem section).

I will update this post when the remaining answers arrive.

The short version

  • What it is: a double free in GPGME, the library programs use to drive gpg. It is tracked as CVE-2026-129975 and has been in the code since 2002.
  • How it is triggered: by an OpenPGP key with a crafted, very long user ID, reached through signature verification, key import or key listing.
  • How bad: GnuPG says data can be exfiltrated and code execution cannot be ruled out. There is no public exploit code, but a public Red Hat bug describes a key being read out of a GitLab web process. Red Hat and SUSE score it 8.1. NVD has not scored it itself.
  • Fixed in: GPGME 2.3.1 and 1.24.4, Gpg4win 5.1.2, Debian's bookworm and trixie security updates, Homebrew, Arch, Alpine 3.24 and version 2.0.27 of the Ruby gpgme gem. openSUSE Tumbleweed has it too. On 25 November Fedora 43, 44 and 45 had fixes in testing, Debian testing was still on 2.2.0, and Ubuntu, RHEL and SUSE Linux Enterprise had no released fix.
  • What to do: update the library, restart the programs that use it, and rebuild anything that links it statically. For the Ruby gpgme gem, that means updating to 2.0.27.
  • Not affected: the gpg command on its own, and git's local commit signing.

Frequently asked questions

Which GPGME versions fix CVE-2026-129975?

GPGME 2.3.1, announced on 20 November 2026. gnupg.org also lists a legacy release, GPGME 1.24.4, dated the same day. Version 2.3.0 was never published. Debian has backported the fix as 1.18.0-3+deb12u1 for bookworm and 1.24.2-3+deb13u1 for trixie, and Gpg4win 5.1.2 ships the fixed library for Windows.

Is this a bug in the gpg command itself?

No. The bug is in GPGME, the library that other programs use to drive gpg. The faulty code is the part of GPGME that reads the output gpg sends back. Running gpg by hand in a terminal does not go through that code. Programs that link GPGME do.

Does this affect signing git commits with GPG?

Not on your own machine, as far as git itself goes. Git's documentation says it runs the gpg program directly to sign and verify, so plain git does not use GPGME. Services that verify signatures for you can be affected. GitLab reported this bug and has patched the GPGME it bundles.

Is CVE-2026-129975 a remote code execution bug?

The advisory calls it a double free that can be used to exfiltrate data, and says remote code execution "can't be ruled out". No exploit code has been published and I found no reports of attacks as of 24 November 2026. A Red Hat bug report made public that day describes a chain that reads a key out of a GitLab web process. What an attacker can do depends on the program that links the library.

Do I need to restart anything after updating GPGME?

Yes. A process that loaded the old shared library keeps using it until it restarts. Restart mail clients, desktop apps and services that use GPGME after the package update. Programs that link GPGME statically need a rebuild against 2.3.1, because a package update does not change them.

Get The Shipping Forecast

One email on Thursdays: what I tested and wrote that week, plus one tool worth your time.

You'll get a confirmation email first. Unsubscribe in one click. Privacy policy.