Skip to main content

GnuPG CVE-2026-24881

CRITICAL
Stack-based Buffer Overflow (CWE-121)
2026-01-27 cve@mitre.org
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft CMS EnvelopedData with oversized wrapped key
  2. Delivery
    Deliver malicious S/MIME message to victim
  3. Exploit
    Victim/service triggers gpg-agent PKDECRYPT --kem=CMS
  4. Execution
    Overflow fixed stack buffer in agent
  5. Persist
    Crash agent or hijack control flow
  6. Impact
    Execute code in key-handling process

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Stack buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires gpg-agent to process an attacker-crafted CMS (S/MIME) EnvelopedData message through the PKDECRYPT --kem=CMS code path, meaning the target must use a GnuPG build before 2.5.17 that includes the KEM/CMS decryption feature and the victim must hold a private key the message is encrypted to and actually attempt decryption (interactively in a mail client or via an automated decryption service). Limiting factors: the vulnerable PKDECRYPT --kem=CMS handling is specific to the newer 2.5.x development branch, so 2.4.x stable production deployments may not be affected; exploitation depends on the victim invoking decryption of the malicious message rather than a passively listening network service; and reliable code execution (versus a crash) is constrained by stack protections (canaries, ASLR, NX) on the target platform.

Impact

Signals are mixed and should be weighed rather than taken at face value. The published CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, 9.8) treats this as a trivially exploitable, unauthenticated network attack with full impact, and SSVC-style reasoning would flag high technical impact in a security-critical key-handling daemon. However, exploitation realistically requires a victim to attempt decryption of an attacker-supplied CMS message with a matching private key, which is closer to user interaction or automated mail-pipeline processing than to a directly reachable network listener - the NVD UI:N is arguably optimistic and should be verified against the real deployment. Reliable code execution from a stack overflow on modern targets with stack canaries, ASLR, and NX is non-trivial, so the dominant near-term outcome is denial of service (agent crash) with RCE as a credible but harder upside. EPSS is low (0.20%) despite public POC availability and the high CVSS, and the issue is absent from CISA KEV, suggesting that no broad opportunistic exploitation is occurring; treat this as a high-priority patch for systems that process S/MIME (mail gateways, automated decryption services) and a medium priority elsewhere.

Exploit ScenarioDerived

An attacker emails a victim a malicious S/MIME EnvelopedData message whose wrapped session key field declares an oversized length; when the victim (or an automated mail-processing service) decrypts it, gpg-agent copies the attacker-controlled key data past a fixed stack buffer, crashing the agent and potentially corrupting the stack to gain control of execution within the key-handling process. Public proof-of-concept material is referenced from the GnuPG tracker (T8044), and because the trigger is a single crafted message, mass-mailing makes denial of service straightforward while code execution is a harder, target-specific escalation.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv5 – Jun 30, 2026

Remote code execution and denial of service in GnuPG before 2.5.17 stem from a stack-based buffer overflow in gpg-agent when it processes a crafted CMS (S/MIME) EnvelopedData message containing an oversized wrapped session key during PKDECRYPT --kem=CMS handling. Any user or service decrypting attacker-supplied S/MIME mail with a vulnerable build can be crashed, and the memory corruption may be escalated to arbitrary code execution in the gpg-agent process that custodies private keys. Publicly available exploit code exists, but the issue is not in CISA KEV and EPSS is low (0.20%, 41st percentile), indicating no confirmed widespread exploitation yet.

Earlier versions of this analysis (4)
v4 Jun 30, 2026 - 04:03 cvss changed CVSS 9.8

Stack-based buffer overflow in GnuPG's gpg-agent (versions before 2.5.17) lets an attacker who supplies a crafted CMS/S-MIME EnvelopedData message with an oversized wrapped session key corrupt memory during PKDECRYPT --kem=CMS handling, reliably crashing the agent (denial of service) and potentially achieving remote code execution. Both upstream GnuPG (Linux/Unix) and the Gpg4win Windows port are affected. Publicly available exploit code exists, though EPSS exploitation probability is low (0.20%, 41st percentile) and it is not listed in CISA KEV, so this is no public exploit identified as actively exploited at time of analysis.

v3 Jun 30, 2026 - 04:02 cvss changed CVSS 9.8

Stack-based buffer overflow in GnuPG's gpg-agent (versions before 2.5.17) allows an attacker to crash the agent or potentially execute arbitrary code by delivering a crafted S/MIME CMS EnvelopedData message containing an oversized wrapped session key, triggered during PKDECRYPT --kem=CMS handling. Reliable denial of service is straightforward, and the underlying memory corruption could escalate to remote code execution against the user processing the message. Publicly available exploit code exists, though EPSS exploitation probability remains low (0.20%, 41st percentile) and the issue is not in CISA KEV.

v2 Jun 30, 2026 - 04:01 cvss changed CVSS 9.8

Stack-based buffer overflow in GnuPG's gpg-agent (versions before 2.5.17) allows remote attackers to trigger denial of service and potentially achieve remote code execution by sending a crafted CMS (S/MIME) EnvelopedData message with an oversized wrapped session key during PKDECRYPT --kem=CMS handling. The flaw also affects Gpg4win, which bundles GnuPG on Windows. Publicly available exploit code exists, though EPSS scores exploitation probability low (0.20%, 41st percentile), and it is not on CISA KEV - no confirmed active exploitation.

v1 Mar 12, 2026 - 21:55 CVSS 8.1

In GnuPG before 2.5.17, a crafted CMS (S/MIME) EnvelopedData message carrying an oversized wrapped session key can cause a stack-based buffer overflow in gpg-agent during PKDECRYPT--kem=CMS handling. [CVSS 8.1 HIGH]

RemediationAI

Vendor-released patch: GnuPG 2.5.17 - upgrade all GnuPG and Gpg4win installations to 2.5.17 or later, and on Linux apply the corresponding distribution security update once published (track Red Hat's advisory and VEX at https://access.redhat.com/security/cve/CVE-2026-24881 and https://bugzilla.redhat.com/show_bug.cgi?id=2433480). Until patched, the most effective compensating control is to avoid invoking the affected path: do not process untrusted S/MIME (CMS EnvelopedData) messages with the vulnerable gpg-agent, and disable or quarantine automated S/MIME decryption in mail gateways and pipelines that pass attacker-reachable content to gpg-agent - the trade-off is loss of automatic S/MIME inbound decryption until upgraded. Where feasible, restrict and isolate gpg-agent (run under a constrained service account, limit who can submit PKDECRYPT requests over the Assuan socket) to contain a crash or code-execution attempt; the side effect is added operational friction for legitimate key operations. Verify the running version with gpg-agent --version after upgrading rather than relying on package metadata alone.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

GnuPG is the reference OpenPGP/CMS implementation used for mail encryption, package signing, and key management across Linux distributions and the Windows Gpg4win distribution. The flaw lives in gpg-agent, the daemon that holds private keys and performs cryptographic operations on their behalf; specifically in the newer KEM (Key Encapsulation Mechanism) decryption path exposed via the PKDECRYPT --kem=CMS Assuan command. When parsing a CMS EnvelopedData structure (the S/MIME container that wraps a per-message symmetric session key encrypted to the recipient's certificate), an attacker-controlled length field for the wrapped session key is not properly bounded before the key material is copied into a fixed-size stack buffer. This is a classic CWE-121 stack-based buffer overflow, where the overflow can smash the return address and adjacent stack data, enabling control-flow hijack beyond a simple crash.

Know when Gnupg gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

Network-delivered crafted message needs no authentication, but a victim must attempt decryption (UI:R); overflow in the key-handling agent yields full C/I/A impact.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE 8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat 8.1 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

9
Analysis Updated
Jun 30, 2026 - 04:04 vuln.today
v5 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:03 vuln.today
v4 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:02 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:01 vuln.today
v2 - CVSS changed
Severity Changed
Jun 30, 2026 - 03:23 NVD
HIGH CRITICAL
CVSS changed
Jun 30, 2026 - 03:23 NVD
8.1 (HIGH) 9.8 (CRITICAL)
Patch released
Apr 09, 2026 - 20:30 nvd
Patch available
PoC Detected
Feb 12, 2026 - 18:15 vuln.today
Public exploit code
CVE Published
Jan 27, 2026 - 19:16 nvd
HIGH 8.1

DescriptionNVD

In GnuPG before 2.5.17, a crafted CMS (S/MIME) EnvelopedData message carrying an oversized wrapped session key can cause a stack-based buffer overflow in gpg-agent during PKDECRYPT--kem=CMS handling. This can easily be leveraged for denial of service; however, there is also memory corruption that could lead to remote code execution.

Executive ViewAI

Why It Matters

GnuPG before version 2.5.17 contains a critical remote code execution vulnerability in S/MIME email decryption, with publicly available exploit code in circulation. The attack can compromise the gpg-agent process, potentially exposing private encryption keys and sensitive communications to any organization processing attacker-supplied messages. While current exploitation remains minimal (0.2% EPSS, no confirmed active attacks), the direct threat to cryptographic key custody requires immediate patching across all affected systems.

Business Impact: High
Compensating Controls

Apply vendor patch. Until deployment is complete, restrict routing of untrusted external email through GnuPG-dependent systems; monitor gpg-agent processes for crashes, memory corruption errors, or unexpected terminations as early indicators of exploitation attempts.

Threat Intelligence Overview

EPSS Score
0.2%
Top 59% exploitable
Prevalence
High
GnuPG is ubiquitous, but the vulnerable KEM/CMS path is in the 2.5.x dev branch
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A stack-based buffer overflow occurs when a program writes more data to a buffer located on the stack than it was allocated to hold.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)NVD

cpe:2.3:a:gnupg:gnupg:*:*:*:*:-:*:*:*
cpe:2.3:a:gpg4win:gpg4win:*:*:*:*:*:*:*:*

More in Gnupg

View all
CVE-2018-1000858 HIGH POC
8.8 Dec 20

GnuPG version 2.1.12 - 2.2.11 contains a Cross ite Request Forgery (CSRF) vulnerability in dirmngr that can result in At

CVE-2018-6829 HIGH POC
7.5 Feb 07

cipher/elgamal.c in Libgcrypt through 1.8.2, when used to encrypt messages directly, improperly encodes plaintexts, whic

CVE-2026-24882 HIGH POC
7.8 Jan 27

Stack-based buffer overflow in GnuPG's tpm2daemon (versions before 2.5.17) allows a local attacker to corrupt the daemon

CVE-2020-25125 HIGH POC
7.8 Sep 03

GnuPG 2.2.21 and 2.2.22 (and Gpg4win 3.1.12) has an array overflow, leading to a crash or possibly unspecified other imp

CVE-2019-13050 HIGH POC
7.5 Jun 29

Interaction between the sks-keyserver code through 1.2.0 of the SKS keyserver network, and GnuPG through 2.2.16, makes i

CVE-2022-34903 MEDIUM POC
6.5 Jul 01

GnuPG through 2.3.6, in unusual situations where an attacker possesses any secret-key information from a victim's keyrin

CVE-2012-6085 MEDIUM POC
5.8 Jan 24

The read_block function in g10/import.c in GnuPG 1.4.x before 1.4.13 and 2.0.x through 2.0.19, when importing a key, all

CVE-2021-40528 MEDIUM POC
5.9 Sep 06

The ElGamal implementation in Libgcrypt before 1.9.4 allows plaintext recovery because, during interaction between two c

CVE-2022-47629 CRITICAL
9.8 Dec 20

Libksba before 1.6.3 is prone to an integer overflow vulnerability in the CRL signature parser. Rated critical severity

CVE-2014-9087 HIGH
7.5 Dec 01

Integer underflow in the ksba_oid_to_str function in Libksba before 1.3.2, as used in GnuPG, allows remote attackers to

CVE-2018-0495 MEDIUM POC
4.7 Jun 13

Libgcrypt before 1.7.10 and 1.8.x before 1.8.3 allows a memory-cache side-channel attack on ECDSA signatures that can be

CVE-2026-41989 MEDIUM
6.7 Apr 23

Heap-based buffer overflow in Libgcrypt before 1.12.2 allows local attackers to trigger denial of service and corrupt me

Vendor StatusVendor

SUSE

Severity: High
Product Status
openSUSE Tumbleweed Fixed
SLES15-SP5-CHOST-BYOS-SAP-CCloud Fixed
SLES15-SP6-CHOST-BYOS Fixed
SLES15-SP6-CHOST-BYOS-Aliyun Fixed
SLES15-SP6-CHOST-BYOS-Azure Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy