Tia N.List

CTI · reported · 2026-10-15

A Ghostscript buffer overflow enables unauthenticated remote code execution (CVE-2026-39919)

Full story & timeline

Actors

—

Malware / tools

—

Campaigns

—

CVEs

CVE-2026-39919

Victim sectors

—

Geography

—

MITRE ATT&CK

Indicators

No curated indicators tied to this case.

Detections

Detection content derived from this case analysis. Status: experimental — not validated against live telemetry.

Sigma raw

title: Web Server Spawning Ghostscript on Uploaded PDF (CVE-2026-39919)
id: c891e4b4-3349-4b24-a451-0fadb3b5deea
status: experimental
description: >
    Detects a web or document-conversion process spawning the Ghostscript
    interpreter on a PDF file, the exploitation shape of CVE-2026-39919: a
    heap-based buffer overflow in Ghostscript's JPEG 2000 output adapter
    (sjpx_openjpeg.c) reachable through crafted PDFs. In WordPress this is
    reached via the PHP Imagick extension calling ImageMagick, which launches
    Ghostscript when generating thumbnails or previews.
references:
    - https://www.bleepingcomputer.com/news/security/ghostscript-flaw-lets-hackers-hijack-servers-via-pdf-uploads/
    - https://gbhackers.com/ghostscript-vulnerability/
    - https://securityonline.info/ghostscript-vulnerability-cve-2026-39919/
author: Tia N. List
date: 2026-10-15
tags:
    - attack.t1190
    - attack.t1059
logsource:
    category: process_creation
    product: linux
detection:
    selection_parent:
        ParentImage|contains:
            - 'php-fpm'
            - 'apache2'
            - 'httpd'
            - 'nginx'
            - 'php'
    selection_ghostscript:
        Image|endswith:
            - '/gs'
            - '/gsc'
            - '/gxps'
    selection_pdf:
        CommandLine|contains:
            - '.pdf'
            - '-sDEVICE='
    condition: selection_parent and selection_ghostscript and selection_pdf
falsepositives:
    - Legitimate document, thumbnail, or print pipelines that render user-supplied PDFs with Ghostscript
level: medium

Splunk SPL raw

# a-ghostscript-buffer-overflow-enables-unauthenticated-remote-cod — Splunk SPL variant (derived from a-ghostscript-buffer-overflow-enables-unauthenticated-remote-cod.sigma via sigma convert)
# source-sha256: 21744d3aa6346a8ca75842ab575576804e2f2a69e0729f35ee5cb2fc5fdea5cd v1
ParentImage IN ("*php-fpm*", "*apache2*", "*httpd*", "*nginx*", "*php*") Image IN ("*/gs", "*/gsc", "*/gxps") CommandLine IN ("*.pdf*", "*-sDEVICE=*")

KQL (Sentinel / Defender) raw

# a-ghostscript-buffer-overflow-enables-unauthenticated-remote-cod — KQL variant (derived from a-ghostscript-buffer-overflow-enables-unauthenticated-remote-cod.sigma via sigma convert)
# source-sha256: 21744d3aa6346a8ca75842ab575576804e2f2a69e0729f35ee5cb2fc5fdea5cd v1
(ParentImage contains "php-fpm" or ParentImage contains "apache2" or ParentImage contains "httpd" or ParentImage contains "nginx" or ParentImage contains "php") and (Image endswith "/gs" or Image endswith "/gsc" or Image endswith "/gxps") and (CommandLine contains ".pdf" or CommandLine contains "-sDEVICE=")

References

Source on GitHub