CVE-2026-27740
Received Received - Intake
Cross-Site Scripting in Discourse AI Review Queue Enables Code Execution

Publication date: 2026-03-19

Last updated on: 2026-03-25

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-19
Last Modified
2026-03-25
Generated
2026-05-07
AI Q&A
2026-03-19
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 3 associated CPEs
Vendor Product Version / Range
discourse discourse From 2026.1.0 (inc) to 2026.1.2 (exc)
discourse discourse From 2026.2.0 (inc) to 2026.2.1 (exc)
discourse discourse 2026.3.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-27740 is a cross-site scripting (XSS) vulnerability in the Discourse open-source discussion platform. It occurs because the system trusts raw output from an AI Large Language Model (LLM) and renders it using the htmlSafe function in the Review Queue interface without proper sanitization.

An attacker can exploit this by using prompt injection techniques to cause the AI to generate malicious HTML payloads, such as script tags. When a staff member (admin or moderator) views the flagged post in the Review Queue, the malicious payload executes, leading to potential XSS attacks.

The vulnerability affects Discourse versions prior to 2026.3.0-latest.1, 2026.2.1, and 2026.1.2. The issue was fixed by applying proper HTML escaping to the LLM outputs used in flag reasons, preventing execution of malicious scripts.


How can this vulnerability impact me? :

[{'type': 'paragraph', 'content': "This vulnerability can lead to cross-site scripting (XSS) attacks when a staff member views flagged posts in the Review Queue. The malicious payload injected via the AI-generated content can execute scripts in the context of the staff member's browser."}, {'type': 'list_item', 'content': 'Attackers can remotely exploit the vulnerability using network access.'}, {'type': 'list_item', 'content': 'The attack complexity is low and requires no special conditions.'}, {'type': 'list_item', 'content': 'The attacker needs low privileges but requires a staff member to view the malicious content.'}, {'type': 'list_item', 'content': 'The impact on confidentiality and integrity is low, with no impact on availability.'}, {'type': 'paragraph', 'content': 'Overall, the vulnerability could allow attackers to execute malicious scripts in the moderation interface, potentially compromising staff user sessions or performing unauthorized actions within the Discourse platform.'}] [2]


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

I don't know


What immediate steps should I take to mitigate this vulnerability?

To mitigate the vulnerability CVE-2026-27740, you should upgrade your Discourse installation to one of the patched versions: 2026.3.0-latest.1, 2026.2.1, or 2026.1.2.

If upgrading immediately is not possible, a recommended workaround is to temporarily disable the AI triage automation scripts to prevent the execution of malicious payloads in the Review Queue interface.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart