Skip to navigation

Threat reportVulnerabilityTL-2026-4308

Critical Pillow Image Library Flaws Enable Code Execution via Crafted Image (CVE-2026-112900, CVE-2026-112393, CVE-2026-112403, CVE-2026-112398)

criticalACTIVE

Multiple critical memory-safety and injection flaws in Python's Pillow imaging library (up to 12.3.0) allow code execution or process crashes from crafted images or filenames: Ghostscript argument injection via EPS filenames (CVE-2026-112900), a TIFF in-memory write heap overflow (CVE-2026-112393), a lossless-JPEG draft/thumbnail heap overflow (CVE-2026-112403) and an FPX JPEG-tile heap overflow (CVE-2026-112398).

Key facts

IdentifiersTL-2026-4308, CVE-2026-112900, CVE-2026-112393, CVE-2026-112403, CVE-2026-112398
SeverityCRITICAL
CVSS9.2 (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
First disclosed
Exploitation statusPublic proof-of-concept exploit for a linked CVE
EPSSCVE-2026-112900: 1.3% (70.5th percentile); CVE-2026-112393: 1.0% (63.5th percentile); CVE-2026-112403: 0.9% (61.1th percentile)
Affected productsPython Pillow Pillow (PyPI)
Weaknesses (CWE)CWE-78, CWE-88, CWE-122, CWE-787
MalwarePython
Toolsghostscript (gs), libjpeg-turbo >= 3.0
MITRE ATT&CK techniquesT1036.008 Masquerade File Type, T1059 Command and Scripting Interpreter, T1190 Exploit Public-Facing Application, T1203 Exploitation for Client Execution, T1499.004 Application or System Exploitation
MotivationUNKNOWN
Target sectorstechnology, software-development, cloud-services, news - media, ecommerce
Target regionsGlobal
Detection rules9 (1 shown free)
Sources13 cited sources

Detection coverage

As of 2026-10-23, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-4308 across Splunk SPL, Microsoft KQL and Sigma, covering 10 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: Pillow EPS Ghostscript Argument Injection via Crafted Filename (CVE-2026-112900) — Exploitation

Detects Ghostscript (gs) launched by a Python web/worker process (Pillow PIL.EpsImagePlugin) with an input filename that Ghostscript parses as an option ('-...') or an @argfile, or with sandbox-weakening/pipe options (%pipe%, -dNOSAFER, -dDELAYSAFER, --permit-file-*). Pillow 2.6.0 through 12.3.0 passes the filename unnormalized, so injection works even under -dSAFER. Pillow's legitimate gs invocation never contains these patterns, which makes this a high-fidelity exploitation signal for TL-2026-4308.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1190, T1203, T1059
  • Data sources: sysmon_for_linux:linux/sysmon:linux, defender_for_endpoint:DeviceProcessEvents, linux_process_creation
  • Severity: critical
  • Confidence: high

Splunk SPL

index=linux sourcetype="sysmon:linux" EventCode=1 Image="*/gs" ParentImage IN ("*/python*","*/gunicorn*","*/uwsgi*","*/celery*","*/uvicorn*")
| where match(CommandLine, " -f [-@]") OR match(CommandLine, " @[^ ]") OR match(CommandLine, "(?i)%pipe%|-dNOSAFER|-dDELAYSAFER|--permit-file-")
| stats count min(_time) as firstTime max(_time) as lastTime values(CommandLine) as gs_cmdlines by host, User, ParentImage, ParentCommandLine
| convert ctime(firstTime) ctime(lastTime)

Microsoft KQL

DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName == 'gs'
| where InitiatingProcessFileName matches regex @'^(python|gunicorn|uwsgi|celery|uvicorn)'
| where ProcessCommandLine matches regex @' -f [-@]'
    or ProcessCommandLine matches regex @' @[^ ]'
    or ProcessCommandLine has_any ('%pipe%', '-dNOSAFER', '-dDELAYSAFER', '--permit-file-')
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine

Sigma

title: Pillow EPS Ghostscript Argument Injection via Crafted Filename (CVE-2026-112900)
id: 7c1e5a42-3b9d-4f6a-8d27-1a5e0c94b3f1
status: experimental
description: Detects Ghostscript launched by a Python web or worker process with a filename parsed as an option or @argfile, or with sandbox-weakening options. Indicates exploitation of Pillow EpsImagePlugin argument injection (CVE-2026-112900, TL-2026-4308).
references:
  - https://github.com/python-pillow/Pillow/security/advisories/GHSA-w889-685w-c8fh
  - https://www.ox.security/blog/three-critical-pillow-cves-rce-and-heap-overflows-in-pythons-imaging-library-cve-2026-112900-cve-2026-112393-cve-2026-112403/
author: Threadlinqs Team
date: 2026-10-23
tags:
  - attack.initial_access
  - attack.t1190
  - attack.execution
  - attack.t1203
  - attack.t1059
  - cve.2026.112900
logsource:
  product: linux
  category: process_creation
detection:
  selection_parent:
    ParentImage|contains:
      - '/python'
      - '/gunicorn'
      - '/uwsgi'
      - '/celery'
      - '/uvicorn'
  selection_gs:
    Image|endswith: '/gs'
  selection_inject:
    CommandLine|contains:
      - ' -f -'
      - ' -f @'
      - '%pipe%'
      - '-dNOSAFER'
      - '-dDELAYSAFER'
      - '--permit-file-'
  selection_argfile:
    CommandLine|re: ' @[^ ]'
  condition: selection_parent and selection_gs and (selection_inject or selection_argfile)
falsepositives:
  - Custom document-conversion wrappers that intentionally pass @argfiles to Ghostscript
level: critical

Known false positives:

  • Internal document-conversion services that deliberately pass @argfile or -dNOSAFER options to Ghostscript
  • Print or PDF pipelines (e.g. CUPS filters) that use %pipe% output devices from a Python parent

Tuning notes: Adjust the ParentImage list to the application servers in your estate and the index/sourcetype to your Linux process telemetry (auditd execve works if CommandLine is reconstructed). Allowlist known conversion wrappers by ParentCommandLine. Pillow's own invocation uses '-f <file>' with a normal path, so any '-f -' or '-f @' is suspicious; keep that logic.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple)
  • Native Crash of Python Worker in [indicator]/libtiff/libjpeg Code After Image Upload — Exploitation (TL-2026-4308) · unlock with TL Creds
  • Python Image Worker Writing Persistence Files (cron, systemd, authorized_keys) — Post-Exploitation (TL-2026-4308) · unlock with TL Creds
  • Python Image Worker Connecting to Public IPs on Non-Web Ports — C2 / Reverse Shell (TL-2026-4308) · unlock with TL Creds
  • Web Requests with '-' or '@' Prefixed EPS/PS Filenames or FPX Uploads Targeting [indicator] — Exploitation (TL-2026-4308) · unlock with TL Creds
  • Ghostscript Spawning Child Process — Post-Exploitation of [indicator] EPS Injection (TL-2026-4308) · unlock with TL Creds
  • Reverse Shell or Pipe-to-Shell Command Spawned by Python Worker or Ghostscript — C2 (TL-2026-4308) · unlock with TL Creds
  • [indicator] Image-Processing Worker Spawning Shell or Downloader — Post-Exploitation (TL-2026-4308) · unlock with TL Creds
  • Ghostscript or Netcat-Class Process Beaconing to External Host — C2 (TL-2026-4308) · unlock with TL Creds

Indicators of compromise

As of 2026-10-23, Threadlinqs Intelligence tracks 10 indicators of compromise for TL-2026-4308.

Sample indicators (1 of 10)

  • File hash: a2c363141da31a265dd536c945677db4b64f3ec9

Defanged, TLP:CLEAR. Full set of 10 indicators: unlock with TL Creds.

10 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

All are fixed in Pillow 13.0.0 (2026-10-16); no active exploitation has been reported.

Pillow is among the most widely deployed Python packages (~436 million monthly downloads per reporting) and is routinely used to process untrusted user uploads. Pillow 13.0.0, released 2026-10-16, fixes 41 security issues; this record covers the four critical ones highlighted by The Hacker News, OX Security and the GitHub Security Advisories.

CVE-2026-112900 (EPS / Ghostscript argument injection, CWE-78/CWE-88): PIL.EpsImagePlugin.Ghostscript() passes the input file path to the gs command line without normalizing it. A filename beginning with '-' is parsed by Ghostscript as an option, and a filename beginning with '@' is treated as an argument file (@argfile), allowing injection of arbitrary Ghostscript arguments even under default -dSAFER. The trigger is the filename, not the content of the PostScript document, so the attacker must control the filename passed to Image.open() and Ghostscript (gs) must be installed. Affects Pillow 2.6.0 through 12.3.0. NVD scores it CVSS 4.0 9.2 (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H). Reported by Chanu Kang (CysecLab, KAIST) per the GitHub advisory; OX Security also published research on the flaw.

CVE-2026-112393 (TIFF write heap overflow, CWE-122): when saving compressed TIFF to a file-like object without an OS file descriptor (e.g. io.BytesIO), the _tiffWriteProc memory sink sizes reallocation from state->size instead of state->loc. When libtiff seeks past the end of written data, the first out-of-line tag value is written beyond the allocated buffer, enabling attacker-chosen data to be written past heap bounds and stale heap bytes to leak into the saved file. The defect dates to a 2013 commit (e782fe7) and affects Pillow 2.0.0 through 12.3.0. Services that re-encode uploaded images as TIFF in memory are exposed. The advisory (reporters carlini and Tomer-PL) includes a Python reproducer; reporting credits Anthropic (using Claude) with Ada Logics validation. Saving TIFF to a real file path is unaffected and is a workaround.

CVE-2026-112403 (JPEG draft/thumbnail heap overflow, CWE-122): ImagingJpegDecode() requests scaled decoding (via Image.thumbnail() implicitly calling draft()) but never compares libjpeg's actual output geometry with the allocated buffer. With 8-bit lossless (SOF3) JPEGs, libjpeg-turbo 3.x ignores the scaling request and writes full-width scanlines into a scaled-width buffer. Reproduction needs libjpeg-turbo >= 3.0 and images of at least 1024x1024. Affects Pillow <= 12.3.0. Credited to Claude (Anthropic) as discoverer, validated by Ada Logics, reported by DavidKorczynski. Workarounds: call img.load() before thumbnail(), use thumbnail(..., reducing_gap=None), or use resize().

CVE-2026-112398 (FPX JPEG-tile heap overflow, CWE-122/CWE-787): in the FlashPix decoder an unrecognized rawmode triggers a fallback where libjpeg runs in JCS_UNKNOWN mode and outputs 4 bytes per pixel, exceeding the allocated buffer. The advisory describes the out-of-bounds write overwriting an adjacent Python bytes object's ob_type with a pointer to a fake PyTypeObject, giving arbitrary code execution from a single Image.open() call. Requires the optional olefile package; Pillow identifies formats by content rather than extension, so blind uploads with any extension can reach the FPX parser. Reported by Alex Bouffard (pebwalker). Note: the hunt skeleton's CVE-to-flaw mapping was ambiguous; the GitHub advisory GHSA-5x8w-8jj5-q52h lists this flaw as CVE-2026-112398.

Exploitation status: no known in-the-wild exploitation was reported for any of these flaws. A public reproducer exists in the TIFF advisory. Remediation is upgrading to Pillow 13.0.0 (requires Python 3.11+; Python 3.10 support dropped), rebuilding containers and wheels that bundle older Pillow, removing Ghostscript from hosts handling untrusted uploads, and never passing attacker-controlled filenames to Image.open().

MITRE ATT&CK techniques by tactic:

Defense Evasion

T1036.008 Masquerade File Type

Execution

T1059 Command and Scripting Interpreter; T1203 Exploitation for Client Execution

Initial Access

T1190 Exploit Public-Facing Application

Impact

T1499.004 Application or System Exploitation

Remediation

Patches

  • Pillow 13.0.0 (released 2026-10-16) fixes CVE-2026-112900, CVE-2026-112393, CVE-2026-112403 and CVE-2026-112398

Immediate actions

  • Upgrade to Pillow 13.0.0 or later: pip install -U "Pillow>=13.0.0"
  • Rebuild containers, wheels and virtualenvs that bundle older Pillow versions
  • Remove Ghostscript (gs) from hosts that process untrusted uploads
  • Never pass attacker-controlled filenames to Image.open(); normalize with os.path.abspath() if upgrade is delayed

Workarounds

  • TIFF (CVE-2026-112393): save TIFF to a real file path instead of an in-memory buffer such as io.BytesIO
  • JPEG (CVE-2026-112403): call img.load() before thumbnail(), use thumbnail(..., reducing_gap=None), or use resize() instead of thumbnail()/draft() on untrusted JPEGs
  • FPX (CVE-2026-112398): uninstall the optional olefile package where FPX support is not needed
  • EPS (CVE-2026-112900): uninstall Ghostscript or do not process untrusted EPS files or filenames

Longer-term hardening

  • Restrict accepted image formats on upload endpoints (reject EPS, FPX, TIFF if not required)
  • Process untrusted images in sandboxed, least-privilege workers
  • Inventory transitive Pillow dependencies via SBOM and monitor for vulnerable versions
  • Plan migration to Python 3.11+ since Pillow 13 drops Python 3.10

Affected and fixed versions

  • Python Pillow — Pillow (PyPI)
    Vulnerable versions: 2.6.0 through 12.3.0 (CVE-2026-112900, EPS); 2.0.0 through 12.3.0 (CVE-2026-112393, TIFF); <= 12.3.0 (CVE-2026-112403, JPEG thumbnail; requires libjpeg-turbo >= 3.0); <= 12.3.0 (CVE-2026-112398, FPX; requires olefile)
    Fixed in: 13.0.0

Timeline

  • Pillow 13.0.0 released, fixing 41 security issues including the four critical flaws; drops Python 3.10 support
  • GitHub Security Advisories published for the EPS/Ghostscript, TIFF, JPEG thumbnail and FPX flaws in python-pillow/Pillow
  • NVD published CVE-2026-112900 with CVSS 4.0 score 9.2 (CRITICAL); OX Security lists this as its disclosure date
  • Pillow vulnerabilities discussed on the oss-security mailing list
  • OX Security published technical analysis of three critical Pillow CVEs
  • The Hacker News reported the flaws; no known in-the-wild exploitation, public reproducer available for the TIFF flaw

Sources cited

Previous and next in vulnerability

Drafted by the Threadlinqs research pipeline from 13 sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats