Page MenuHomePhabricator

CVE-2025-62702: Stored XSS through system messages in PageTriage
Closed, ResolvedPublicSecurity

Description

The pagetriage-new-page-feed-show-ip and pagetriage-new-page-feed-show-ip-not-found system messages are inserted as raw HTML by the PageTriage extension, allowing for stored XSS by inserting malicious HTML into the messages.

Reproduction steps for both vulnerabilities:

  1. Install PageTriage
  2. Install CheckUser
  3. Add the following to your LocalSettings.php (not all might be required):
$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;
$wgGroupPermissions['sysop']['investigate'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account-log'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account-no-preference'] = true;

pagetriage-new-page-feed-show-ip

Reproduction

  1. Edit MediaWiki:Pagetriage-new-page-feed-show-ip to <img src="" onerror="alert(1)">
  2. In a private browser tab, create a new page using a temporary account
  3. Go to Special:NewPagesFeed using an account with the sysop group

image.png (415×165 px, 6 KB)

Cause

The unescaped system message is passed into jQuery's .append() function, which inserts it as raw HTML:

https://gerrit.wikimedia.org/g/mediawiki/extensions/PageTriage/+/2e47e4bb436c8438389352303f8946939fc85cb6/modules/ext.pageTriage.showIp/showIp.js#69

pagetriage-new-page-feed-show-ip-not-found

Reproduction

  1. Add $wgCUDMaxAge = 1; to your LocalSettings.php so we can make CheckUser forget about the temporary account's IP later
  2. Edit MediaWiki:Pagetriage-new-page-feed-show-ip-not-found to <img src="" onerror="alert(2)">
  3. In a private browser tab, create a new page using a temporary account
  4. Run the CheckUser:purgeOldData maintenance script (which should delete the IP of the temporary account)
  5. Go to Special:NewPagesFeed using an account with the sysop group
  6. Click on the "Show IP" link next to the name of the temporary account

image.png (411×180 px, 6 KB)

Cause

The unescaped system message is passed into jQuery's .replaceWith() function, which inserts it as raw HTML:

https://gerrit.wikimedia.org/g/mediawiki/extensions/PageTriage/+/2e47e4bb436c8438389352303f8946939fc85cb6/modules/ext.pageTriage.showIp/showIp.js#80

Additional information

Event Timeline

+1 CR, we will look to get it deployed today

sbassett changed the task status from Open to In Progress.Jul 28 2025, 4:56 PM
sbassett triaged this task as Medium priority.
sbassett moved this task from Incoming to Security Patch To Deploy on the Security-Team board.
sbassett added a project: SecTeam-Processed.

Forgot to mention the task in the commit message, updated patch for when this is pushed through gerrit when the supplemental is being released:

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

[mediawiki/extensions/PageTriage@master] SECURITY: Escape system messages before inserting them into HTML

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

Reedy subscribed.

Needs a test update

Change #1189175 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] SECURITY: Escape system messages before inserting them into HTML

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

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

[mediawiki/extensions/PageTriage@REL1_44] SECURITY: Escape system messages before inserting them into HTML

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

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

[mediawiki/extensions/PageTriage@REL1_43] SECURITY: Escape system messages before inserting them into HTML

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

Change #1189236 abandoned by Reedy:

[mediawiki/extensions/PageTriage@REL1_43] SECURITY: Escape system messages before inserting them into HTML

Reason:

Not in REL1_43

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

Change #1189235 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@REL1_44] SECURITY: Escape system messages before inserting them into HTML

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

Mstyles renamed this task from Stored XSS through system messages in PageTriage to CVE-2025-62702: Stored XSS through system messages in PageTriage.Oct 21 2025, 5:37 AM
Mstyles changed the visibility from "Custom Policy" to "Public (No Login Required)".
Mstyles changed the edit policy from "Custom Policy" to "All Users".