
Key points
- Researchers disclosed two vulnerabilities in Discourse in June 2026, including a file read chain and a cache poisoning flaw.
- The file read exploit required only a Trust Level 0 account and chained JPEG processing delays with Ghostscript execution.
- Patches for both issues were released before publication, securing the platform for its 22,000+ communities.
Security researchers identified two significant vulnerabilities in Discourse, the popular open-source forum software. One flaw allowed basic users to read arbitrary server files by chaining multiple processing components. A second issue enabled cache poisoning that could execute JavaScript for anonymous visitors. Both problems were reported in June 2026 and patched before public disclosure.
In plain English
The file read exploit relied on a complex sequence of events within the image upload pipeline. Attackers uploaded a file that appeared to be an image but contained executable PostScript code. The system’s image checker accepted the file, but the processing tool interpreted it as a document. This mismatch allowed the attacker to bypass security policies that normally block such formats.
Researchers exploited a timing gap between when the system checked the file and when it processed it. By slowing down the initial check with a padded JPEG file, they created a window to swap the file with malicious content. This time-of-check to time-of-use flaw let the system read the harmful replacement instead of the original image.
The background
The technical report from Searchlight Cyber tested these attacks against default Discourse configurations. The platform powers more than 22,000 communities, making its upload handling a high-value target for attackers. The file read chain required only a Trust Level 0 account, the lowest possible user trust level, meaning any registered user could potentially attempt the exploit.
The attack did not rely on breaking Ghostscript’s sandbox or using a separate vulnerability in that tool. Instead, it leveraged how Discourse passed temporary file paths to ImageMagick without forcing a specific decoder. This allowed the malicious PostScript content to be interpreted correctly by Ghostscript, despite ImageMagick’s security policy blocking direct PostScript uploads.
What changes now
Patches for both the file read chain and the cache poisoning flaw have been released. Administrators should update their Discourse installations immediately to protect against these known issues. The fixes address the specific race condition and the cache handling logic that allowed the exploits to succeed. This ensures that the upload pipeline correctly validates and processes files without exposing server contents or enabling script injection.
What to do and how to stay safe: Discourse
- Verify that your Discourse instance is running the latest patched version to mitigate the file read and cache poisoning risks.
- Review server access logs for unusual activity during the window before patching, particularly from low-trust accounts.
- Ensure image processing dependencies like Ghostscript and ImageMagick are configured with strict security policies.
- Monitor for any anomalous file access patterns that might indicate exploitation of the timing gap described in the report.
Step-by-step guide: Emergency Patching: Correcting Five Common Operational Errors
General security guidance from the RedTeam Log newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
Can anonymous users exploit the file read vulnerability?
No, the file read chain required a registered account with Trust Level 0, though anonymous visitors were affected by the separate cache poisoning flaw.
Did the exploit require a vulnerability in Ghostscript?
No, researchers achieved the exploit without using a Ghostscript vulnerability or breaking its patched sandbox, relying instead on component interaction.
When were these vulnerabilities reported?
Researchers reported both issues in June 2026, and patches were released before the public publication of the findings.



