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
7DescriptionNVD
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.
AnalysisAI
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.
Technical ContextAI
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.
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.
Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun
Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem
In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated
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 is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.1), this vulnerability is
Stored cross-site scripting in the Discourse discussion platform allows a low-privileged registered user to set a malici
Discourse is a platform for community discussion. Rated high severity (CVSS 8.8), this vulnerability is remotely exploit
Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and
Same weakness CWE-78 – OS Command Injection
View allSame technique Command Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-42665