Dev News Daily ENDE

GPGME 2.3.1 fixes a double free triggered by an OpenPGP key with a very long user ID

GnuPG announced on 20 November a new release of GPGME, version 2.3.1, which fixes what the project calls a critical security bug present in all prior versions. Tracked as CVE-2026-129975 and internally as T8557, the flaw is a double free that can be triggered with an OpenPGP key carrying a crafted, very long user ID. According to the advisory, it can be used to exfiltrate data from applications, for example by sending signed data, and turning it into remote code execution "can't be ruled out".

The root cause sits in two internal functions that read status lines and key listings from gpg. They start with a 1,024-byte buffer and reallocate it when more space is needed, but the new pointer is written back to the context object only at the end of the function. If the function returns early, for example on a read error, the context keeps the stale pointer, and the memory is freed a second time when the context is released. The advisory notes that other allocations in between mean the usual double-free checks in memory allocators may not fire.

GPGME is used by Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpak. Gpg4win 5.1.2 ships the fixed library. Statically linked binaries have to be rebuilt against 2.3.1, and for versions that cannot be updated the project attaches a patch it says will likely apply to very old releases too. The bug was found by Johan Carlsson and reported by GitLab on 12 November; disclosure was planned for 25 November and brought forward because GitLab had to ship an earlier update for the Ruby2Shell bug.

GPGME 2.3.1 fixes a double free triggered by an OpenPGP key with a very long user ID
GPGME 2.3.1 fixes a double free triggered by an OpenPGP key with a very long user ID — Dev News Daily

Why it matters

The fix lives in a shared library, so updating gpg itself is not enough: every program that embeds GPGME - and every static build of one - carries the bug until it is rebuilt or relinked.