Page MenuHomePhabricator

CVE-2025-61640: Stored XSS through system messages in Special:RecentChangesLinked (MW Core)
Closed, ResolvedPublicSecurity

Description

The rcfilters-filter-showlinkedfrom-option-label and rcfilters-filter-showlinkedto-option-label system messages are inserted as raw HTML in Special:RecentChangesLinked, allowing for stored XSS.

Reproduction steps

  1. Make sure $wgUseXssLanguage is set to true
  2. Go to /wiki/Special:RecentChangesLinked?uselang=x-xss

image.png (563×376 px, 27 KB)

image.png (563×376 px, 62 KB)

Cause

The messages are retrieved using mw.msg, which returns the contents unescaped. These values are passed to OOUI labels via HtmlSnippets, causing them to be inserted as raw HTML.
https://gerrit.wikimedia.org/g/mediawiki/core/+/4ad1e30eabe2a079b3d350264c610f7b87f88a6d/resources/src/mediawiki.rcfilters/ui/RclToOrFromWidget.js#20
https://gerrit.wikimedia.org/g/mediawiki/core/+/4ad1e30eabe2a079b3d350264c610f7b87f88a6d/resources/src/mediawiki.rcfilters/ui/RclToOrFromWidget.js#24

Additional information

Event Timeline

sbassett changed the task status from Open to In Progress.Aug 18 2025, 4:35 PM
sbassett reassigned this task from SomeRandomDeveloper to Jly.
sbassett triaged this task as Low priority.
sbassett moved this task from Incoming to In Progress on the Security-Team board.
sbassett added a project: SecTeam-Processed.

Thanks, this looks good and tested. We will get it deployed today.

Reedy renamed this task from Stored XSS through system messages in Special:RecentChangesLinked (MW Core) to CVE-2025-61641: Stored XSS through system messages in Special:RecentChangesLinked (MW Core).Sep 29 2025, 1:23 PM
Reedy renamed this task from CVE-2025-61641: Stored XSS through system messages in Special:RecentChangesLinked (MW Core) to CVE-2025-61640: Stored XSS through system messages in Special:RecentChangesLinked (MW Core).

Change #1193149 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/core@REL1_39] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193149

Change #1193149 merged by jenkins-bot:

[mediawiki/core@REL1_39] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193149

Change #1193173 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/core@REL1_43] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193173

Change #1193173 merged by jenkins-bot:

[mediawiki/core@REL1_43] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193173

Change #1193198 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/core@REL1_44] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193198

Change #1193198 merged by jenkins-bot:

[mediawiki/core@REL1_44] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193198

Change #1193220 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/core@master] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193220

Change #1193220 merged by jenkins-bot:

[mediawiki/core@master] SECURITY: Parse messages instead of inserting them as HTML

https://gerrit.wikimedia.org/r/1193220

sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Low.
sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.