# GnuPG GPGME Critical Double-Free (CVE-2026-129975) Triggered by Malicious OpenPGP Key with Long User ID

> A crafted OpenPGP key with a very long user ID can trigger a double free in GPGME's gpg engine status/colon-line readers (read_status() and read_colon_line() in src/engine-gpg.c), affecting all GPGME versions before 2.3.0, including bundled and statically linked copies. GnuPG says it can be used to exfiltrate application data and that remote code execution cannot be ruled out; fixed in GPGME 2.3.1 (legacy 1.24.4, Gpg4win 5.1.2). No in-the-wild exploitation has been reported.

- **Published:** 2026-11-21T11:39:44Z
- **Last reviewed:** 2026-11-21T11:39:44Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6640
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6640.png
- **ID:** TL-2026-6640
- **Severity:** CRITICAL
- **Category:** VULNERABILITY
- **Status:** PATCHED
- **Detections:** 9 (1 shown free below) · **IOCs:** 11 (1 shown free below)
- **CVEs:** CVE-2026-129975

## Description

CVE-2026-129975 (GnuPG tracker T8557, 'Double free in GPGME read_status/read_colon_line (src/engine-gpg.c)') is a memory-safety flaw in GPGME, the library that applications use to drive GnuPG for signing, verification, encryption and key listing. The GnuPG security advisory (Werner Koch, 2026-11-20) states that all GPGME versions before 2.3.0 are affected, whether used as a shared library, a DLL, or statically linked into an application. The trigger is an OpenPGP key containing a crafted, very long user ID.

Root cause: two internal functions, read_status() and read_colon_line(), read status lines and key listings emitted by the gpg process. Each starts with a 1024-byte buffer and grows it with realloc(). The new pointer is only written back to the context at the end of the function. If a read error causes an early return after a realloc, the context still holds the previously freed pointer; when the context is later released the memory is freed a second time. The advisory notes that other allocations occurring in between may prevent the allocator's double-free checks from firing. The tracker states the vulnerable code is present up to current master and in 1.18.0 and later releases shipped in distributions.

Impact: the advisory says the double free 'can be used [to] exfiltrate data from applications by sending for example signed data' and that exploiting it to mount a Remote Code Execution attack 'can't be ruled out', so an immediate update is highly suggested. Downstream software named includes Gpg4win, GnuPG Desktop, GnuPG VS-Desktop, most mail clients, many XMPP clients, Samba and Flatpak-packaged applications. No exploitation in the wild, public PoC, CVSS score, or attribution is stated in any source; NVD returned no record for the CVE at the time of research (2026-11-21), so scoring is left null.

Timeline and fix: discovered by Johan Carlsson and reported by GitLab on 2026-11-12, who also supplied the patch; disclosure was originally planned for 2026-11-25 but moved up to 2026-11-20 because GitLab had to update early. GPGME 2.3.1 was released 2026-11-19 (2.3.0 was never publicly available), GPGME 1.24.4 (legacy branch) and Gpg4win 5.1.2 followed on 2026-11-20. Fix commits: b4358e92e33a and 14499348b966 ('Fix a double free in the status line read code'). Statically linked binaries must be rebuilt against 2.3.1; if GPGME cannot be updated, the patch attached to the advisory likely applies even to very old versions. GPGMEPP and GPGMEQT need no update.

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1203 Exploitation for Client Execution
- T1005 Data from Local System
- T1499.004 Endpoint Denial of Service: Application or System Exploitation

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**GPGME Consumer Heap Corruption / Double-Free Abort (CVE-2026-129975) - Exploitation** (`TL-2026-6640-SPL-001`)

Detects glibc double-free and heap-corruption aborts, kernel segfaults inside libgpgme, and ANOM_ABEND / core-dump events for GPGME-linked applications (mail clients, XMPP clients, Kleopatra, gpgsm, gpg-agent) on Linux. A crafted OpenPGP key with a very long user ID triggers a double free in read_status()/read_colon_line() of libgpgme (CVE-2026-129975, CWE-415) when a read error causes an early return after realloc(); failed exploit attempts surface as process aborts. GnuPG reports no in-the-wild exploitation, so this is a hunting and early-warning detection.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1203, T1499.004
- **Data sources:** linux:syslog, linux:auditd, journald
- **Severity:** high
- **Confidence:** medium

### Splunk SPL

```spl
index=linux earliest=-24h (sourcetype=syslog OR sourcetype=linux_audit OR sourcetype=journald) ("double free" OR "free(): invalid pointer" OR "malloc(): corrupted" OR "corrupted size vs. prev_size" OR "munmap_chunk(): invalid pointer" OR "libgpgme" OR "type=ANOM_ABEND" OR "dumped core")
| regex _raw="(?i)(gpgme|kleopatra|thunderbird|evolution|claws-mail|kmail|neomutt|gajim|dino|profanity|gpgme-json|gpgsm|gpg-agent)"
| eval crash_class=case(match(_raw,"(?i)double free|free[(][)]: invalid pointer|munmap_chunk"),"double_free_CWE-415",match(_raw,"(?i)segfault at .* in libgpgme"),"segfault_in_libgpgme",match(_raw,"(?i)corrupted"),"heap_corruption",match(_raw,"ANOM_ABEND|dumped core"),"abnormal_exit",true(),"other")
| where crash_class!="other"
| stats count min(_time) as first_seen max(_time) as last_seen values(crash_class) as crash_class values(sourcetype) as sourcetype by host
| convert ctime(first_seen) ctime(last_seen)
```

### Microsoft KQL

```kql
Syslog
| where TimeGenerated > ago(24h)
| where SyslogMessage has_any ("double free","free(): invalid pointer","malloc(): corrupted","corrupted size vs. prev_size","munmap_chunk(): invalid pointer") or (SyslogMessage has "segfault" and SyslogMessage has "libgpgme") or SyslogMessage has "ANOM_ABEND"
| where SyslogMessage has_any ("gpgme","libgpgme") or ProcessName has_any ("kleopatra","thunderbird","evolution","claws-mail","kmail","neomutt","gajim","dino","profanity","gpgme-json","gpgsm","gpg-agent")
| extend CrashClass = case(SyslogMessage has_any ("double free","free(): invalid pointer","munmap_chunk(): invalid pointer"), "double_free_CWE-415", SyslogMessage has "libgpgme" and SyslogMessage has "segfault", "segfault_in_libgpgme", SyslogMessage has "corrupted", "heap_corruption", "abnormal_exit")
| summarize Events=count(), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), CrashClasses=make_set(CrashClass) by Computer, ProcessName
| project FirstSeen, LastSeen, Computer, ProcessName, Events, CrashClasses
```

### Sigma

```yaml
title: GPGME Consumer Heap Corruption Abort - CVE-2026-129975
id: 7c1f4a52-3b8e-4d6a-9f21-5e0a8b3c1d01
status: experimental
description: Detects glibc heap-corruption and double-free abort messages, or kernel segfaults inside libgpgme, from GPGME-linked applications on Linux. This is the crash signature of a malicious OpenPGP key with a very long user ID reaching the double free in read_status()/read_colon_line() (CVE-2026-129975, CWE-415).
references:
    - https://lists.gnupg.org/pipermail/gnupg-announce/2026q4/000517.html
    - https://static.dev.gnupg.org/T8557.html
author: Threadlinqs Team
date: 2026/11/21
tags:
    - attack.initial-access
    - attack.t1190
    - attack.execution
    - attack.t1203
    - attack.impact
    - attack.t1499.004
    - cve.2026-129975
logsource:
    product: linux
    service: syslog
detection:
    keywords_heap:
        - 'double free'
        - 'free(): invalid pointer'
        - 'malloc(): corrupted'
        - 'corrupted size vs. prev_size'
        - 'munmap_chunk(): invalid pointer'
    keywords_app:
        - 'gpgme'
        - 'kleopatra'
        - 'thunderbird'
        - 'evolution'
        - 'claws-mail'
        - 'kmail'
        - 'neomutt'
        - 'gajim'
        - 'gpgme-json'
        - 'gpgsm'
    keywords_segv:
        - ' in libgpgme.so'
    condition: (keywords_heap and keywords_app) or keywords_segv
falsepositives:
    - Unrelated memory bugs in the same applications
    - Developers fuzzing or debugging GPGME
level: high

```

**Known false positives:**

- Unrelated memory-safety crashes in the same desktop applications
- Developers fuzzing or debugging GPGME consumers
- Out-of-memory or hardware faults that produce segfaults in libgpgme

**Tuning notes:** Scope the regex to applications actually linked to libgpgme in your estate (inventory libgpgme.so versions below 2.3.1 via SBOM or ldd, including statically linked and Flatpak-bundled copies). Raise to critical when the crash follows a key import, key listing or signed-message open by the same user. Forward journald and kernel messages to syslog so glibc abort and segfault lines are indexed. Patched GPGME 2.3.1 / 1.24.4 removes true positives.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- GnuPG Key Import/Listing From Untrusted Location or Delivery Application (CVE-2026-129975) - Exploitation (locked: unlock with TL Creds)
- Windows [indicator] Consumer Spawning Shell or LOLBin (CVE-2026-129975) - Post-Exploitation (locked: unlock with TL Creds)
- Linux gpg/gpgme-json Direct Outbound Connection (CVE-2026-129975) - C2 / Exfiltration (locked: unlock with TL Creds)
- [indicator]/[indicator] Crash With Heap Corruption Exception (CVE-2026-129975) - Exploitation (locked: unlock with TL Creds)
- Non-GnuPG Process Reading GnuPG Private Key Store (CVE-2026-129975) - Post-Exploitation (locked: unlock with TL Creds)
- [indicator] gpg/gpgsm Direct Outbound Connection (CVE-2026-129975) - C2 / Exfiltration (locked: unlock with TL Creds)
- [indicator] Consumer Spawning Shell, Interpreter or Downloader on Linux (CVE-2026-129975) - Post-Exploitation (locked: unlock with TL Creds)
- [indicator] Component DNS Lookups to Unexpected or Tunnel-Like Domains (CVE-2026-129975) - C2 / Exfiltration (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (1 of 11)

Defanged, TLP:CLEAR.

- File hash: `1134a407b50204ee6fb9efaa6e1451c2460e543e`

Full set of 11 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [Announce GnuPG Security Advisory for GPGME (T8557, CVE-2026-129975)](https://lists.gnupg.org/pipermail/gnupg-announce/2026q4/000517.html)
- [T8557: Double free in GPGME read_status/read_colon_line (src/engine-gpg.c)](https://static.dev.gnupg.org/T8557.html)
- [T7659: GPGME legacy release (1.24.4 with fix for CVE-2026-129975)](https://dev.gnupg.org/T7659.html)
- [Gpg4win change history - 5.1.2 Security Update](https://www.gpg4win.org/change-history.html)
- [GnuPG downloads (GPGME 2.3.1 and 1.24.4)](https://gnupg.org/download/)
- [GnuPG Warns Critical GPGME Flaw Could Expose App Data via Malicious OpenPGP Keys](https://thehackernews.com/2026/11/gnupg-warns-critical-gpgme-flaw-could.html)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6640
