Discovered with $wgUseXssLanguage.
To reproduce:
Visit Special:ReadingLists with ?uselang=x-xss
| jhsoby | |
| Mar 19 2024, 9:36 AM |
| F42752044: T360407.patch | |
| Mar 19 2024, 1:57 PM |
Discovered with $wgUseXssLanguage.
To reproduce:
Visit Special:ReadingLists with ?uselang=x-xss
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Change message format for 'readinglists-error' | mediawiki/extensions/ReadingLists | master | +1 -1 |
Patch that should fix this:
diff --git a/src/SpecialReadingLists.php b/src/SpecialReadingLists.php index 1e71c78..ad1cb6b 100644 --- a/src/SpecialReadingLists.php +++ b/src/SpecialReadingLists.php @@ -25,7 +25,7 @@ class SpecialReadingLists extends UnlistedSpecialPage { $out->addModules( [ 'special.readinglist.scripts' ] ); $out->setPageTitleMsg( $this->msg( 'readinglists-special-title' ) ); $html = Html::errorBox( - $this->msg( 'readinglists-error' )->text(), + $this->msg( 'readinglists-error' )->parse(), '', 'reading-list__errorbox' );
Is this ok to upload via Gerrit?
CR+1. IMO, this is low-risk enough to just go through gerrit and hopefully ride next week's train.
@sbassett If I submit it via Gerrit, should I do so with the same commit message as in the patch above (including the "SECURITY:" tag and mention of XSS vulnerability), or should I be more vague?
I don't think it's required to use the SECURITY: prefix in this case. In most cases, we've considered these Message API sanitizations to be low-risk and have just done them publicly in gerrit (see T2212 and subtasks) as one would still need int-admin rights or to find some bypass of translatewiki.net to exploit them.
I don’t think that’s quite right? You only need sysop rights to exploit these, and they effectively allow sysops to escalate to interface-admin. (Non-JS pages in the MediaWiki namespace require editinterface, which is granted to sysops; interface admins additionally have editsitejs.)
Ah, ok. As long as it still requires elevated privileges to actually edit affected messages, then I would still consider it to be low-risk to fix most of these types of XSSes publicly.
Change #1014541 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):
[mediawiki/extensions/ReadingLists@master] Change message format for 'readinglists-error'
Change #1014541 merged by jenkins-bot:
[mediawiki/extensions/ReadingLists@master] Change message format for 'readinglists-error'