GPGME 2.3.1 fixes critical double-free in OpenPGP key parsing
A crafted, very long user ID can make the library free the same memory twice, with data theft possible and remote code execution not ruled out.
GnuPG has released GPGME 2.3.1 to fix a critical double-free, CVE-2026-129975 (internal id T8557), present in every earlier version of the library that most OpenPGP-using applications rely on.
Werner Koch, announcing the release, said a specially crafted OpenPGP key with a very long user ID can trigger the bug. The resulting double-free can be used to pull data out of an application, for example by sending it signed data. GnuPG says remote code execution "can't be ruled out" and that an immediate update is highly suggested.
The flaw is in how GPGME reads status lines and key listings from GnuPG. Those readers start with a modest buffer and grow it when a long user ID needs more space. If the read then fails early, the library context is left holding a pointer to memory that has already been freed. When the context is later released, that memory is freed again. Allocations in between can hide the mistake from the usual double-free checks in memory allocators.
Johan Carlsson discovered the bug. GitLab told the GnuPG project on 12 November 2026. A coordinated disclosure had been set for 25 November, but GitLab had to ship an earlier update because of the separate Ruby2Shell flaw, so GnuPG disclosed this issue on 20 November as well.
Anything linked against GPGME before this fix is affected, whether the library is shared, shipped as a DLL, or built in statically. That includes Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba, and Flatpak. Updated Gpg4win, GnuPG Desktop, and GnuPG VS-Desktop builds that use the fixed library were released alongside 2.3.1. Statically linked programs need to be rebuilt.