Page MenuHomePhabricator

CVE-2025-61657: Stored XSS through system messages in sticky header buttons in Vector
Closed, ResolvedPublicSecurity

Description

The JS implementation for copying button labels to the sticky header in the Vector skin unescapes HTML characters, allowing for stored XSS through system messages.

Reproduction

  1. Edit any of the affected messages (vector-2022-view-history, nstab-talk, unwatch, vector-2022-view-edit) to the following payload: <img src="" onerror="alert('Sticky Header Button XSS')">.
  2. Visit any mainspace article in the wiki using the Vector 2022 skin.

image.png (558×970 px, 50 KB)

Cause

Similarly to T396685, when copying the button labels, the innerHTML of the new element is set to the textContent of the old element: https://github.com/wikimedia/mediawiki-skins-Vector/blob/baac7c4788f174b8e985c7b691fcc159985330f6/resources/skins.vector.js/stickyHeader.js#L66
This unescapes any escaped HTML characters and causes the contents of the system messages to be interpreted as HTML.

Additional information

Event Timeline

+2 going to deploy this during the security deploy window today

+2 going to deploy this during the security deploy window today

Deployed

SecurityPatchBot triaged this task as Unbreak Now! priority.Aug 25 2025, 11:53 PM
Patch is blocking upcoming release

Patch 02-T398636.patch is currently failing to apply for the most recent code in the mainline branch of skins/Vector. This is blocking MediaWiki release 1.45.0-wmf.16(T396377)


If the patch needs to be rebased

A new version of the patch can be placed at the right location in the deployment server with the following Scap command:

REVISED_PATCH=<path_to_revised_patch>
scap update-patch --message-body 'Rebase to solve merge conflicts' /srv/patches/next/skins/Vector/02-T398636.patch "$REVISED_PATCH"

If the patch has been made public

The patch can be dropped in the deployment server with the following Scap command:

scap remove-patch --message-body 'Dropping patch already made public' /srv/patches/next/skins/Vector/02-T398636.patch
Aklapper lowered the priority of this task from Unbreak Now! to Needs Triage.Aug 26 2025, 9:18 AM

Thanks @Aklapper for getting this updated on deployment!

Reedy renamed this task from Stored XSS through system messages in sticky header buttons in Vector to CVE-2025-61657: Stored XSS through system messages in sticky header buttons in Vector.Sep 29 2025, 1:42 PM
SecurityPatchBot triaged this task as Unbreak Now! priority.Sep 30 2025, 1:31 AM
Patch is blocking this week's MediaWiki train!

Patch 02-T398636.patch is currently failing to apply for version 1.45.0-wmf.21 of skins/Vector. MW train cannot move forward until the patch is fixed (T405677)
Please note you can disregard any existing previous messages in this task from SecurityPatchBot concerning version 1.45.0-wmf.21. To unblock the train, run one of the commands in this message


If the patch needs to be rebased

A new version of the patch can be placed at the right location in the deployment server with the following Scap command:

REVISED_PATCH=<path_to_revised_patch>
scap update-patch --message-body 'Rebase to solve merge conflicts' /srv/patches/1.45.0-wmf.21/skins/Vector/02-T398636.patch "$REVISED_PATCH"

If the patch has been made public

The patch can be dropped in the deployment server with the following Scap command:

scap remove-patch --message-body 'Dropping patch already made public' /srv/patches/1.45.0-wmf.21/skins/Vector/02-T398636.patch

The patch went to be in conflict with Gerrit 1192262 - stickyHeader.js: Remove duplicate comment by @Reedy. I have resolved the trivial conflict and pushed the patch as:

/srv/patches/next/skins/Vector/02-T398636.patch
/srv/patches/1.45.0-wmf.21/skins/Vector/02-T398636.patch

I have committed the conflict resolution as 20d78d953ae259e13f26eefdebc7fecffdbb7be2

SomeRandomDeveloper lowered the priority of this task from Unbreak Now! to Needs Triage.Sep 30 2025, 11:31 PM

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

[mediawiki/skins/Vector@REL1_43] SECURITY: Insert sticky header labels as text instead of HTML

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

Change #1193204 merged by jenkins-bot:

[mediawiki/skins/Vector@REL1_43] SECURITY: Insert sticky header labels as text instead of HTML

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

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

[mediawiki/skins/Vector@REL1_44] SECURITY: Insert sticky header labels as text instead of HTML

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

Change #1193237 merged by jenkins-bot:

[mediawiki/skins/Vector@REL1_44] SECURITY: Insert sticky header labels as text instead of HTML

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

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

[mediawiki/skins/Vector@master] SECURITY: Insert sticky header labels as text instead of HTML

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

Change #1193269 merged by jenkins-bot:

[mediawiki/skins/Vector@master] SECURITY: Insert sticky header labels as text instead of HTML

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

sbassett triaged this task as Medium priority.Mon, Apr 6, 2:06 PM
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 Medium.
sbassett removed a project: Patch-For-Review.
sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.