Severity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
Attacker needs only a normal account (PR:L) but relies on an admin impersonation action (UI:R); XSS crosses into the admin's higher-authority session (S:C) with full impact on that context.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
8DescriptionNVD
Discourse is an open-source discussion platform. Prior to 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5, a malicious second factor name on an attacker-controlled account was not escaped in the delete confirmation dialog, allowing stored cross-site scripting when an administrator impersonated that account. This issue is fixed in versions 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5.
AnalysisAI
Stored cross-site scripting in the Discourse discussion platform allows a low-privileged registered user to set a malicious two-factor authenticator name that executes JavaScript in an administrator's browser when that admin impersonates the account and opens the 2FA delete confirmation dialog. Affected builds are Discourse before 2026.6.0, 2026.5.1, 2026.4.2, and 2026.1.5, spanning the 2026.1.x through 2026.6.x release lines. There is no public exploit identified at time of analysis and the EPSS probability is low (0.39%), but the fix commit's regression test reveals the exact working payload, and successful exploitation runs in a full-admin context.
Technical ContextAI
The affected component is Discourse, a Ruby/Ember open-source community forum platform (CPE cpe:2.3:a:discourse:discourse). The root cause is CWE-79 (improper neutralization of input during web page generation): the Ember frontend controller preferences/second-factor.js interpolated the user-supplied second-factor method name directly into the delete confirmation dialog without HTML escaping. The upstream fix (commit 40de62cd and related 529e17d4, d92973e5, daea5214) wraps the value with escapeExpression(secondFactorMethod.name) from discourse/lib/utilities, converting the name to inert text. Because the 2FA name is attacker-controlled and persisted server-side, this is a stored (persistent) XSS rather than reflected, and it fires in the DOM of whichever session renders the dialog - here, an impersonating administrator.
RemediationAI
Vendor-released patch: upgrade to 2026.6.0, 2026.5.1, 2026.4.2, or 2026.1.5, whichever matches your release branch (release notes at https://github.com/discourse/discourse/releases/tag/v2026.6.0, /v2026.5.1, /v2026.4.2, and /v2026.1.5; fix commit 40de62cddadc65c328a1028ab999f3fa94adbfed). The patch simply HTML-escapes the second-factor name in the delete dialog and has no functional side effects, so it should be applied without hesitation. If an immediate upgrade is not possible, the concrete compensating control is to avoid using the administrator impersonation feature (Admin > Users > Impersonate) - since exploitation requires an admin to impersonate the attacker's account and open the 2FA delete confirmation, refraining from impersonating untrusted or suspicious accounts fully breaks the attack chain; the trade-off is loss of impersonation-based support workflows. Reviewing accounts for 2FA method names containing HTML/script markup can also surface planted payloads before they are triggered.
Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun
Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem
In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated
Discourse is an open-source discussion platform. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploi
Discourse is an open source platform for community discussion. Rated medium severity (CVSS 5.9), this vulnerability is r
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
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.1), this vulnerability is
Discourse is a platform for community discussion. Rated high severity (CVSS 8.8), this vulnerability is remotely exploit
Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and
Stored cross-site scripting in Discourse's Chat plugin allows an authenticated user to inject arbitrary HTML and JavaScr
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-42738