Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate and gain upload rights
-
DeliveryUpload crafted PDF with PostScript payload
-
Exploitdiscourse-ai rasterizes PDF via ImageMagick
-
ExecutionImageMagick invokes Ghostscript delegate on payload
-
PersistShell commands execute
-
ImpactRCE as Discourse server process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a non-default deployment: the discourse-ai plugin must be installed and enabled with an LLM/vision model configured, since the vulnerable ImageMagick rasterization branch in pdf_to_text.rb only runs when @llm_model is set - plain instances that only extract PDF text never reach it. The attacker must be able to upload a PDF, which on default Discourse requires a registered/logged-in account (authentication requirements not fully confirmed from the PR:N vector, which conflicts with normal upload behavior), and the server's ImageMagick must permit the PDF/PostScript external delegate (Ghostscript) - the exact condition the patched policy.xml removes. Limiting factors: dependency on the optional AI PDF feature, need for upload privileges, and reliance on an ImageMagick/Ghostscript configuration that allows delegate execution; these make the exploitable population a small subset of all Discourse installs. |
| Impact | Signals are mixed and point to a real-but-conditional risk rather than a mass-exploitation event. The CVSS 3.1 score is 8.1 (AV:N/AC:H/PR:N/UI:N/C:H/I:H/A:H): network-reachable with full CIA impact, but AC:H reflects the required non-default configuration. EPSS is low (0.33%, 25th percentile) and the vulnerability is not in CISA KEV, with no public exploit identified at time of analysis, so there is no evidence of active or widespread exploitation. The dependency on the discourse-ai plugin plus a configured LLM vision model sharply narrows the exposed population - most Discourse installs do not reach the vulnerable code path. Note a discrepancy worth verifying: the NVD/vendor vector states PR:N (unauthenticated), yet uploading a PDF to Discourse normally requires a logged-in account, so real-world exploitation more likely requires at least a low-privilege registered user (PR:L) unless anonymous/guest uploads are enabled. Net: prioritize patching where discourse-ai PDF processing is enabled, but this is not a drop-everything internet-wide emergency for typical deployments. |
| Exploit ScenarioDerived | On a Discourse instance running discourse-ai with a configured LLM vision model, an attacker with upload rights posts a specially crafted PDF; when the AI pipeline rasterizes it via ImageMagick, the embedded PostScript/delegate payload executes shell commands on the server, giving code execution as the Discourse process. No public exploit is identified at time of analysis, though the ImageMagick/Ghostscript delegate technique is well documented; AC:H reflects that the target must have the non-default AI PDF configuration enabled. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Jul 13, 2026
Remote code execution in Discourse (via the discourse-ai plugin's PDF-to-text feature) allows an attacker who can upload a crafted PDF to run arbitrary commands on the server, but only in non-default configurations where an LLM vision model is configured. The flaw is a CWE-78 OS command injection reached when uploaded PDFs are rasterized through ImageMagick, which in turn invokes an external delegate (Ghostscript) on attacker-controlled input. It is not in CISA KEV and has no public exploit identified at time of analysis; EPSS is low at 0.33% (25th percentile), and vendor patches exist across all supported release lines.
Earlier versions of this analysis (2)
Remote code execution in Discourse discussion platform arises when the discourse-ai plugin is configured with an LLM model, causing uploaded PDFs to be rendered into images by ImageMagick, which invokes its Ghostscript delegate and can be coerced into executing attacker-controlled commands. Affected builds are Discourse before 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5. There is no public exploit identified at time of analysis and it is not on CISA KEV; EPSS is low (0.33%, 25th percentile), consistent with the non-default configuration requirement and high attack complexity (CVSS 8.1, AC:H).
Remote command execution in Discourse discussion platform versions prior to 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5 allows an authenticated user to achieve RCE on the server by uploading a malicious PDF when the instance runs a specific non-default configuration. Classified as OS command injection (CWE-78), the flaw stems from unsafe handling of PDF uploads passed to an external processing utility. No public exploit has been identified at time of analysis, and the issue is not listed in CISA KEV; the GitHub Security Advisory GHSA-7wq5-jgww-5rw3 and fixed release tags are the primary sources.
RemediationAI
Vendor-released patch: upgrade to 2026.6.0, 2026.5.1, 2026.4.2, or 2026.1.5 (whichever matches your release train), per advisory GHSA-7wq5-jgww-5rw3 and the release tags at https://github.com/discourse/discourse/releases; the underlying change is commit ca5a7e06167561928556afa2f237d67e459c6914. If you cannot patch immediately, the most direct compensating control is to disable the discourse-ai PDF-to-text/vision pathway (unset the configured LLM vision model / disable AI PDF processing), which removes the ImageMagick PDF-rasterization call at the cost of losing AI OCR of PDFs. As an environment-level control you can replicate the fix's hardened ImageMagick policy (config/imagemagick/policy.xml) to deny all external delegates (Ghostscript) and restrict coders to the needed formats, and set MAGICK_CONFIGURE_PATH to point at it; the trade-off is that any legitimate feature relying on a now-denied coder or delegate will break, so test image/HEIC/SVG-dimension handling after applying it. Restricting who may upload PDFs (e.g. trust-level gating, disabling anonymous uploads) reduces but does not eliminate exposure.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 packages in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerable code lives in plugins/discourse-ai/lib/utils/pdf_to_text.rb, which - when an LLM model is configured (@llm_model set) - shells out to ImageMagick's magick binary with -density 300 on the uploaded PDF path to convert each page to a PNG before OCR/vision extraction. ImageMagick historically dispatches PDF/PostScript handling to an external delegate program (Ghostscript), and crafted PDF/PostScript content can smuggle shell commands through that delegate pipeline, yielding OS command injection (CWE-78), the ImageMagick/Ghostscript 'delegate' RCE class. The CPE data scopes this to cpe:2.3:a:discourse:discourse across multiple release trains, fixed at 2026.6.0. The fix removes the ImageMagick PDF-rasterization path entirely (falling back to plain PDF::Reader text extraction), forces all ImageMagick invocations through a locked-down policy.xml (loaded via MAGICK_CONFIGURE_PATH, enforced by an initializer that refuses to boot if the variable is overridden), disables all external delegates and filters, blocks path/@-indirection tricks, and denies every coder except an explicit allowlist of raster/SVG-dimension formats.
Know when Discourse gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Network-delivered upload (AV:N) but requires the non-default discourse-ai PDF/vision config (AC:H) and normally a logged-in uploader (PR:L); delegate RCE yields full host impact (C/I/A:H).
Primary rating from Vendor (github).
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
Discourse is an open-source discussion platform. Prior to 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5, under certain non-default configurations, processing of PDF uploads could be exploited to obtain RCE on the server. This issue is patched in 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5.
Executive ViewAI
Discourse's discourse-ai plugin contains a remote code execution vulnerability (CVE-2026-55420, CVSS 8.1) in its PDF processing feature that allows attackers uploading crafted PDFs to execute commands on the server when LLM vision features are enabled. Organizations running Discourse with this plugin risk complete server compromise and potential breach of community data without patching.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun
discourse-bbcode is the official BBCode plugin for Discourse. Rated critical severity (CVSS 9.8), this vulnerability is
Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and
Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem
Discourse versions prior to 2025.12.2, 2026.1.1, and 2026.2.0 contain an insecure direct object reference (IDOR) in the
In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated
Unauthenticated attackers can submit forged webhook payloads to multiple email provider integrations in Discourse versio
Discourse is an open-source discussion platform. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploi
Discourse is an open source platform for community discussion. Rated medium severity (CVSS 5.9), this vulnerability is r
Discourse versions prior to 3.4.4 (stable), 3.5.0.beta5 (beta), and 3.5.0.beta6-dev (tests-passed) contain a critical vu
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is
Discourse Patreon enables syncronization between Discourse Groups and Patreon rewards. Rated critical severity (CVSS 9.8
EUVD-2026-42665
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB