Threat reportVulnerabilityTL-2026-6651
Upload2Shell: Ghostscript -dSAFER sandbox bypass via Type 1 font loader use-after-free (CVE-2026-125396) reachable through WordPress, Roundcube and CUPS
A use-after-free in Ghostscript's Type 1 font loader (.putgstringcopy / .forceput) bypasses the -dSAFER sandbox in upstream releases before 10.08.0 (CVSS 4.0 8.5). Researchers Paulos Yibelo and pwn.ai demonstrated command execution through WordPress (Imagick), Roundcube 1.7.2 and a Debian 13 CUPS print server; no in-the-wild exploitation has been confirmed. First disclosed .
Key facts
| Identifiers | TL-2026-6651, CVE-2026-125396, CVE-2026-65640, CVE-2026-114727 |
|---|---|
| Also known as | Upload2Shell |
| Severity | HIGH |
| CVSS | 8.5 (CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N) |
| First disclosed | |
| Exploitation status | Public proof-of-concept exploit for a linked CVE |
| EPSS | CVE-2026-65640: 1.9% (80.1th percentile); CVE-2026-125396: 0.1% (5.6th percentile) |
| Affected products | Artifex Ghostscript (ghostpdl); Debian ghostscript package; WordPress WordPress core (Imagick media preview path, CVE-2026-65640); Roundcube Roundcube Webmail; OpenPrinting CUPS shared queue on Debian 13 with vulnerable Ghostscript; Amazon Amazon Linux ghostscript |
| Weaknesses (CWE) | CWE-648, CWE-416 |
| Tools | ImageMagick, Imagick |
| MITRE ATT&CK techniques | T1036.008 Masquerading: Masquerade File Type, T1059 Command and Scripting Interpreter, T1059.004 Command and Scripting Interpreter: Unix Shell, T1190 Exploit Public-Facing Application, T1203 Exploitation for Client Execution, T1204.002 User Execution: Malicious File, T1211 Exploitation for Defense Evasion, T1566.001 Spearphishing Attachment |
| Motivation | UNKNOWN |
| Target sectors | technology, government administration, education, news - media |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 12 cited sources |
Detection coverage
As of 2026-11-22, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6651 across Splunk SPL, Microsoft KQL and Sigma, covering 21 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: Ghostscript -dSAFER Bypass (CVE-2026-125396) — Ghostscript Spawning Shell or Interpreter Child
Detects the process lineage left by a successful CVE-2026-125396 (Upload2Shell) exploit: a Ghostscript process (gs/gsc) spawning a shell, scripting interpreter or download/netcat utility. Ghostscript converting WordPress/Imagick uploads, Roundcube thumbnails or CUPS print jobs has no legitimate reason to create such children, so a hit means the -dSAFER sandbox was likely escaped through the .putgstringcopy/.forceput use-after-free. Exploitation is research-demonstrated only; verify the host's Ghostscript package version (fixed upstream in 10.08.0; Debian 10.0.0~dfsg-11+deb12u9 / 10.05.1~dfsg-1+deb13u2).
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1190, T1203, T1059.004, T1211
- Data sources: sysmon_for_linux, auditd, defender_for_endpoint_linux
- Severity: critical
- Confidence: high
Splunk SPL
index=linux sourcetype="sysmon:linux" EventCode=1 ParentImage IN ("*/gs","*/gsc") Image IN ("*/sh","*/bash","*/dash","*/zsh","*/ash","*/busybox","*/python*","*/perl","*/php*","*/ruby","*/nc","*/ncat","*/socat","*/curl","*/wget")
```comment
Ghostscript (gs/gsc) should never spawn a shell or interpreter; this is the post-sandbox-escape execution signature for CVE-2026-125396. Field names follow the Splunk Add-on for Sysmon for Linux.
```
| eval lineage=ParentImage." -> ".Image
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as child_cmd values(ParentCommandLine) as gs_cmd by host User lineage
| convert ctime(first_seen) ctime(last_seen)
| table host User lineage count first_seen last_seen gs_cmd child_cmdMicrosoft KQL
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("gs","gsc")
| where FileName in~ ("sh","bash","dash","zsh","ash","busybox","python","python3","perl","ruby","nc","ncat","socat","curl","wget") or FileName startswith "php"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName
| order by Timestamp descSigma
title: Ghostscript Spawning Shell or Interpreter (CVE-2026-125396 Upload2Shell)
id: 6f1c2a3e-5b7d-4e19-9a42-0c8d7e61a101
status: experimental
description: Detects Ghostscript spawning a shell, scripting interpreter or download utility, the execution signature of a -dSAFER sandbox bypass via the Type 1 font loader use-after-free (CVE-2026-125396).
references:
- https://www.cve.org/CVERecord?id=CVE-2026-125396
- https://www.vulncheck.com/advisories/ghostscript-before-10.08.0-dsafer-bypass-via-putgstringcopy-forceput-recovery
- https://github.com/ArtifexSoftware/ghostpdl/commit/1484854e0c8ddfda1baa4ad4cd965b8a9790aa81
author: Threadlinqs Team
date: 2026/11/22
tags:
- attack.initial-access
- attack.t1190
- attack.execution
- attack.t1203
- attack.t1059.004
- attack.defense-evasion
- attack.t1211
- cve.2026.125396
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith: ['/gs', '/gsc']
selection_child:
Image|endswith: ['/sh', '/bash', '/dash', '/zsh', '/ash', '/busybox', '/python', '/python3', '/perl', '/ruby', '/nc', '/ncat', '/socat', '/curl', '/wget']
condition: selection_parent and selection_child
falsepositives:
- Custom print filters or document pipelines that intentionally shell out from Ghostscript
- Administrators running gs interactively from a shell wrapper
level: high
Known false positives:
- Legacy CUPS/print filter scripts or document pipelines that wrap Ghostscript in a shell script
- Administrators or developers testing Ghostscript from an interactive shell on the same host
Tuning notes: Restrict to servers hosting WordPress, Roundcube or CUPS first. Exclude known wrapper scripts by exact CommandLine or Image path rather than removing the parent condition. Adjust field names (ParentImage, Image, CommandLine) if the sysmon:linux add-on or auditd mapping differs; for auditd correlate SYSCALL ppid/exe.
- [indicator] Launched with -dNOSAFER / -dDELAYSAFER or Permit Flags (SAFER Sandbox Weakening) · unlock with TL Creds
- Web/Mail Upload Delivery Chain — PHP or ImageMagick → [indicator] → Shell (WordPress Imagick / Roundcube Thumbnail) · unlock with TL Creds
- [indicator] Process or Its Child Making Outbound Network Connection (Sandbox Escape C2) · unlock with TL Creds
- CUPS Print Job Conversion — lp-owned [indicator] Spawning Unexpected Child (Unauthenticated Print Path) · unlock with TL Creds
- [indicator] Command Line Containing CVE-2026-125396 Exploit Primitives (.forceput / [indicator] / [indicator]) · unlock with TL Creds
- Reverse-Shell or Netcat-Style Process Execution by Web/Print Service Account · unlock with TL Creds
- Post-Exploitation Download-and-Execute by Renderer Service Accounts (www-data/lp) After [indicator] Exploit · unlock with TL Creds
- Outbound Connections / Beaconing from Renderer Service Accounts ([indicator] RCE Follow-on C2) · unlock with TL Creds
Indicators of compromise
As of 2026-11-22, Threadlinqs Intelligence tracks 21 indicators of compromise for TL-2026-6651.
Technical analysis
CVE-2026-125396 is a -dSAFER sandbox bypass in Ghostscript before 10.08.0. The .putgstringcopy procedure in Resource/Init/gs_fonts.ps calls the privileged .forceput operator without checking operand types. A crafted PostScript or PDF document can trigger a type error, recover .forceput through a custom error handler, and cause a use-after-free across save/restore. This gives read/write primitives that let document code alter Ghostscript's security checks and execute arbitrary code while -dSAFER is still enabled. NVD scores it CVSS 4.0 8.5 (AV:L/UI:P) with a secondary CVSS 3.1 score of 7.8, and lists CWE-648. The 'local' attack vector describes the interpreter; the practical exposure comes from services that pass untrusted documents to Ghostscript.
Research published on 17 November 2026 by Paulos Yibelo and pwn.ai (reported by Cyber Security News as 'Upload2Shell') demonstrated three delivery paths. (1) WordPress: Ghostscript is reached through the media preview process on sites using Imagick/ImageMagick; WordPress requires media upload privileges, which Authors and higher roles have by default, and the WordPress core side is tracked as CVE-2026-65640 (fixed in 7.0.4, backported including to 6.9.7). Certain public upload features in the Forminator and Essential Addons for Elementor plugins reached the renderer without login in the tested configurations. (2) Roundcube 1.7.2: a sender needs no webmail account; the recipient only has to view the message, as the server generates an attachment thumbnail and hands it through ImageMagick to Ghostscript, depending on an ImageMagick policy that allows the handoff. Commands ran as www-data. (3) CUPS: a shared queue on Debian 13 accepted unauthenticated network print jobs and sent the document to Ghostscript for conversion; execution was confirmed by writing a marker file as the lp user. Storing a file did not start Ghostscript in the tests; rendering it did. Commands ran with the renderer's privileges, not automatically as root.
Upstream fixed the flaw in Ghostscript 10.08.0 (commit 1484854e0c8ddfda1baa4ad4cd965b8a9790aa81; bug 709684). Distribution backports mean the upstream version alone does not determine exposure: Debian lists fixes in bookworm (10.0.0~dfsg-11+deb12u9), trixie (10.05.1~dfsg-1+deb13u2 per the DSA entry; the tracker table shows deb13u3) and forky/sid (10.08.0~dfsg-2), while Amazon Linux 2, 2023 and 2027 Preview were 'Pending Fix' at last check. Updating the host does not replace Ghostscript bundled inside containers or application bundles. NVD data shows no confirmed exploitation (EPSS 0.16%), the CVE is not in CISA KEV, and the source article states it describes research demonstrations, not attacks in the wild. No IOCs, malware or threat actor are reported; the indicators below are exposure and hunting pivots (vulnerable components, interpreter internals, process lineage).
MITRE ATT&CK techniques by tactic:
Defense Evasion
T1036.008 Masquerading: Masquerade File Type; T1211 Exploitation for Defense Evasion
Execution
T1059 Command and Scripting Interpreter; T1059.004 Command and Scripting Interpreter: Unix Shell; T1203 Exploitation for Client Execution; T1204.002 User Execution: Malicious File
Initial Access
T1190 Exploit Public-Facing Application; T1566.001 Spearphishing Attachment
Remediation
Patches
- Upgrade Ghostscript to 10.08.0 or later
- Debian 12: 10.0.0~dfsg-11+deb12u9 (DLA-4914-1); Debian 13: 10.05.1~dfsg-1+deb13u2 or later (DSA-6516-1)
- WordPress 7.0.4 or the backported release for your branch (including 6.9.7) for CVE-2026-65640
Immediate actions
- Check vendor package status for CVE-2026-125396 and verify which Ghostscript copy each service (WordPress, Roundcube, CUPS, containers) actually invokes
- Require authentication for shared CUPS queues and restrict network access to print servers
- Review public forms and plugins that send uploads into the WordPress Media Library
- If patching must wait, suspend automatic preview/thumbnail generation for untrusted files where practical
Workarounds
- Disable Imagick/ImageMagick handling of PostScript and PDF for untrusted uploads
- Disable anonymous or unauthenticated upload and print submission paths
Longer-term hardening
- Isolate renderer/converter workers and give their service accounts only the access they need
- Restrict the ImageMagick policy so PostScript/PDF coders are not handed to Ghostscript for untrusted input
- Inventory Ghostscript copies bundled inside containers and application bundles
Affected and fixed versions
- Artifex — Ghostscript (ghostpdl)
Vulnerable versions: < 10.08.0
Fixed in: 10.08.0 - Debian — ghostscript package
Vulnerable versions: bookworm 10.0.0~dfsg-11+deb12u8
Fixed in: bookworm 10.0.0~dfsg-11+deb12u9; trixie 10.05.1~dfsg-1+deb13u2; forky/sid 10.08.0~dfsg-2 - WordPress — WordPress core (Imagick media preview path, CVE-2026-65640)
Vulnerable versions: Releases before 7.0.4 and backport branches using Imagick with Ghostscript
Fixed in: 7.0.4; 6.9.7 - Roundcube — Roundcube Webmail
Vulnerable versions: 1.7.2 (tested with a vulnerable Ghostscript behind ImageMagick) - OpenPrinting — CUPS shared queue on Debian 13 with vulnerable Ghostscript
Vulnerable versions: Configurations accepting unauthenticated network print jobs with vulnerable Ghostscript
Fixed in: Debian 13 ghostscript 10.05.1~dfsg-1+deb13u2 - Amazon — Amazon Linux ghostscript
Vulnerable versions: Amazon Linux 2; Amazon Linux 2023; Amazon Linux 2027 Preview (Pending Fix at last check)
Timeline
Last updated · revalidated 1× · latest source
- pwn.ai (Paulos Yibelo) discovers the .putgstringcopy/.forceput use-after-free in Ghostscript font-loading code.
- WordPress 7.0.4 released fixing the Imagick/Ghostscript PostScript-upload RCE tracked as CVE-2026-65640 (reported by SecurityWeek; pwn.ai credited for disclosure)
- Artifex commits fix 1484854e, adding operand checks before .putgstringcopy can fail in copy (bug 709684).
- Ghostscript 10.08.0 released with the fix. A later commit moves the helper into C and removes the .forceput dependency.
- Debian 13 security update DSA-6516-1 published for the affected CUPS/Ghostscript path.
- Roundcube ships its fix for the attachment thumbnail path (CVE-2026-114727).
- CVE-2026-125396 published; NVD rates it CVSS 4.0 8.5 and the Ghostscript fix lands in ghostpdl-10.08.0
- Google mitigates its image/document pipeline path, which pwn.ai had shown reaching Ghostscript.
- Red Hat opens Bugzilla 2569593 and Amazon Linux publishes its advisory (Important, Pending Fix) for CVE-2026-125396
- Amazon Linux Security Center modifies its CVE-2026-125396 entry
- Paulos Yibelo and pwn.ai publish Upload2Shell research demonstrating command execution via WordPress, Roundcube 1.7.2 and a Debian 13 CUPS server
- pwn.ai publishes the Upload2Shell technical write-up and the partial PoC (locked-ioc-3).
- NVD record for CVE-2026-125396 last modified; no confirmed exploitation, EPSS 0.16%
- The Hacker News reports the research. No in-the-wild exploitation is reported.
- Cyber Security News reports the research as demonstrations, not confirmed attacks in the wild
Update history
- 2026-11-22 — Ghostscript -dSAFER Sandbox Escape to RCE via Crafted File Uploads (CVE-2026-125396, "Upload2Shell"): What changed Exploitability THEORETICAL → POC_PUBLIC. pwn.ai published a deliberately partial PoC (locked-ioc-3) on 2026-11-21. It shows only the memory primitive, runs no shell command, and fails on Ghostscript 10.08.0.
Sources cited
- CVE-2026-125396 CVE Record CVE Program · Advisory · 2026-11-10
- WordPress GHSA-8vr3-7mxf-gx8w (Imagick/Ghostscript RCE, CVE-2026-65640) GitHub · Advisory · 2026-08-13
- Red Hat Bugzilla 2569593: CVE-2026-125396 ghostscript SAFER sandbox bypass bugzilla.redhat.com · Vendor report · 2026-11-10
- Amazon Linux Security Center: CVE-2026-125396 explore.alas.aws.amazon.com · Vendor report · 2026-11-10
- Debian Security Tracker: CVE-2026-125396 security-tracker.debian.org · Vendor report · 2026-11-10
- Ghostscript bug 709684 bugs.ghostscript.com · Vendor report · 2026-11-09
- VulnCheck: Ghostscript before 10.08.0 -dSAFER bypass via .putgstringcopy .forceput recovery vulncheck.com · Research · 2026-11-10
- Ghostpdl fix commit 1484854e (ghostpdl-10.08.0) GitHub · Code repository · 2026-11-09
- Hackers Could Execute Commands on WordPress, Email and Print Servers Through Upload2Shell Flaw cybersecuritynews.com · News · 2026-11-22
- CVE Watchtower: CVE-2026-125396 ArtifexSoftware ghostpdl (CVSS 4.0 8.5) securityonline.info · News · 2026-11-09
- SecurityWeek: WordPress 7.0.4 Patches Remote Code Execution Vulnerability SecurityWeek · News · 2026-08-13
- Cyber Security News: WordPress Imagick RCE vulnerability cybersecuritynews.com · News · 2026-08-13
Other reports on CVE-2026-65640
Drafted by the Threadlinqs research pipeline from 12 sources; published ; last updated .