# 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.

- **Published:** 2026-11-22T02:57:37Z
- **Last reviewed:** 2026-11-22T06:19:16.252Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6651
- **ID:** TL-2026-6651
- **Severity:** HIGH (CVSS 8.5)
- **Category:** VULNERABILITY
- **Status:** MONITORING
- **Detections:** 9 (1 shown free below) · **IOCs:** 21
- **CVEs:** CVE-2026-125396, CVE-2026-65640, CVE-2026-114727

## Description

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

- T1190 Exploit Public-Facing Application
- T1566.001 Spearphishing Attachment
- T1203 Exploitation for Client Execution
- T1059 Command and Scripting Interpreter
- T1059.004 Command and Scripting Interpreter: Unix Shell
- T1204.002 User Execution: Malicious File
- T1211 Exploitation for Defense Evasion
- T1036.008 Masquerading: Masquerade File Type

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

**Ghostscript -dSAFER Bypass (CVE-2026-125396) — Ghostscript Spawning Shell or Interpreter Child** (`TL-2026-6651-SPL-001`)

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

````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_cmd
````

### Microsoft KQL

```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 desc
```

### Sigma

```yaml
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.

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

- [indicator] Launched with -dNOSAFER / -dDELAYSAFER or Permit Flags (SAFER Sandbox Weakening) (locked: unlock with TL Creds)
- Web/Mail Upload Delivery Chain — PHP or ImageMagick → [indicator] → Shell (WordPress Imagick / Roundcube Thumbnail) (locked: unlock with TL Creds)
- [indicator] Process or Its Child Making Outbound Network Connection (Sandbox Escape C2) (locked: unlock with TL Creds)
- CUPS Print Job Conversion — lp-owned [indicator] Spawning Unexpected Child (Unauthenticated Print Path) (locked: unlock with TL Creds)
- [indicator] Command Line Containing CVE-2026-125396 Exploit Primitives (.forceput / [indicator] / [indicator]) (locked: unlock with TL Creds)
- Reverse-Shell or Netcat-Style Process Execution by Web/Print Service Account (locked: unlock with TL Creds)
- Post-Exploitation Download-and-Execute by Renderer Service Accounts (www-data/lp) After [indicator] Exploit (locked: unlock with TL Creds)
- Outbound Connections / Beaconing from Renderer Service Accounts ([indicator] RCE Follow-on C2) (locked: unlock with TL Creds)

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

## Sources

- [Hackers Could Execute Commands on WordPress, Email and Print Servers Through Upload2Shell Flaw](https://cybersecuritynews.com/upload2shell-flaw/)
- [CVE-2026-125396 CVE Record](https://www.cve.org/CVERecord?id=CVE-2026-125396)
- [WordPress GHSA-8vr3-7mxf-gx8w (Imagick/Ghostscript RCE, CVE-2026-65640)](https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-8vr3-7mxf-gx8w)
- [Red Hat Bugzilla 2569593: CVE-2026-125396 ghostscript SAFER sandbox bypass](https://bugzilla.redhat.com/show_bug.cgi?id=2569593)
- [Amazon Linux Security Center: CVE-2026-125396](https://explore.alas.aws.amazon.com/CVE-2026-125396.html)
- [Debian Security Tracker: CVE-2026-125396](https://security-tracker.debian.org/tracker/CVE-2026-125396)
- [CVE Watchtower: CVE-2026-125396 ArtifexSoftware ghostpdl (CVSS 4.0 8.5)](https://securityonline.info/cve-watchtower/cve-2026-125396/)
- [Ghostpdl fix commit 1484854e (ghostpdl-10.08.0)](https://github.com/ArtifexSoftware/ghostpdl/commit/1484854e0c8ddfda1baa4ad4cd965b8a9790aa81)
- [Ghostscript bug 709684](https://bugs.ghostscript.com/show_bug.cgi?id=709684)
- [VulnCheck: Ghostscript before 10.08.0 -dSAFER bypass via .putgstringcopy .forceput recovery](https://www.vulncheck.com/advisories/ghostscript-before-10.08.0-dsafer-bypass-via-putgstringcopy-forceput-recovery)
- [SecurityWeek: WordPress 7.0.4 Patches Remote Code Execution Vulnerability](https://www.securityweek.com/wordpress-7-0-4-patches-remote-code-execution-vulnerability/)
- [Cyber Security News: WordPress Imagick RCE vulnerability](https://cybersecuritynews.com/wordpress-imagick-rce-vulnerability/)

## 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-6651
