CVE-2026-24881 is a high severity stack buffer overflow (CVSS 8.1) in gpg-agent, reached through a crafted S/MIME message with an oversized wrapped session key. It can crash the agent and may allow code execution. The fix is GnuPG 2.5.17 for GnuPG and Gpg4win 5.0.1 for Windows users.
What's affected
The GnuPG team's advisory, quoted in an oss-security post, lists the exact releases:
- GnuPG 2.5.13, 2.5.14, 2.5.15 and 2.5.16.
- Gpg4win 5.0.0, plus the 5.0.0 beta builds 395, 476 and 479.
- Not affected: all other versions, according to the advisory.
The fixed versions are GnuPG 2.5.17 and Gpg4win 5.0.1. The advisory says the report was received on 18 January 2026 and the fixed versions came out on 27 January 2026.
The same release also fixed two other bugs the post describes as security relevant. One is a stack overflow in the TPM2 daemon when it handles a decrypt request, and the other is a null pointer dereference on an overlong signature packet. They have separate tracker entries, so read the release notes to judge your own risk if you keep keys in a TPM.
How to check if you're exposed
Check the installed version.
gpg --version
gpgsm --version
On Windows, open the Gpg4win About dialog and look for 5.0.0 or a 5.0.0 beta. On Linux, ask your package manager which version it installed, and check whether your distribution has backported the fix without changing the upstream version number. Red Hat's tracker for this CVE is a good place to confirm the status of an enterprise build.
Also ask where S/MIME is in play. The advisory ties the bug to the CMS path, which means the gpgsm component. If you never use S/MIME or CMS, your exposure is lower, though you should still update.
What to do now
- Update GnuPG to 2.5.17 or later, or Gpg4win to 5.0.1 or later.
- If you cannot update right away, remove the gpgsm binary (gpgsm.exe on Windows). The advisory says this stops the bug from being triggered remotely.
- Check mail gateways, build servers and signing hosts, because they often run GnuPG unattended and nobody thinks of them as desktops.
- If your distribution ships its own GnuPG packages, apply its update rather than replacing the binary yourself.
- Rebuild container images that install GnuPG so they pick up the fixed package.
Why it matters
Mail and signing tools process data from strangers. Here the input is an S/MIME enveloped message, and the weakness is a copy of an attacker supplied key into a fixed stack buffer. The class is CWE-121 (Stack-based Buffer Overflow). A stack overflow in a long running agent that holds key material is worth treating as serious even when the practical outcome is a crash.
The advisory credits OpenAI Security Research with the report. It describes the denial of service as easy, and says the memory corruption could very likely be used to mount remote code execution. That is the vendor's assessment, not a report of attacks.
The practical lesson is about the temporary fix. Removing a component you do not use is a legitimate stopgap, and it is worth writing down in your runbook for the next time.
Quick check
Is CVE-2026-24881 exploited in the wild?
The record does not mark it as a CISA Known Exploited Vulnerability, and the advisory does not report exploitation.
Does it affect every GnuPG version?
No. The advisory says only GnuPG 2.5.13 through 2.5.16 and the listed Gpg4win 5.0.0 builds are affected.
What if I do not use S/MIME?
The bug is in the CMS handling, which is the S/MIME path. Removing gpgsm is the advisory's workaround. You should still update to the fixed release.
Sources
Last reviewed: 19 October 2026.