Skip to navigation

Threat reportVulnerabilityTL-2026-3329

Discourse Image Pipeline Exploit Chains JPEG Race, GhostScript and ImageMagick for Arbitrary File Read (CVE-2026-55420)

highPATCHED

Searchlight Cyber researcher Kevin Gervot chained a JPEG-bomb processing delay, a TOCTOU race between FastImage validation and ImageMagick processing, a JXL/PostScript polyglot executed by Ghostscript, and ImageMagick's MSVG/MSL coder to read local files from Discourse using only a Trust Level 0 account. First disclosed .

By

Key facts

IdentifiersTL-2026-3329, CVE-2026-55420, CVE-2026-55674
Also known asA JPEG, a Race, and a Ghost
SeverityHIGH
CVSS7.5 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H)
First disclosed
EPSSCVE-2026-55420: 0.6% (47.3th percentile); CVE-2026-55674: 0.5% (46.6th percentile)
Affected productsDiscourse Discourse
Weaknesses (CWE)CWE-78, CWE-367
ToolsGhostscript, ImageMagick
MITRE ATT&CK techniquesT1005 Data from Local System, T1027 Obfuscated Files or Information, T1036.008 Masquerade File Type, T1059 Command and Scripting Interpreter, T1059.007 JavaScript, T1078 Valid Accounts, T1083 File and Directory Discovery, T1190 Exploit Public-Facing Application, T1211 Exploitation for Defense Evasion
MotivationUNKNOWN
Target sectorstechnology, education, non-profit organisation, software-vendors, online-communities
Target regionsGlobal
Detection rules9 (1 shown free)
Sources8 cited sources

Detection coverage

As of 2026-10-12, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-3329 across Splunk SPL, Microsoft KQL and Sigma, covering 14 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 Spawned by ImageMagick - Discourse Polyglot Upload (CVE-2026-55420)

Behaviour-first detection of the core CVE-2026-55420 exploitation step: ImageMagick (dominant_color) spawning Ghostscript on an uploaded JXL/PostScript polyglot named .pdf. The PostScript renamefile operator then swaps the victim temp file during the TOCTOU window. Ghostscript should never be a child of ImageMagick on a hardened Discourse host because the PS coder is blocked by policy.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1190, T1059, T1036.008
  • Data sources: sysmon_for_linux, linux_process_creation
  • Severity: high
  • Confidence: high

Splunk SPL

index=linux sourcetype="Syslog:Linux-Sysmon/Operational" EventCode=1
```CVE-2026-55420 Discourse image pipeline: ImageMagick dominant_color handing a polyglot upload (JXL/PostScript, .pdf name) to Ghostscript despite the PS coder policy block```
(Image="*/gs" OR Image="*/gsc" OR Image="*/ghostscript")
(ParentImage="*/convert*" OR ParentImage="*/magick*" OR ParentImage="*/identify*" OR ParentImage="*/mogrify*")
| eval touches_upload_tmp=if(match(CommandLine, "(?i)(/tmp/|magick-|/uploads/)"), "yes", "no")
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as gs_cmdline values(ParentCommandLine) as imagemagick_cmdline by host User ParentImage Image touches_upload_tmp
| convert ctime(first_seen) ctime(last_seen)

Microsoft KQL

DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("gs", "gsc", "ghostscript")
| where InitiatingProcessFileName matches regex @"^(convert|magick|identify|mogrify)"
// CVE-2026-55420: ImageMagick delegating an uploaded polyglot to Ghostscript
| extend TouchesUploadTmp = ProcessCommandLine matches regex @"(?i)(/tmp/|magick-|/uploads/)"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, TouchesUploadTmp

Sigma

title: Ghostscript Spawned by ImageMagick in Discourse Image Pipeline (CVE-2026-55420)
id: 3b1f6c52-8a0e-4d1b-9c7a-1e2f3a4b5c01
status: experimental
description: Detects Ghostscript launched as a child of ImageMagick (convert, magick, identify, mogrify). In the CVE-2026-55420 chain the dominant_color step hands a JXL/PostScript polyglot uploaded with a .pdf name to Ghostscript even though the PS coder is blocked by policy.
references:
    - https://slcyber.io/research/a-jpeg-a-race-and-a-ghost-breaking-discourses-image-pipeline
    - https://github.com/discourse/discourse/security/advisories/GHSA-7wq5-jgww-5rw3
    - https://nvd.nist.gov/vuln/detail/cve-2026-55420
author: Threadlinqs Team
date: 2026-10-12
tags:
    - attack.initial_access
    - attack.t1190
    - attack.execution
    - attack.t1059
    - attack.defense_evasion
    - attack.t1036.008
    - cve.2026-55420
logsource:
    category: process_creation
    product: linux
detection:
    selection_gs:
        Image|endswith:
            - '/gs'
            - '/gsc'
            - '/ghostscript'
    selection_parent:
        ParentImage|contains:
            - '/convert'
            - '/magick'
            - '/identify'
            - '/mogrify'
    condition: selection_gs and selection_parent
falsepositives:
    - Legitimate PDF/PS/EPS rendering by ImageMagick on hosts that intentionally allow the PS/PDF coders
    - Document-conversion servers sharing the host with Discourse
level: high

Known false positives:

  • Hosts that intentionally allow ImageMagick to render PDF/PS/EPS files via Ghostscript
  • Batch document-thumbnailing jobs co-located with the Discourse container

Tuning notes: Requires Sysmon for Linux (or equivalent EDR) process telemetry from the Discourse host or container runtime. If PDF thumbnailing is legitimate, allowlist known parent command lines and alert only when the gs command line references temp files under /tmp or the uploads directory. Adjust the binary globs for distro-specific names such as convert-im6.q16.

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 and Gold in full, 2 calls a day on a free account)
  • MSVG/MSVG.GZ Upload Temp File Created - [indicator] TOCTOU Race (CVE-2026-55420) · unlock with TL Creds
  • Local File Read Staged as Image - exfil.png and Ghostscript Rename (CVE-2026-55420) · unlock with TL Creds
  • Rapid Upload Burst from Single Client - [indicator] TOCTOU Race (CVE-2026-55420) · unlock with TL Creds
  • [indicator] Application Process Spawning Shell with Download or Reverse-Shell Content · unlock with TL Creds
  • [indicator] Non-Integer color_scheme_id Cookie - Cache Poisoning XSS (CVE-2026-55674) · unlock with TL Creds
  • [indicator] modulepreload CSP-Bypass Gadget in Cookie - Sitewide JavaScript (CVE-2026-55674) · unlock with TL Creds
  • ImageMagick MSVG/MSL Coder and label:@ File Read - CVE-2026-55420 Collection Stage · unlock with TL Creds
  • Image-Pipeline Binary Outbound Connection - [indicator] CVE-2026-55420 Post-Exploitation · unlock with TL Creds

Indicators of compromise

As of 2026-10-12, Threadlinqs Intelligence tracks 14 indicators of compromise for TL-2026-3329.

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

Technical analysis

The flaw was patched before public disclosure; full technical details are public.

CVE-2026-55420 affects Discourse's server-side image-processing pipeline. Searchlight Cyber's research ("A JPEG, a Race, and a Ghost") describes an exploit chain with three cooperating components. First, a 236KB JPEG using libjpeg APP-marker padding stalls the jpegoptim optimize step for roughly 25 seconds, widening a race window. Second, a TOCTOU race exists between the FastImage validation / extract_image_info step and the later ImageMagick dominant_color step: a file uploaded with a .msvg extension and valid JPEG content is swapped for attacker-controlled SVG/MSL content after validation but before processing. Third, a polyglot that begins with a JPEG XL header whose bytes double as a PostScript comment (0x25 '%') and carries valid dimensions in a jxlc box passes FastImage, is uploaded with a .pdf extension, and is handed by ImageMagick's dominant_color to Ghostscript even though the PS coder is blocked by policy. The PostScript uses the renamefile operator (an atomic POSIX rename) to replace the victim temp file, making the race timing non-critical.

Once the replacement file is processed under the .msvg (or .msvg.gz, to bypass libxml2 null-byte encoding detection) name, ImageMagick's internal MSVG coder and MSL (Magick Scripting Language) are reached. An MSL payload such as <read filename="label:@/etc/passwd"/><write filename="/tmp/exfil.png"/> renders local file contents into an image; a second iteration copies the output over the victim temp file so it is stored as a normal upload whose URL is returned to the attacker. The result is arbitrary local file disclosure, not full server code execution, and the minimum privilege is Trust Level 0 (profile-picture upload) per the researchers, in default configuration per the press coverage.

Note on severity sources: the official GitHub advisory GHSA-7wq5-jgww-5rw3 (published 2026-06-30) and NVD/OSV describe the same CVE as remote code execution via PDF uploads under non-default configuration, CVSS 3.1 7.5 (AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H), CWE-78, with the workaround of removing .pdf from allowed upload extensions. The researchers' write-up demonstrates file read; the vendor rating reflects the broader potential of Ghostscript PostScript execution. No in-the-wild exploitation has been reported.

The same research reports a separate, distinct flaw, CVE-2026-55674 (CVSS 9.3 per aggregators): an unescaped color_scheme_id / dark_scheme_id cookie was interpolated into HTML and the anonymous-cache key omitted that cookie, so one unauthenticated request could poison the shared cache. A selector-hijack gadget (link[rel=modulepreload][data-plugin-name] processed by Discourse's boot script) bypassed the nonce-based strict-dynamic CSP and gave sitewide JavaScript execution for anonymous visitors. It was fixed in 2026.1.6, 2026.5.2, 2026.6.1 and 2026.7.0 with strict integer validation and adding the cookie to the cache key. Discourse reportedly powers 22,000+ communities.

MITRE ATT&CK techniques by tactic:

Collection

T1005 Data from Local System

Defense Evasion

T1027 Obfuscated Files or Information; T1036.008 Masquerade File Type; T1211 Exploitation for Defense Evasion

Execution

T1059 Command and Scripting Interpreter; T1059.007 JavaScript

Initial Access

T1078 Valid Accounts; T1190 Exploit Public-Facing Application

Discovery

T1083 File and Directory Discovery

Remediation

Patches

  • Discourse 2026.6.0, 2026.5.1, 2026.4.2, 2026.1.5 (CVE-2026-55420, commit ca5a7e06167561928556afa2f237d67e459c6914)
  • Discourse 2026.7.0, 2026.6.1, 2026.5.2, 2026.1.6 (CVE-2026-55674)

Immediate actions

  • Upgrade Discourse to 2026.6.0, 2026.5.1, 2026.4.2 or 2026.1.5 or later; for the color scheme cookie flaw use 2026.7.0, 2026.6.1, 2026.5.2 or 2026.1.6
  • Remove .pdf from the allowed upload file extensions list until patched
  • Review uploads from low-trust (TL0) accounts, especially .pdf/.msvg/.msvg.gz names containing JPEG or JXL content

Workarounds

  • Remove .pdf from the allowed upload extensions list (vendor workaround, GHSA-7wq5-jgww-5rw3)

Longer-term hardening

  • Adopt a default-deny ImageMagick policy.xml that blocks all delegates and allowlists only required coders
  • Remove or sandbox Ghostscript from image-processing hosts and containers
  • Run image processing in an isolated, least-privilege container with no access to application secrets

Affected and fixed versions

  • Discourse — Discourse
    Vulnerable versions: 2026.1.0 - 2026.1.4; 2026.4.0 - 2026.4.1; 2026.5.0
    Fixed in: 2026.1.5; 2026.4.2; 2026.5.1; 2026.6.0

Timeline

Last updated · revalidated 1× · latest source

  • Searchlight Cyber reports the image-pipeline chain to the Discourse security team.
  • Discourse confirms the report and deploys patches to hosted customers.
  • ImageMagick-related fix released publicly in 2026.6.0, 2026.5.1, 2026.4.2 and 2026.1.5; GHSA-7wq5-jgww-5rw3 published.
  • CVE-2026-55420 published (CVSS 3.1 7.5 High, CWE-78) describing RCE via PDF uploads under non-default configuration.
  • Fix for the separate color scheme cookie cache poisoning/XSS flaw (CVE-2026-55674) released publicly.
  • Searchlight Cyber technical write-up and press coverage detail the full file-read exploit chain; no in-the-wild exploitation reported.

Update history

Sources cited

Previous and next in vulnerability

AI-drafted from 8 cited 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