Cyber Security News

Discourse ImageMagick Vulnerability Enables Arbitrary File Read Through Malicious Image Uploads

Security researchers have revealed a critical vulnerability in Discourse, tracked as CVE-2026-55420. This flaw could let a low-privileged user read and write files on the underlying server by exploiting the platform’s ImageMagick-based upload pipeline.

The issue was fixed for hosted customers in June 2026 and was publicly disclosed on June 30, 2026.

The vulnerability affects default Discourse deployments using its Docker-based stack. It requires only a Trust Level 0 account, the platform’s lowest user privilege tier.

An attacker could exploit specially crafted image uploads to trigger a time-of-check-to-time-of-use (TOCTOU) race condition, ultimately gaining access to sensitive local files from the server.

Discourse ImageMagick Vulnerability

Research published by Kevin Gervot of Searchlight Cyber identified several unsafe interactions among Discourse’s upload validation, ImageMagick, Ghostscript, FastImage, and temporary file handling processes.

Discourse checks whether an upload appears to be a supported image based on the provided filename or image type detection. Supported file extensions include JPEG, PNG, GIF, SVG, WebP, AVIF, HEIC, and JPEG XL (JXL).

However, the upload-processing workflow later invokes ImageMagick’s convert utility on a temporary path that retains the attacker-controlled file extension.

The researchers created a polyglot file, a single file accepted as more than one format, by combining JPEG XL-like structures with PostScript content.

This allowed the malicious file to pass Discourse’s image checks while still reaching the ImageMagick and Ghostscript processing paths used for PDF and PostScript handling. The proof of concept demonstrated PostScript execution through the dominant-color calculation in the upload pipeline.

Final full chain script execution (Source: SLCyber)

The more critical phase involved ImageMagick’s MSVG and MSL processing capabilities. MSL, or Magick Scripting Language, can instruct ImageMagick to read content from local paths and write it elsewhere.

In this chain, the researchers used a malicious upload to place an MSL payload in/tmp. Then they replaced a separate temporary upload file with an SVG trigger during processing.

To make this race practical, the researchers used a specially crafted JPEG file that prolonged the jpegoptim stage of Discourse’s image optimization workflow.

This delay widened the window for the target temporary file to be atomically replaced. When the later dominant-color operation processed the substituted SVG, it invoked ImageMagick’s internal SVG handling and loaded the attacker-controlled MSL payload.

The payload could read files such as /etc/passwd, save the content into an image, and then arrange for that image to be stored as a normal Discourse upload. The attack response would provide a URL to the uploaded result, eliminating the need for attackers to know the server’s filesystem layout.

This issue highlights why file-upload pipelines should not rely solely on file extensions, magic-byte detection, or format conversion as independent security measures. Complex parsers and delegate programs like Ghostscript significantly expand the attack surface, particularly when a file can be interpreted differently at various processing stages.

Complete Chain Summary (Source: SL Cyber)

Although the demonstrated impact was arbitrary file read/write, the researchers cautioned that sensitive files, such as Rails secrets or environment data, could be leveraged to escalate access, depending on deployment configuration and available deserialization paths.

Discourse addressed this issue by implementing a default-deny security policy for ImageMagick. The new configuration blocks unsafe delegates, including Ghostscript execution, and only allows the necessary coders required by Discourse. This limits uploaded content’s ability to access risky ImageMagick functionality.

Administrators are advised to promptly update Discourse, verify that their deployed ImageMagick policy blocks unnecessary coders and delegates, restrict low-trust account upload capabilities whenever possible, and monitor for suspicious uploads involving mismatched extensions, unusual JXL/PDF characteristics, oversized JPEG metadata, or unexpected temporary file activities.

Update defenses against new malware as soon as it appears. Integrate TI Feeds with data from 16K SOCs.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Microsoft Paint Vulnerability Allows Hackers to Execute Malicious Code Remotely Without User Interaction

Microsoft has announced a vulnerability in Windows Paint that could let unauthenticated attackers execute malicious…

21 minutes ago

ARTEX AI Framework Linked to Bank Breaches and Cloud Attacks Found Exposed Across Hundreds of Servers

An autonomous penetration-testing framework linked to South Korean banking breaches and cloud supply-chain attacks is…

51 minutes ago

Shopify Makes IP Allowlisting Mandatory for All Public Apps to Prevent Stolen API Token Abuse

Shopify is making IP allowlisting mandatory for all public apps to limit abuse of stolen…

1 hour ago

OpenAI’s New GPT-6 Cyber Finds 81 High-Severity Firefox Vulnerabilities and 948 Linux Kernel Exploits

OpenAI has introduced GPT-6 Cyber, a security-focused model built to find and validate exploitable vulnerabilities…

1 hour ago

OpenMatter Network Positions Decentralized Computing as an Alternative to Data Centers for AI

Melbourne, Florida, November 5th, 2026, CyberNewswire OpenMatter Network, a pioneer in decentralized infrastructure for agentic…

13 hours ago

China-Aligned Hackers Hijack Popular Sogou Keyboard Software to Secretly Install DarkVigil Malware

A China-aligned espionage group abused the update traffic of Sogou Input Method, one of China's…

18 hours ago