The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-27740

CVE-2026-27740: Discourse AI LLM XSS Vulnerability

CVE-2026-27740 is a cross-site scripting flaw in Discourse that exploits AI LLM output in the Review Queue interface. Attackers can inject malicious payloads via prompt injection. This article covers technical details, affected versions, impact, and mitigation steps.

Published: March 19, 2026

CVE-2026-27740 Overview

CVE-2026-27740 is a Cross-Site Scripting (XSS) vulnerability in Discourse, the popular open-source discussion platform. The vulnerability exists in the AI-powered content triage feature, where raw output from a Large Language Model (LLM) is rendered using htmlSafe in the Review Queue interface without adequate sanitization. This allows attackers to leverage prompt injection techniques to force the AI to return malicious JavaScript payloads that execute when Staff members (Administrators or Moderators) view flagged posts.

Critical Impact

Attackers can execute arbitrary JavaScript in the browser context of privileged Staff users, potentially leading to session hijacking, administrative account compromise, or unauthorized configuration changes on Discourse installations using AI triage automation.

Affected Products

  • Discourse versions prior to 2026.3.0-latest.1
  • Discourse versions prior to 2026.2.1
  • Discourse versions prior to 2026.1.2

Discovery Timeline

  • 2026-03-19 - CVE-2026-27740 published to NVD
  • 2026-03-19 - Last updated in NVD database

Technical Details for CVE-2026-27740

Vulnerability Analysis

This vulnerability represents an emerging attack surface where AI/LLM integrations introduce new security risks into web applications. The core issue stems from a trust boundary violation: the Discourse AI plugin treats LLM-generated content as safe when it should be considered untrusted user input. When the AI triage automation processes flagged posts, it passes the LLM's response directly into an internationalization (I18n) template that gets rendered in the Review Queue using htmlSafe, which explicitly bypasses HTML encoding protections.

The attack chain requires an attacker to craft malicious post content designed to manipulate the LLM through prompt injection. When the AI processes this content for triage, it can be coerced into including malicious HTML or JavaScript in its response. Since Staff members rely on the Review Queue to moderate content, they will inevitably view the flagged post, triggering the XSS payload execution in their authenticated browser session.

Root Cause

The root cause is the absence of output sanitization on LLM-generated content before it is rendered in the browser. The vulnerable code paths in multiple files (llm_triage.rb, flag_post.rb) directly interpolated the llm_response and automation_name variables into the I18n template without applying HTML escaping. This violates the security principle that all dynamic content—regardless of source—must be sanitized before being rendered as HTML.

Attack Vector

The attack is network-based and requires an authenticated user account (low privileges) to submit the malicious content. The exploitation requires user interaction, as a Staff member must view the flagged post in the Review Queue. The attack flow proceeds as follows:

  1. Attacker creates a post containing prompt injection payloads designed to manipulate the LLM
  2. The AI triage automation processes the post and the LLM is tricked into including malicious script tags in its response
  3. The response is stored as part of the flag reason without sanitization
  4. When a Staff member opens the Review Queue and views the flagged post, the malicious JavaScript executes in their browser
  5. The attacker can then steal session tokens, perform actions as the administrator, or further compromise the platform

The following patch demonstrates how the fix properly escapes LLM output using ERB::Util.html_escape:

ruby
               I18n.t(
                 "discourse_automation.scriptables.llm_triage.flagged_post",
                 base_path: Discourse.base_path,
-                llm_response: result,
+                llm_response: ERB::Util.html_escape(result),
                 automation_id: automation&.id.to_s,
-                automation_name: automation&.name.to_s,
+                automation_name: ERB::Util.html_escape(automation&.name.to_s),
               )

             if !flagged_by_tool

Source: GitHub Commit Update

Detection Methods for CVE-2026-27740

Indicators of Compromise

  • Unusual script tags or JavaScript code appearing in flag reasons within the Review Queue
  • Unexpected HTTP requests or outbound connections from Staff browsers after viewing flagged content
  • Posts containing suspicious prompt injection patterns such as "ignore previous instructions" or embedded HTML tags
  • Anomalous administrative actions performed without corresponding legitimate administrator sessions

Detection Strategies

  • Implement Content Security Policy (CSP) headers to detect and block inline script execution attempts
  • Monitor web application logs for patterns indicating prompt injection attempts in user-submitted content
  • Review browser console logs from Staff workstations for JavaScript errors or unauthorized script execution
  • Audit the reviewable_scores database table for flag reasons containing HTML or script tags

Monitoring Recommendations

  • Enable detailed logging for all AI triage automation activities and flag creation events
  • Set up alerts for any content in the Review Queue containing potential XSS vectors like <script>, <img onerror, or event handlers
  • Monitor for unusual session activity from Staff accounts, particularly after Review Queue interactions
  • Implement real-time monitoring of CSP violation reports to detect exploitation attempts

How to Mitigate CVE-2026-27740

Immediate Actions Required

  • Update Discourse to version 2026.3.0-latest.1, 2026.2.1, or 2026.1.2 immediately
  • If immediate patching is not possible, disable AI triage automation scripts as a temporary workaround
  • Review Recent Review Queue activity for any suspicious flag reasons that may contain script content
  • Invalidate and rotate Staff session tokens if exploitation is suspected

Patch Information

Discourse has released patches across multiple release tracks. The fix applies ERB::Util.html_escape to all LLM-generated content before it is interpolated into templates. The patches address the vulnerability in multiple code paths including plugins/discourse-ai/lib/automation/llm_triage.rb, plugins/discourse-ai/lib/personas/tools/flag_post.rb, and plugins/discourse-ai/lib/agents/tools/flag_post.rb.

For detailed patch information, refer to:

  • GitHub Security Advisory
  • GitHub Commit Fix
  • GitHub Commit Change

Workarounds

  • Temporarily disable AI triage automation scripts via the Discourse admin panel until patching is complete
  • Implement a Web Application Firewall (WAF) rule to strip or block potential XSS payloads in Review Queue responses
  • Restrict Review Queue access to a minimal number of Staff members until the vulnerability is patched
  • Enable strict Content Security Policy headers to mitigate the impact of any successful XSS exploitation
bash
# Disable AI triage automation via Rails console (temporary workaround)
cd /var/discourse
./launcher enter app
rails c
# Disable specific automation scripts
Automation.where(script: "llm_triage").update_all(enabled: false)

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechDiscourse

  • SeverityMEDIUM

  • CVSS Score5.1

  • Known ExploitedNo
  • CVSS 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Fix

  • GitHub Commit Change

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-32243: Discourse XSS Vulnerability

  • CVE-2026-32273: Discourse XSS Vulnerability

  • CVE-2026-32607: Discourse XSS Vulnerability

  • CVE-2026-33411: Discourse Stored XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English