# CVE-2026-24881: GnuPG stack buffer overflow in gpg-agent S/MIME handling

Source: https://junglewise.ai/threats/cve-2026-24881-gnupg-stack-buffer-overflow-in-gpg-agent-s-mime-handling  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-27. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-24881 · Severity: high · CVSS 8.1 · Published 2026-01-27

GnuPG is a widely used encryption suite for securing emails and files. A vulnerability in its S/MIME handling allows an attacker to send a specially crafted encrypted message that crashes the background service responsible for managing private keys. In some scenarios, this could allow an attacker to gain unauthorized control over the system or disrupt secure communications.

Technologies: [GnuPG](https://junglewise.ai/threats/technologies/gnupg). Vendors: [GnuPG](https://junglewise.ai/threats/vendors/gnupg).

## Quick answers

**Is CVE-2026-24881 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-24881 being exploited in the wild.

**How severe is CVE-2026-24881?** High severity, with a CVSS score of 8.1, published 27 January 2026.

**Which products and versions are affected?** GnuPG 2.5.13 to 2.5.16; Gpg4win 5.0.0.

**Is there a fix for CVE-2026-24881?** A patch was published on 2026-01-27: GnuPG 2.5.17 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-24881 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-24881?** Check whether you run GnuPG or Gpg4win at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A stack-based buffer overflow exists in gpg-agent's agent_kem_decrypt() function when processing PKDECRYPT --kem=CMS requests. The vulnerability is caused by trusting an attacker-supplied length for a wrapped session key, which is then used to perform an AES Key Wrap unwrap into a fixed 256-byte stack buffer. Because libgcrypt's AES-KW implementation performs a memmove of the ciphertext into the output buffer before verifying integrity, the overflow occurs even if the message is otherwise invalid. This affects GnuPG versions 2.5.13 through 2.5.16 and was fixed in version 2.5.17. An attacker can trigger this remotely by sending a malicious S/MIME message to a user.

## Affected products

- GnuPG GnuPG 2.5.13 to 2.5.16
- Gpg4win Gpg4win 5.0.0

## Timeline

- 2026-01-18: disclosed: Reported to GnuPG by OpenAI Security Research
- 2026-01-27: patched: GnuPG 2.5.17 released
- 2026-01-27: advisory

## References

- [https://dev.gnupg.org/T8044](https://dev.gnupg.org/T8044)
- [https://www.openwall.com/lists/oss-security/2026/01/27/8](https://www.openwall.com/lists/oss-security/2026/01/27/8)
- [https://access.redhat.com/security/cve/CVE-2026-24881](https://access.redhat.com/security/cve/CVE-2026-24881)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2433480](https://bugzilla.redhat.com/show_bug.cgi?id=2433480)
- [https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-24881.json](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-24881.json)

## Related threats

- [GnuPG gpgsm improper validation of AES-GCM tag length in CMS](https://junglewise.ai/threats/cve-2026-57062-gnupg-gpgsm-improper-validation-of-aes-gcm-tag-length-in-cms)
- [GnuPG stack overflow in tpm2daemon PKDECRYPT handling](https://junglewise.ai/threats/cve-2026-24882-gnupg-stack-overflow-in-tpm2daemon-pkdecrypt-handling)
- [In GnuPG before 2.4.9, armor_filter in g10/armor.c has two increments of an index variable where one is intended…](https://junglewise.ai/threats/cve-2025-68973-in-gnupg-before-2-4-9-armor-filter-in-g10-armor-c-has-two)
- [In GnuPG through 2.4.8, if a signed message has \f at the end of a plaintext line, an adversary can construct a…](https://junglewise.ai/threats/cve-2025-68972-in-gnupg-through-2-4-8-if-a-signed-message-has-f-at-the-end-of-a)
