Skip to main content
Vulnerability Database/CVE-2025-54411

CVE-2025-54411: Discourse Platform XSS Vulnerability

CVE-2025-54411 is a cross-site scripting flaw in Discourse that affects welcome banner user name strings for logged in users. This post explains its impact, affected versions, and mitigation steps.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-54411 Overview

CVE-2025-54411 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in Discourse, an open-source discussion platform. The flaw resides in the welcome banner that renders the display name of logged-in users. A user with a crafted display name can inject script content that executes in their own browser session or in the browser of an administrator who impersonates them. The issue is fixed in version 3.5.0.beta8.

Critical Impact

An authenticated user can store script content in their display name that executes when the welcome banner renders, affecting that user or an admin actively impersonating the account.

Affected Products

  • Discourse 3.5.0.beta1 through 3.5.0.beta7
  • Discourse beta builds prior to 3.5.0.beta8
  • Self-hosted and managed Discourse instances running vulnerable beta releases

Discovery Timeline

  • 2025-08-19 - CVE CVE-2025-54411 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-54411

Vulnerability Analysis

The vulnerability is a stored XSS flaw in the Discourse welcome banner component. The banner interpolates a user's display name using the preferred_display_name placeholder in the welcome_banner.header.logged_in_members site text. The front-end rendered this value without sanitizing HTML, allowing script content embedded in a display name to execute at render time.

Because the banner renders for the logged-in user themselves, the direct victim is typically the account owner. However, when an administrator uses Discourse's impersonation feature to assume a user session, the injected payload executes in the admin's authenticated context. That expands the practical impact to privileged account takeover scenarios.

Root Cause

The root cause is missing output sanitization in the welcome-banner.gjs component. User-controlled display names were inserted into the welcome banner template without passing through Discourse's HTML sanitizer. The fix introduces an import of sanitize from discourse/lib/text and applies it to the interpolated name value before rendering.

Attack Vector

An attacker needs an authenticated Discourse account and the ability to set a display name containing HTML or script markup. Exploitation requires user interaction, specifically that the victim load a page where the welcome banner renders. The attack scope is limited to the victim's own session or an impersonating admin's session, not arbitrary site visitors.

text
// Patch excerpt - app/assets/javascripts/discourse/app/components/welcome-banner.gjs
 import bodyClass from "discourse/helpers/body-class";
 import concatClass from "discourse/helpers/concat-class";
 import { prioritizeNameFallback } from "discourse/lib/settings";
+import { sanitize } from "discourse/lib/text";
 import { defaultHomepage, escapeExpression } from "discourse/lib/utilities";
 import I18n, { i18n } from "discourse-i18n";

Source: GitHub Commit a3374d2850f

Detection Methods for CVE-2025-54411

Indicators of Compromise

  • User profile name or display name fields containing HTML tags such as <script>, <img onerror=...>, or event handler attributes.
  • Browser console errors or unexpected network requests originating from pages that render the welcome banner.
  • Admin session anomalies occurring shortly after an impersonation event against a suspicious account.

Detection Strategies

  • Query the Discourse users table for display name values containing <, >, or on[a-z]+= patterns.
  • Review web server access logs for requests to administrative endpoints originating from a session immediately after an /admin/impersonate action.
  • Audit recently created or recently renamed accounts for display names that deviate from standard character sets.

Monitoring Recommendations

  • Enable and review Discourse staff action logs for impersonation events correlated with new user registrations.
  • Monitor Content Security Policy (CSP) violation reports for inline script execution originating from banner rendering.
  • Alert on bulk display name changes across accounts within short time windows.

How to Mitigate CVE-2025-54411

Immediate Actions Required

  • Upgrade Discourse to 3.5.0.beta8 or later, which includes the sanitizer fix in welcome-banner.gjs.
  • Audit existing user display names for HTML or script content and normalize or reset suspicious entries.
  • Restrict administrator use of the impersonation feature until the upgrade is complete.

Patch Information

The fix is implemented in commit a3374d2850f and documented in GitHub Security Advisory GHSA-5mm6-j5vq-6884. The patch imports sanitize from discourse/lib/text and applies it to the interpolated display name before rendering the welcome banner.

Workarounds

  • Temporarily modify the welcome_banner.header.logged_in_members site text to remove the preferred_display_name placeholder.
  • Avoid impersonating untrusted user accounts until the upgrade is deployed.
  • Enforce a strict Content Security Policy that disallows inline script execution to reduce the impact of stored XSS payloads.
bash
# Example: configure a stricter Content-Security-Policy in Discourse admin settings
# Admin > Settings > Security > content security policy script src
# Remove 'unsafe-inline' and restrict to trusted origins
content_security_policy_script_src: "'self' https://your-cdn.example.com"

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.