Analytics Story: Upload2Shell - CVE-2026-125396

Description

This analytic story covers upload-to-shell behavior in image rendering workflows, including Ghostscript activity described in research for CVE-2026-125396.

Why it matters

CVE-2026-125396 is a use-after-free in Ghostscript's Type 1 font loader. A crafted document that reaches an affected Ghostscript renderer can corrupt native state and cross the -dSAFER boundary.

Ghostscript may sit behind image conversion, document preview, email attachment, or print workflows, so the application receiving the file may never invoke Ghostscript directly. A trusted-looking image or PDF extension does not establish the file's actual content type.

HTTP Upload Activity to Web Application uses Zeek files.log to find an HTTP upload whose detected PostScript or EPS MIME type conflicts with an image or PDF filename. This is an early routing clue, not evidence that Ghostscript opened the file. Confirm the upload path, file identifier, MIME classification, and whether the application sent the file to a renderer. Legitimate conversion workflows can produce the same mismatch.

Endpoint analytics can add evidence when a web worker starts Ghostscript or when the renderer or application starts a shell. A server can also process a crafted file without creating a child shell, so process telemetry should be evaluated with the application's normal rendering behavior. Prioritize exposed upload and preview features, inventory the Ghostscript package used by each application or container, and apply Ghostscript 10.08.0 or a distribution backport of the Type 1 loader fix.

Web Anomaly Followed by Server Process Execution

 1| tstats `security_content_summariesonly`
 2    min(_time) as firstTime
 3    max(_time) as lastTime
 4from datamodel=Risk.All_Risk where
 5
 6All_Risk.risk_object_type="system"
 7
 8source IN (
 9    "*PHP Serialized Object in POST Body*",
10    "*PHP SOAP DTD Entity Reference in Attribute*",
11    "*PHP SOAP Malformed Array Dimensions*",
12    "*HTTP Large POST and Oversized Multipart Header Activity*",
13    "*Ruby Repeated Legacy Sharp S Bytes in POST Body*",
14    "*PostScript or EPS Upload with Image or PDF Extension*",
15    "*Large HTTP POST Request Resulting in Server Error*",
16    "*Zeek HTTP Malformed Base64 Padding*",
17    "*Windows Suspicious Child Process Spawned From WebServer*",
18    "*Web or Application Server Spawning a Shell*",
19    "*Linux Auditd Shell from Web or Application Directory*",
20    "*Inline PHP Code Execution*"
21)
22
23by All_Risk.normalized_risk_object source _time span=1s
24
25| `drop_dm_object_name(All_Risk)`
26
27| where isnotnull(normalized_risk_object)
28
29| lookup asset_lookup_by_str asset as normalized_risk_object OUTPUT ip as asset_ip
30
31| eval normalized_risk_object=coalesce(asset_ip,normalized_risk_object)
32
33| fields - asset_ip
34
35| eval web_request=if(in(source,
36      "ESCU - PHP Serialized Object in POST Body - Rule",
37      "ESCU - PHP SOAP DTD Entity Reference in Attribute - Rule",
38      "ESCU - PHP SOAP Malformed Array Dimensions - Rule",
39      "ESCU - HTTP Large POST and Oversized Multipart Header Activity - Rule",
40      "ESCU - Ruby Repeated Legacy Sharp S Bytes in POST Body - Rule",
41      "ESCU - Large HTTP POST Request Resulting in Server Error - Rule",
42      "ESCU - Zeek HTTP Malformed Base64 Padding - Rule",
43      "ESCU - PostScript or EPS Upload with Image or PDF Extension - Rule"),1,0),
44       web_time=if(web_request=1,firstTime,null()),
45       web_source=if(web_request=1,source,null())
46
47| sort 0 normalized_risk_object firstTime -web_request
48
49| streamstats max(web_time) as preceding_web_time
50              last(web_source) as web_analytic
51              by normalized_risk_object
52
53| where web_request=0
54    AND isnotnull(preceding_web_time)
55    AND firstTime>=preceding_web_time
56    AND firstTime-preceding_web_time<=900
57
58| eval endpoint_analytic=source,
59       time_delta_seconds=firstTime-preceding_web_time,
60       risk_object=normalized_risk_object,
61       lastTime=firstTime,
62       firstTime=preceding_web_time
63
64| fields risk_object web_analytic endpoint_analytic time_delta_seconds firstTime lastTime
65
66| `security_content_ctime(firstTime)`
67| `security_content_ctime(lastTime)`
68| `web_anomaly_followed_by_server_process_execution_filter`

Detections

Name ▲▼ Technique ▲▼ Type ▲▼
PostScript or EPS Upload with Image or PDF Extension Exploit Public-Facing Application Anomaly
Web or Application Server Spawning a Shell External Remote Services, Exploit Public-Facing Application TTP

Data Sources

Name ▲▼ Platform ▲▼ Sourcetype ▲▼ Source ▲▼
Bro files Other bro:files:json bro:files:json
Sysmon for Linux EventID 1 Linux icon Linux sysmon:linux Syslog:Linux-Sysmon/Operational
Sysmon EventID 1 Windows icon Windows XmlWinEventLog XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

References


Source: GitHub | Version: 1