Skip to main content

Discourse EUVDEUVD-2026-42665

| CVE-2026-55420 HIGH
OS Command Injection (CWE-78)
2026-07-09 security-advisories@github.com
8.1
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate and gain upload rights
  2. Delivery
    Upload crafted PDF with PostScript payload
  3. Exploit
    discourse-ai rasterizes PDF via ImageMagick
  4. Execution
    ImageMagick invokes Ghostscript delegate on payload
  5. Persist
    Shell commands execute
  6. Impact
    RCE 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – 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)
v2 Jul 13, 2026 - 14:45 cvss changed CVSS 8.1

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).

v1 Jul 09, 2026 - 18:31 CVSS 7.5

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

discourse 2026.5.0-latest, < 2026.5.1
discourse 2026.1.0-latest, < 2026.1.5
discourse 2026.4.0-latest, < 2026.4.2

Affected Packages

euvd discourse_2026_1_0_latest fix: 2026.1.5
euvd discourse_2026_4_0_latest fix: 2026.4.2
euvd discourse_2026_5_0_latest fix: 2026.5.1

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

Vendor (github) PRIMARY HIGH
NVD 8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.5 HIGH

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).

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Analysis Updated
Jul 13, 2026 - 14:45 vuln.today
v3 - CVSS changed
Analysis Updated
Jul 13, 2026 - 14:45 vuln.today
v2 - CVSS changed
CVSS changed
Jul 13, 2026 - 14:37 NVD
7.5 (HIGH) 8.1 (HIGH)
Patch available
Jul 09, 2026 - 19:01 EUVD

DescriptionNVD

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
Medium
popular open-source forum platform, but vulnerable AI-PDF path is optional
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2025-48954 HIGH POC
8.1 Jun 25

Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun

CVE-2022-46162 CRITICAL POC
9.8 Nov 30

discourse-bbcode is the official BBCode plugin for Discourse. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2026-27934 HIGH POC
8.7 Mar 19

Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and

CVE-2024-47773 HIGH POC
8.2 Oct 08

Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem

CVE-2026-26265 HIGH POC
7.5 Feb 26

Discourse versions prior to 2025.12.2, 2026.1.1, and 2026.2.0 contain an insecure direct object reference (IDOR) in the

CVE-2021-3138 HIGH POC
7.5 Jan 14

In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated

CVE-2026-26077 MEDIUM POC
6.5 Feb 26

Unauthenticated attackers can submit forged webhook payloads to multiple email provider integrations in Discourse versio

CVE-2023-38706 MEDIUM POC
6.5 Sep 15

Discourse is an open-source discussion platform. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploi

CVE-2024-53991 MEDIUM POC
5.9 Dec 19

Discourse is an open source platform for community discussion. Rated medium severity (CVSS 5.9), this vulnerability is r

CVE-2025-48877 CRITICAL
9.8 Jun 09

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

CVE-2023-47121 CRITICAL
9.8 Nov 10

Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2022-39355 CRITICAL
9.8 Oct 26

Discourse Patreon enables syncronization between Discourse Groups and Patreon rewards. Rated critical severity (CVSS 9.8

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy