Page MenuHomePhabricator

CVE-2025-67477: Stored XSS through a system message in Special:ApiSandbox
Closed, ResolvedPublicSecurity

Description

The word-separator system message is inserted as HTML at Special:ApiSandbox if certain actions are selected.

Reproduction steps

  1. Edit MediaWiki:Word-separator to <img src=x onerror=alert(1)>
  2. Go to /wiki/Special:ApiSandbox#action=opensearch (all actions with a parameter using the limit type work, e.g. /wiki/Special:ApiSandbox#action=query&list=allimages)

image.png (443×184 px, 16 KB)

Cause

https://gerrit.wikimedia.org/g/mediawiki/core/+/e07d3c7a37fbc26d70562d153c1f7b0f5f07e044/resources/src/mediawiki.special.apisandbox/ApiSandboxLayout.js#99

Similar code is also present here, but while I tried various modules that had parameters marked as PARAM_ISMULTI => true, ppi.multi was never present in the API responses for me:
https://gerrit.wikimedia.org/g/mediawiki/core/+/e07d3c7a37fbc26d70562d153c1f7b0f5f07e044/resources/src/mediawiki.special.apisandbox/ApiSandboxLayout.js#144

Additional information

  • MediaWiki: 1.45.0-alpha

Event Timeline

This affects REL1_43, REL1_44 and master. While F66736767 (linked above) applies on REL1_44 and master, REL1_43 needs a separate patch as the affected code is in a different file:

sbassett changed the task status from Open to In Progress.EditedOct 8 2025, 3:14 PM
sbassett triaged this task as Low priority.
sbassett moved this task from Incoming to Security Patch To Deploy on the Security-Team board.
sbassett added a project: SecTeam-Processed.
sbassett subscribed.

CR+2, I think this can go out during next week's security deployment window.

Er, Monday is a US holiday. If someone non-US based would like to deploy this then, great, otherwise maybe we can target the following day or piggyback off of a backport window.

sbassett removed a project: Patch-For-Review.
sbassett added a parent task: Restricted Task.
Reedy renamed this task from Stored XSS through a system message in Special:ApiSandbox to CVE-2025-67477: Stored XSS through a system message in Special:ApiSandbox.Dec 8 2025, 5:53 PM

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

[mediawiki/core@REL1_43] SECURITY: Escape word-separator message in Special:ApiSandbox

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

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

[mediawiki/core@REL1_44] SECURITY: Escape word-separator message in Special:ApiSandbox

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

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

[mediawiki/core@REL1_45] SECURITY: Escape word-separator message in Special:ApiSandbox

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

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

[mediawiki/core@master] SECURITY: Escape word-separator message in Special:ApiSandbox

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

Change #1217295 merged by jenkins-bot:

[mediawiki/core@REL1_43] SECURITY: Escape word-separator message in Special:ApiSandbox

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

Change #1217306 merged by jenkins-bot:

[mediawiki/core@REL1_44] SECURITY: Escape word-separator message in Special:ApiSandbox

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

Change #1217323 merged by jenkins-bot:

[mediawiki/core@REL1_45] SECURITY: Escape word-separator message in Special:ApiSandbox

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

Change #1217332 merged by jenkins-bot:

[mediawiki/core@master] SECURITY: Escape word-separator message in Special:ApiSandbox

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

sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.
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.