CVE-2026-27740

Discourse has Stored XSS in AI Triage Automation

Published Mar 19, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
Discourse is an open-source discussion platform. Versions prior to 2026.3.0-latest.1, 2026.2.1, and 2026.1.2 have a cross-site scripting vulnerability that arises because the system trusts the raw output from an AI Large Language Model (LLM) and renders it using htmlSafe in the Review Queue interface without adequate sanitization. A malicious attacker can use valid Prompt Injection techniques to force the AI to return a malicious payload (e.g., tags). When a Staff member (Admin/Moderator) views the flagged post in the Review Queue, the payload executes. Versions 2026.3.0-latest.1, 2026.2.1, and 2026.1.2 contain a patch. As a workaround, temporarily disable AI triage automation scripts.

Analysis

AI-generated

Technical impact

Discourse versions prior to 2026.3.0-latest.1, 2026.2.1, and 2026.1.2 trust raw AI output when showing flagged posts in the Review Queue, rendering it with htmlSafe without proper sanitization. An attacker who can manipulate the AI’s prompt to produce malicious HTML or JavaScript will have that code executed in the browser of any staff member who opens the flagged post. This stored cross‑site scripting allows the attacker to hijack staff sessions, run arbitrary code inside the forum’s web context, and potentially compromise the entire installation.

Affected Systems

The vulnerability affects the Discourse open‑source discussion platform, specifically any instance running older releases before 2026.3.0-latest.1, 2026.2.1, or 2026.1.2. The corrected releases include the patch, as evidenced by the commits linked in the advisory.

Risk and Exploitability

The CVSS score is 5.1 and the EPSS probability is less than 1 %, indicating a moderate severity with low exploitation likelihood. However, because the flaw permits a prompt‑injection attack that stores malicious payloads for privileged users, a single successful injection grants persistent malicious code execution for any staff member viewing the content. The vulnerability is not listed in CISA’s KEV catalog, but because it directly affects privileged session integrity, timely remediation is critical.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a patched Discourse release (2026.3.0‑latest.1, 2026.2.1, or 2026.1.2).
  • If an upgrade cannot be performed immediately, temporarily disable the AI Triage Automation scripts to block automated content rendering.
  • Ensure that all AI‑generated output is sanitized before rendering in the Review Queue.
  • Monitor logs for suspicious or malformed input and XSS attempts.

Generated by OpenCVE AI on March 25, 2026 at 03:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:discourse:discourse:*:*:*:*:*:*:*:*
cpe:2.3:a:discourse:discourse:2026.3.0:*:*:*:latest:*:*:*
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Discourse
Discourse discourse
Vendors & Products Discourse
Discourse discourse
Type Values Removed Values Added
Description Discourse is an open-source discussion platform. Versions prior to 2026.3.0-latest.1, 2026.2.1, and 2026.1.2 have a cross-site scripting vulnerability that arises because the system trusts the raw output from an AI Large Language Model (LLM) and renders it using htmlSafe in the Review Queue interface without adequate sanitization. A malicious attacker can use valid Prompt Injection techniques to force the AI to return a malicious payload (e.g., tags). When a Staff member (Admin/Moderator) views the flagged post in the Review Queue, the payload executes. Versions 2026.3.0-latest.1, 2026.2.1, and 2026.1.2 contain a patch. As a workaround, temporarily disable AI triage automation scripts.
Title Discourse has Stored XSS in AI Triage Automation
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 20, 2026, 6:10 PM
Reserved
Feb 23, 2026, 6:37 PM
Status
Analyzed
Published
Mar 19, 2026, 9:17 PM
Modified
Jun 17, 2026, 10:27 AM