Page MenuHomePhabricator

XSS vulnerability in Special:CheckUserLog (CVE-2021-46150)
Closed, ResolvedPublicSecurity

Description

Is a bit similar to T285515: CVE-2021-41798: XSS vulnerability in Special:Search.

Steps to reproduce
  1. Perform a CheckUser request so that the CheckUser log is not empty.
  2. Set MediaWiki:October to <img src=x onerror=alert(1)>
  3. Go to Special:CheckUserLog
  4. Enjoy your alert box.

xss_checkuser.png (859×1 px, 89 KB)

This is possible due to the date value not being escaped.

$rowContent = $this->msg(
	'checkuser-log-entry-' . $row->cul_type,
	$user,
	$target,
	$lang->userTimeAndDate( wfTimestamp( TS_MW, $row->cul_timestamp ), $contextUser ),
	$lang->userDate( wfTimestamp( TS_MW, $row->cul_timestamp ), $contextUser ),
	$lang->userTime( wfTimestamp( TS_MW, $row->cul_timestamp ), $contextUser )
)->text();

Event Timeline

Zabe added projects: Vuln-XSS, CheckUser, User-Zabe.

proposed patch

sbassett changed Risk Rating from N/A to Low.
sbassett added subscribers: Mstyles, sbassett.

This should be fairly low-risk, at least within Wikimedia production, as one would have to be able to exploit various date-related messages or have elevated on-wiki privileges to edit objects within the MediaWiki namespace. Like many similar MediaWiki message issues (as tracked at T2212 and elsewhere), we can push the above patch (+1) through gerrit this Monday (2021-10-18) and have it go out with wmf.5 next week. @Mstyles and I can likely handle that.

sbassett edited subscribers, added: gerritbot; removed: GerritBot.

Change 731784 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] SECURITY: Escape date values

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

Change 731763 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CheckUser@REL1_37] SECURITY: Escape date values

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

Change 731764 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CheckUser@REL1_36] SECURITY: Escape date values

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

Change 731764 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_36] SECURITY: Escape date values

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

Change 731763 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_37] SECURITY: Escape date values

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

Change 731949 had a related patch set uploaded (by Reedy; author: Zabe):

[mediawiki/extensions/CheckUser@REL1_35] SECURITY: Escape date values

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

All of the backports have landed and everything is on wmf.5 in Wikimedia production, so I'm going to make this task public. This issue will be re-announced within the next supplemental security release.

sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".Oct 21 2021, 7:12 PM
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett moved this task from Security Patch To Deploy to Our Part Is Done on the Security-Team board.

Change 731949 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_35] SECURITY: Escape date values

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

mmartorana renamed this task from XSS vulnerability in Special:CheckUserLog to XSS vulnerability in Special:CheckUserLog (CVE-2021-46150).Jan 10 2022, 5:01 PM