FreeBSD VuXML: Documenting security issues in FreeBSD and the FreeBSD Ports Collection

gpgme -- double free vulnerability

Affected packages
gpgme < 2.3.0

Details

VuXML ID 9d113e97-e6db-11f1-8ead-93299b7f89e8
Discovery 2026-11-20
Entry 2026-11-22

GnuPG reports:

By using an OpenPGP key containing a crafted very long user id it is possible to trigger a double free. This double free can be used exfiltrate data from applications by sending for example signed data. Exploiting this bug to mount an Remote Code Execution attack (RCE) can't be ruled out.

The root cause for this bug are two GPGME internal functions to read the status lines and key listings from gpg. Initially a buffer of 1024 bytes is allocated which is reallocated if more space is required. When reallocating the pointer to the new buffer, it is used by the function, but it is only assigned back to the context object at the end of the function. Thus if the function returns early due to a read error or other events, the context is not updated and keeps the stale pointer to the freed memory. Eventually, the context is released and the memory is freed a second time. Due to other allocations in between the common double free checks of memory allocators may not be triggered.

References

CVE Name CVE-2026-129975
URL https://lists.gnupg.org/pipermail/gnupg-announce/2026q4/000517.html
URL https://static.dev.gnupg.org/T8557