GPGME is the library you never install on purpose. It is what a program links when it wants to drive gpg without reimplementing OpenPGP, and part of its job is reading back everything gpg says about the data it just handled.
On 20 November the GnuPG project published CVE-2026-129975, a double free in read_status() and read_colon_line(), the two functions in src/engine-gpg.c that parse that output. A crafted OpenPGP key carrying a very long user ID is enough to trigger it. The fixed releases are GPGME 2.3.1 and, on the legacy branch, 1.24.4.
🔑 The Crypto Was Never the Problem
Read the scope before the severity. The page that put this in front of me today is titled “RCE in Gnupg”, and the affected component is not GnuPG. It is GPGME, the C library applications use to call GnuPG. On this Fedora box, /usr/bin/gpg and /usr/bin/gpgv do not link libgpgme.so.45 at all, which is the mechanical way to see that the CLI and the distro’s own package verification sit outside this path.
What GPGME does is spawn gpg and then read two text streams back: the status lines prefixed [GNUPG:], and the colon-format key listings. Both carry the user ID verbatim. That design is reasonable and it is the only design that works, but it places a parser of attacker-supplied strings between the crypto engine and the application. The parse has to happen before anything can decide the key is untrustworthy.
🧵 A Local Pointer That Outlives Its Block
The vulnerable code is a commit-at-the-end pattern. This is GPGME 1.24.3, src/engine-gpg.c, starting at line 1452:
size_t bufsize = gpg->status.bufsize;
char *buffer = gpg->status.buffer;
size_t readpos = gpg->status.readpos;
...
if (bufsize - readpos < 256)
{
bufsize += 1024;
buffer = realloc (buffer, bufsize);
if (!buffer)
return gpg_error_from_syserror ();
}
...
/* Update the gpg object. */
gpg->status.bufsize = bufsize;
gpg->status.buffer = buffer;
gpg->status.readpos = readpos;
return 0;
The buffer is allocated at 1024 bytes when the engine is created, and grows by another 1024 whenever fewer than 256 bytes remain ahead of the read position.
The intent is defensible. Reading a pipe means you may catch half a line, so you hold the size and the read position in locals and commit them once you have a consistent state. That is the right discipline for a counter.
It is the wrong discipline for a pointer that owns memory. realloc() may move the block and free the old one, and from that moment the local buffer is the only valid reference. The commit that would publish it sits at the bottom of the function, and between the grow and the bottom there are five ways out: a failed read at line 1470, the EOF callback at 1487, the monitor callback at 1520, the status handler at 1555, and a failed strdup() at 1534. None of them touch gpg->status.buffer. The engine keeps the stale pointer, the new block leaks, and engine_release() later frees the stale one:
if (gpg->status.buffer)
free (gpg->status.buffer);
That is the second free. read_colon_line() at line 1602 repeats the pattern for the machine-readable listing, down to the 1024-byte start.
The part I keep coming back to is the age. Werner Koch’s fix says it closes a bug introduced by commit f12433c1e476, and the GitHub mirror dates that commit to 28 July 2002, by Marcus Brinkmann. I read the changelog. It is the change that made GPGME flush the inbound pipe before invoking a command handler and export status codes to the application. The reporting layer did not acquire this bug over twenty-four years of patches. It was written with it, in the commit that created the layer.
💥 The Allocator Probably Won’t Tell You
My first instinct with a double free is that glibc will shout about it, which turns a memory bug into a noisy crash and a cheap detection.
The advisory tells you that will not reliably happen: “Due to other allocations in between the common double free checks of memory allocators may not be triggered.” If the freed block gets recycled before the stale pointer is freed again, the second free() can land on memory that looks perfectly valid to the allocator. So the expected signature is not a clean abort. It is silent.
GnuPG says the double free can be used to exfiltrate data by sending signed data, and that mounting a remote code execution attack “can’t be ruled out”. It does not publish a demonstration of either, and I found nobody else with one. The CVE record itself does not exist yet: the MITRE API returns CVE_RECORD_DNE for the ID, NVD returns zero results, OSV has nothing, and CISA’s KEV catalog, which I grepped, does not list it. GnuPG published no CVSS score, while third-party aggregator pages are already printing 9.8.
So the fair position is that this is critical by the vendor’s own words and unproven in the specific.
🎯 Two Things Have to Go Wrong at Once
Four conditions, and the fourth is why this is still theoretical:
- a program links or embeds GPGME before 2.3.1 on the 2.x branch, or before 1.24.4 on 1.x
- that program processes OpenPGP data someone else supplies
- the data produces a status or colon line long enough to force the grow, which given the 1024-byte start and the 256-byte threshold means a single line past roughly 768 bytes arriving before its newline
- an early exit happens in that same call, after the grow succeeded
The last condition does not require your application to misbehave. The status handler is GPGME’s own code, and it returns errors on input it did not expect. _gpgme_verify_status_handler() returns GPG_ERR_BAD_DATA on a GPGME_STATUS_UNEXPECTED when no signature is in flight, and GPG_ERR_INV_ENGINE on a VALIDSIG with no signature to attach it to. A status sequence arriving in the wrong order is enough to unwind with the pointer still uncommitted.
That makes the craft two problems at once: a user ID long enough to grow the buffer, and a status stream ordered to make the handler bail. No signature from the victim is needed, only a key that someone will parse.
🛠️ Finding Out Whether It’s Your Problem
Start with the version, because it decides the branch you are on:
pkg-config --modversion gpgme || gpgme-config --version
dpkg-query -W -f='${Package} ${Version}\n' | grep -i gpgme
rpm -qa | grep -i gpgme
Then the part people get wrong. On this machine the installed package is gpgme-2.0.1-6.fc45, which is affected, and nothing in any application manifest I maintain mentions it. rpm -q --whatrequires 'libgpgme.so.45()(64bit)' returns podman, skopeo, flatpak, flatpak-libs, ostree-libs, wget2 and volume_key-libs. The tools that check signatures on images I pull link the parser in question, and I have never once thought about that dependency.
Statically linked and bundled copies are a separate problem, because updating the system library does not reach them; the application has to be rebuilt. For Flatpak, the library comes from the runtime rather than your app’s manifest, so bumping your own dependencies accomplishes nothing.
Where the vendors are: Debian shipped DSA-6646-1 for trixie (1.24.2-3+deb13u1) and DLA-4924-1 for bookworm (1.18.0-3+deb12u1), with sid at 2.3.1-1. Fedora 45, as of this morning, still offers only 2.0.1-6.fc45, so on this box there is nothing to upgrade to yet and the advisory’s attached patch is the interim move.
One detail for anyone backporting: the two fixed branches are not the same diff. 1.24.4 moves the two assignments up to where realloc() succeeds, matching the patch posted to oss-security, and leaves the early returns as they were. 2.3.1 does that and also funnels every exit through a leave: label, so the read position is committed on the error path too. Both close the double free. If you are carrying the patch to an old tree, it is worth knowing which behaviour you are taking.
🧠 Final Thoughts
Twenty-four years is the number that stays with me, and not because nobody looked at this file. The happy path is correct. The buffer grows, the data parses, the pointer is committed, and every status line anyone has ever tested works. The bug exists only on an interleaving: a grow and an error inside the same call. That is the shape of defect that static review tends to miss and that a fuzzer finds in an afternoon, and it sat in a parser that most mail clients depend on.
The rule I am taking out of it is narrow. If a struct field owns a heap pointer, assign it the moment the move succeeds. Deferring the assignment to the end of the function is fine for a size, a position, or a flags word, because a lost update there costs you a retry. For the pointer, it costs you the block.
Thanks for reading.