Critical GPGME Flaw Lets a Booby-Trapped OpenPGP Key Threaten Apps That Use GnuPG
The GnuPG project has warned of a critical memory flaw in GPGME, the standard library that programs use to work with GnuPG. The bug, tracked as CVE-2026-129975, can be triggered by a malicious OpenPGP key with an unusually long user ID. The project says it could be used to steal data from affected applications and has released fixed versions.
The flaw affects all software that uses GPGME before version 2.3.0, whether the library is loaded as a shared library, a Windows DLL, or built directly into the program. The project's examples include most mail clients, many XMPP clients, Samba, and its own Gpg4win, GnuPG Desktop and GnuPG VS-Desktop packages. No attacks exploiting the flaw have been reported, but the project notes that remote code execution cannot be ruled out.
Technically, the problem is a double free, where the same memory is released twice. It sits in two routines, read_status() and read_colon_line(), which read status lines and key listings returned by GnuPG. When input runs long, the routines move data to a larger buffer but record the new address only if they finish without errors. An error in between leaves a pointer to memory that was already freed, and cleanup then frees it again.
The advisory's example path to the bug is signed data sent to an application. It does not say which programs pass such material to the library without a manual key import. Johan Carlsson found the flaw and GitLab reported it to the project last week. Disclosure had been planned for November 25 but was brought forward because the Ruby2Shell bug forced the company to update earlier. The fixed version is GPGME 2.3.1, released this week; a version 2.3.0 was never publicly available. The advisory offers no interim workaround for software that cannot yet be updated.
Why it matters
Many businesses will not know they depend on GPGME because it is bundled inside mail clients, Samba and other tools, so patching cannot rely on a single product list. The usual assumption that a public key is harmless data until a user trusts it is broken: a crafted key or signed message may reach vulnerable code before any manual decision. With no workaround offered, exposure persists until each vendor ships an update.
What to do
- Update Gpg4win, GnuPG Desktop and GnuPG VS-Desktop to builds that include GPGME 2.3.1.
- Inventory mail clients, XMPP clients and Samba servers that use GPGME and check vendors for fixed releases.
- Treat any GPGME version before 2.3.1 as vulnerable, noting that 2.3.0 was never publicly released.
- Monitor for unexpected crashes in mail or chat clients after they handle signed messages or unknown keys.