GnuPG Fixes Critical Double-Free in GPGME

November 21, 2026, morning

The GnuPG project released GPGME 2.3.1 on November 20, 2026, fixing a critical security bug tracked as T8557 and CVE-2026-129975. The vulnerability exists in every prior version of GPGME and could allow data exfiltration or even remote code execution.

The Bug

The root cause is in two internal GPGME functions that read status lines and key listings from gpg. A buffer of 1024 bytes is initially allocated and reallocated when more space is needed. The problem: when reallocation happens, the new pointer is used inside the function but only written back to the context object at the end. If the function returns early, due to a read error or other event, the context keeps a stale pointer to already-freed memory. When the context is later released, that memory gets freed a second time.

The trigger is surprisingly simple. An OpenPGP key containing a crafted very long user id is enough to set this off. Because other allocations happen between the two frees, standard double-free checks in memory allocators may not catch it.

Impact

Anything using GPGME prior to 2.3.1 is affected. The advisory lists Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba, and Flatpak. That is a long list of software that handles untrusted input from arbitrary keys and signatures.

The attacker does not need to compromise a key server. They just need a victim to import or process a crafted key. Sending signed data to an affected application could be enough to exfiltrate data. RCE has not been confirmed but cannot be ruled out.

Fix

Update to GPGME 2.3.1. Gpg4win 5.1.2 is also available for Windows users. A patch is provided for systems that cannot upgrade. The fix was coordinated with GitLab, which had to move up its disclosure due to a separate Ruby2Shell bug.

Discovered by Johan Carlsson, reported via GitLab on November 12, 2026. Original disclosure planned for November 25 but moved to November 20.

Sources:

[1] GnuPG Security Advisory T8557, CVE-2026-129975
[2] GnuPG Download Page
[3] GPGME 2.3.1 Release Info