Dev.to Security 🔐 Cybersecurity 👁 0 📖 10 min read

gpg --version says 2.4.4. Your GPGME library is still 1.18.0. I built a check that reads the right number.

On 20 November 2026, Werner Koch published a GnuPG advisory for CVE-2026-129975 (GnuPG tracker T8557): a double free in GPGME, the C library that sits under mail clients, Gpg4win, GnuPG Desktop, Samba, Flatpak, and most

gpg --version says 2.4.4. Your GPGME library is still 1.18.0. I built a check that reads the right number.

On 20 November 2026, Werner Koch published a GnuPG advisory for CVE-2026-129975 (GnuPG tracker T8557): a double free in GPGME, the C library that sits under mail clients, Gpg4win, GnuPG Desktop, Samba, Flatpak, and most of the software that verifies OpenPGP signatures for you. The project calls it a "critical security bug" and says "an immediate update is highly suggested". The fixed builds are GPGME 2.3.1 (19/11/2026) and legacy 1.24.4 (20/11/2026); Gpg4win 5.1.2 bundles the fix. GnuPG published no CVSS for this CVE. As of 22 November 2026 there are no reports of exploitation in the wild, and the CVE is not in the CISA KEV catalog (2026-11-20 catalog version).

The bug is 24 years old. It was introduced in July 2002 and first shipped in GPGME 0.3.9 in August 2002. Two internal functions, read_status() and read_colon_line() in src/engine-gpg.c, start with a 1024-byte buffer and realloc on growth when handling an OpenPGP key with a crafted very long user ID - but they write the new pointer back to the context object only at the end of the function. An early return (a read error or another event) leaves the context holding the freed pointer, which is freed a second time when the context is released. Other allocations in between mean the allocator's double-free checks may not fire. The advisory says the double free "can be used [to] exfiltrate data from applications by sending for example signed data", and that remote code execution "can't be ruled out".

It was discovered by Johan Carlsson and reported via GitLab on 12/11/2026. Coordinated disclosure was set for 25/11/2026, then pulled forward to 20/11 because GitLab had to update early due to Ruby2Shell - the sibling flaw disclosed two days earlier. The fix commit (14499348, 14/11) moves the write-back to right after the realloc. A regression on 15/11 meant 2.3.0 was tagged on 18/11 but never publicly available; 2.3.1 is the first public fixed release.

Here is the part that should worry every operator: the flaw is in a C library under the app, not in any package the app owns. A version-only CVE match says "vulnerable" on a box whose only GPGME consumer is a local tool that never sees untrusted keys, and says nothing about a static copy that no package update can fix. And the obvious check reads the wrong number: gpg --version reports the gpg engine version, not the GPGME library version. On the machine I built this on, gpg is 2.4.4 and fine; libgpgme is 1.18.0 and not. pkg-config --modversion gpgme fails outright here because no .pc file ships. Exposure needs three conditions together, on the install that actually runs:

  1. An affected GPGME version (everything before 2.3.0; the legacy branch is fixed at 1.24.4).
  2. A linkage type that matters: shared library or DLL covered by one update, or a static copy that needs a vendor rebuild.
  3. An exposure context: untrusted keys or signed data reaching the library through a linked app.

I built gpgme2shell to answer one question per install: do the conditions line up here? It is a zero-dependency TypeScript CLI (Node 20+). Everything runs locally; no network, no CVE database, no exploit code, and it never reads a key. The only commands it ever runs are version queries (pkg-config, dpkg -l, ldconfig -p, gpg --version for the engine line, printed separately and never mistaken for the library version).

gpgme2shell demo

What it does

gpgme2shell scan [--dirs <dir>...] [--app <dir>] [--no-system] [--json]
gpgme2shell check <version-or-dir> [--linkage shared|static|dll] [--exposure trusted|untrusted|unknown] [--distro <key>] [--json]
gpgme2shell config-scan <app-dir> [--json]
gpgme2shell playbook [--json]
gpgme2shell explain <topic>
gpgme2shell init
  • scan finds every GPGME copy on the host (pkg-config, gpgme-config, dpkg, rpm, ldconfig, lib dirs), reads each version, detects linkage, and verdicts each install: EXPOSED, AT-RISK, SAFE or UNKNOWN, with the deciding condition printed per install. It also prints a one-line Ghostscript secondary note (see below).
  • check verdicts one install, directory, or bare version string in detail: version against the fixed builds (upstream 2.3.1, legacy 1.24.4, pinned distro backports), linkage, and exposure.
  • config-scan reads an app directory (ldd evidence, Flatpak manifests, build files, plus the operator's own gpgme2shell.config.json) and lists which apps link GPGME and the exposure the operator declared.
  • playbook prints the first-hour response plan for this disclosure: upgrade path per platform, the static-rebuild note, verification steps, and what not to do.
  • explain prints the CVE facts, the verdict rules, and the sources, with the date they were checked (22 November 2026).
  • init writes a gpgme2shell.config.json for scan dirs, app dir, and exposure/linkage declarations.

Exit codes: 0 SAFE / no EXPOSED, 1 EXPOSED or AT-RISK, 2 UNKNOWN / usage error. scan is built to be a CI gate: fail the build while any install in the fleet is EXPOSED.

Install from source only - the gpgme2shell package is not published to npm yet (the name returned 404 when checked on 22 November 2026):

git clone https://github.com/techdevfun/gpgme2shell.git
cd gpgme2shell
npm install
npm run build
node dist/cli.js scan

Example output (real CLI output from the demo transcript, demo/transcript.txt; the scan is a live scan of the build machine, Ubuntu 24.04, 22 November 2026; the mail client is a representative fixture from examples/app-mail-client):

$ gpgme2shell scan
gpgme2shell 0.1.0 - scan (checked 2026-11-22, CVE-2026-129975)
engine: gpg 2.4.4 (the ENGINE version - never the library version)
os: ubuntu 24.04

install 1: 1.18.0-4.1ubuntu4
  source: dpkg libgpgme11t64:amd64 -> 1.18.0-4.1ubuntu4
  library: /lib/x86_64-linux-gnu/libgpgme.so.11
  library: /usr/lib/x86_64-linux-gnu/libgpgme.so.11.27.0
  verdict: AT-RISK (version 1.18.0-4.1ubuntu4, linkage shared, exposure unknown)
  - Ubuntu (all releases) has no published fix for CVE-2026-129975 yet (no CVE page and no security notice yet (2026-11-21))
  deciding: Ubuntu (all releases) has no published fix yet

summary: EXPOSED 0, AT-RISK 1, SAFE 0, UNKNOWN 0 - 1 install(s) checked
ghostscript: not installed (secondary signal - see explain ghostscript)

Exposure conditions only. This tool does not prove exploitability and never sends a crafted key. A SAFE verdict means these three conditions do not line up - not that the host is safe from every GPGME flaw.
exit: 1

$ gpgme2shell check 2.3.1
check: 2.3.1 (version string)
verdict: SAFE (version 2.3.1, linkage shared, exposure unknown)
  - 2.3.1 is at or above the upstream fixed build 2.3.1
  deciding: fixed upstream build 2.3.1

$ gpgme2shell config-scan examples/app-mail-client
linked apps: 1
  - ldd.txt: ldd.txt: libgpgme.so.11 => /lib/x86_64-linux-gnu/libgpgme.so.11 (0x00007f1234567000)
exposure: untrusted (gpgme2shell.config.json)
linkage: shared (gpgme2shell.config.json)
notes: Representative fixture: a mail client that verifies signed mail from untrusted senders.
verdict: EXPOSED
exit: 1

The engine-vs-library trap is the reason the tool prints the engine version on its own line and never uses it as the library version: 2.4.4 looks current, 1.18.0 is the one that matters. A check that reads gpg --version and stops there reports a false SAFE on exactly the host this tool was built on.

The distros are the slow lane

The fix has to come through each distro's package, so the tool pins the published backports with dates (checked 22 November 2026):

Distro Fixed build Advisory
Debian trixie 1.24.2-3+deb13u1 DSA-6646-1 (20/11)
Debian bookworm 1.18.0-3+deb12u1 DLA-4924-1 (20/11)
Debian sid 2.3.1-1 -
Alpine 3.24 2.3.1-r0 -
Ubuntu (all releases) None yet No CVE page and no security notice as of 21/11 17:30 UTC (Ubuntu CVE API returns "does not exist" for this ID)

Ubuntu is the one to watch: every release has no published fix yet. gpgme2shell check 1.18.0-4.1ubuntu4 --distro ubuntu answers AT-RISK and says so plainly. If you run Ubuntu, treat those installs as at-risk until the distro ships a fix. A distro version suffix the tool does not recognise is UNKNOWN-or-worse, never SAFE, unless the distro fixed build is in the pinned table.

A secondary signal rides along, one line only: Ghostscript before 10.08.0 has a -dSAFER bypass (CVE-2026-125396, CVSS 4.0 8.5 from VulnCheck), fixed upstream in 10.08.0 (08/09/2026); Debian DLA-4914-1 and DSA-6516-1, Ubuntu USN-8949-1. scan reports the installed Ghostscript version if gs is present, else "not installed". It never drives the verdict - this is the fifth link of the *2Shell chain (PHP2Shell, Java4Shell, NGINX2Shell, Ruby2Shell), and the Ghostscript note is there so one scan answers both questions on the same host.

How it compares

Tool What it checks Linkage + exposure? Local, no network? Fleet scan + CI gate?
Manual commands (pkg-config --modversion gpgme, dpkg -l 'libgpgme*', rpm -q gpgme, gpgme-config --version, ldd on the app binary, then grep gpgme) - documented by fosslinux.com and dugganusa.com, both read live 22/11/2026 The version, per command No (three commands that disagree; pkg-config fails when no .pc ships, dpkg gives the package version, not the loaded library, ldd is per binary) Yes No
GnuPG's own gpgme_op_query_swdb (GPGME manual 7.7.3, read live 22/11/2026) Installed version vs GnuPG's online software-version database No (version only) No (needs network + a C program to call it) No
gpgme_check_version(NULL) (GPGME manual, Library Version Check) Version a running program loaded No Yes No
Trivy / Grype Installed package / image versions vs a CVE database No (version only; a static link is invisible to a package scan, and they cannot say which app on the host is actually exposed) No (needs DB) Yes, for dependencies
Distro security trackers (Debian security-tracker, Ubuntu CVE API) The fixed build per distro No (a web page per CVE, not a host check) n/a No
gpgme2shell Installed GPGME version vs fixed builds incl. pinned distro backports, linkage, exposure context Yes, from version sources + config evidence Yes Yes, exit codes + --json

No version-only tool can tell you whether the app on that host is actually exposed, and no manual command gives you a verdict, a linkage check, and a CI gate in one run. gpgme2shell is the installable, zero-dependency CLI that runs all the manual commands, reconciles them, and names the deciding condition. Its fixed-build table is pinned from the distro trackers with dates, so it is only as fresh as its last update - see Honest limits.

Where rivals beat us, honestly: The manual commands and the distro trackers are the source of truth for the fixed build - gpgme2shell only pins what they publish, and a distro that ships a fix after 22/11/2026 makes this tool's table stale until it is updated. Trivy and Grype cover the whole dependency tree and every CVE at once; gpgme2shell checks only CVE-2026-129975 for its verdict (Ghostscript CVE-2026-125396 is a one-line secondary note, not a verdict), and once their databases carry CVE-2026-129975 they will flag the libgpgme package in images. GnuPG's query_swdb checks the live upstream database; gpgme2shell is offline by design and never fetches a newer fixed build. gpgme2shell never proves exploitability - it proves exposure conditions, and says so on every output. If you need broad CVE coverage or a live upstream version check, use a scanner or query_swdb. If you need to know whether this GPGME install on this host, linked by this app, is actually exposed to CVE-2026-129975, use this tool.

Honest limits

  • Only CVE-2026-129975 drives verdicts. Ghostscript CVE-2026-125396 is a one-line secondary note, not a verdict. A SAFE verdict means these three conditions do not line up, not that the host is safe from every GPGME flaw.
  • The fixed-build table is pinned as of 22 November 2026. A distro that ships a fix after that date (Ubuntu is the open case) makes the table stale until the tool is updated - the tool says "no published fix yet" with the check date, it never invents one.
  • Ubuntu staleness window: the Ubuntu "no fix yet" verdict is dated 21/11/2026 17:30 UTC. Check the Ubuntu CVE tracker before acting on a verdict more than a day old.
  • No end-to-end run on a real Debian host: the live checks in this release ran on Ubuntu 24.04, with Debian backports verified only against the published advisory values (DSA-6646-1, DLA-4924-1). A Debian-host e2e run is on the roadmap.
  • GPGME 2.3.0 is reported UNKNOWN: it was tagged but never publicly available, so it is not a fixed build you can install.
  • A static link needs a vendor rebuild. The tool can name the static copy and its exposure, but no package update fixes it - the playbook says so.
  • init --help is a known minor wart in 0.1.0: it writes gpgme2shell.config.json instead of showing help (the init command takes no arguments). Use bare gpgme2shell init, or gpgme2shell --help for usage. Fixing per-command help flags is on the roadmap.
  • An EXPOSED verdict is runtime exposure, not proof of exploitability. Your app may never receive the crafted long user ID. The tool never claims otherwise.

The code is on GitHub: techdevfun/gpgme2shell. If you run anything that verifies OpenPGP signatures - a mail client, Gpg4win, Samba, Flatpak - run gpgme2shell scan and see whether the conditions line up on your hosts before you trust the engine version number again.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.