CVE-2026-24881: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-24881 is a stack-based buffer overflow vulnerability in GnuPG's gpg-agent component triggered during CMS (S/MIME) EnvelopedData message processing. A crafted message carrying an oversized wrapped session key causes a buffer overflow in the PKDECRYPT--kem=CMS handler, enabling denial of service and potentially remote code execution. Affected versions include GnuPG 2.5.13 through 2.5.16 and Gpg4win 5.0.0 (including beta releases); all other versions are unaffected. The vulnerability was reported by OpenAI Security Research on 2026-01-18 and fixed versions were released on 2026-01-27. It carries a CVSS v3.1 base score of 9.8 (Critical) (Feedly, oss-security).

Technical details

The root cause is a stack-based buffer overflow (CWE-121) in gpg-agent when processing the PKDECRYPT--kem=CMS command. When a CMS/S/MIME EnvelopedData message is received containing an oversized wrapped session key, the agent copies attacker-supplied data into a fixed-size stack buffer without validating the input length, resulting in memory corruption of adjacent stack memory. The attack vector is network-based, requires no authentication or user interaction, and is triggered simply by sending a crafted S/MIME message to a system using an affected GnuPG version. A proof-of-concept is publicly available at the GnuPG issue tracker (oss-security, GnuPG Tracker).

Impact

Successful exploitation can result in denial of service via application crash or, more critically, memory corruption that could be leveraged for remote code execution within the gpg-agent process. Given that gpg-agent handles private key operations and cryptographic material, a successful RCE could expose sensitive key material, compromise encrypted communications, and allow an attacker to perform unauthorized cryptographic operations. The vulnerability affects confidentiality, integrity, and availability at the highest level, with no privileges or user interaction required (Feedly, oss-security).

Exploitability

A proof-of-concept exploit is publicly available via the GnuPG issue tracker (https://dev.gnupg.org/T8044), though there is no confirmed evidence of in-the-wild exploitation at this time. The vulnerability is unauthenticated and network-accessible, making it trivially reachable for any attacker who can deliver a crafted S/MIME message to a target. The EPSS score is approximately 0.064% (low probability of near-term exploitation), and the vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No specific threat actor attribution has been reported (Feedly, GnuPG Tracker).

Exploitation steps

  1. Reconnaissance: Identify systems running GnuPG versions 2.5.13–2.5.16 or Gpg4win 5.0.0 that process S/MIME encrypted email (e.g., mail servers, email clients using gpgsm for S/MIME decryption).
  2. Craft malicious EnvelopedData message: Construct a CMS/S/MIME EnvelopedData message containing an oversized wrapped session key that exceeds the fixed-size stack buffer in gpg-agent's PKDECRYPT--kem=CMS handler.
  3. Deliver the payload: Send the crafted S/MIME message to the target user or system. This can be done via email or any mechanism that causes the affected gpg-agent to process the message (e.g., triggering decryption via gpgsm).
  4. Trigger buffer overflow: When gpg-agent processes the PKDECRYPT--kem=CMS command for the crafted message, the oversized key data overflows the stack buffer, corrupting adjacent memory.
  5. Achieve DoS or RCE: At minimum, the overflow causes a crash (DoS). With a carefully crafted payload exploiting the memory corruption, an attacker may achieve arbitrary code execution within the gpg-agent process, potentially gaining access to private key material or executing further commands (oss-security, GnuPG Tracker).

Indicators of compromise

  • Process: Unexpected crashes or restarts of the gpg-agent process; core dump files generated by gpg-agent in /tmp or the user's GnuPG home directory (~/.gnupg/).
  • Logs: System logs (e.g., syslog, journald) showing segmentation faults or abnormal termination of gpg-agent; error messages referencing PKDECRYPT or kem=CMS operations.
  • File System: Unexpected core dump files (e.g., core, core.gpg-agent) in the working directory or configured core dump path.
  • Network: Unusual or unexpected S/MIME encrypted messages received by the target system, particularly those with abnormally large EnvelopedData structures; network traffic delivering oversized CMS messages to mail processing endpoints.
  • Email: Inbound S/MIME messages that consistently cause gpgsm or gpg-agent to crash upon decryption attempts.

Mitigation and workarounds

Upgrade GnuPG to version 2.5.17 or later, or upgrade Gpg4win to version 5.0.1 or later to fully remediate the vulnerability. As an immediate workaround if patching is not possible, remove or rename the gpgsm (or gpgsm.exe on Windows) binary — this prevents the vulnerable code path from being remotely triggered since gpgsm is the component that invokes the affected PKDECRYPT--kem=CMS handling. Red Hat confirmed that RHEL and Fedora ship GnuPG versions outside the affected range (2.5.13–2.5.16) and are not impacted. Given the critical CVSS score and public PoC availability, patching should be treated as high priority (oss-security, Red Hat Bugzilla).

Community reactions

The vulnerability was discovered by OpenAI Security Research and responsibly disclosed to the GnuPG team on 2026-01-18, with a coordinated fix released nine days later on 2026-01-27 (oss-security). The disclosure generated notable coverage in the security community, with mentions on Mastodon (TheHackerWire), Bluesky, and security news outlets. OpenAI's Codex Security tool was highlighted in broader media coverage as having scanned 1.2 million code commits and identified over 10,000 high-severity issues, with CVE-2026-24881 cited as a prominent example (The Hacker News, Rescana). The SolCyber blog noted the irony that a security compliance update introduced the vulnerability into GnuPG.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

gnupg2

Fixed

sid

gnupg2

Fixed

trixie

gnupg2

Fixed

RHEL / CentOS

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-112940HIGH7.1
  • Python logoPython
  • py3-filelock
NoYesOct 20, 2026
CVE-2026-112937MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112936MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112939MEDIUM4.7
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112941LOW3.3
  • Python logoPython
  • filelock
NoYesOct 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management