In the MsUpload extension, the msu-continue system message is inserted HTML without proper sanitization.
Reproduction Steps
- Make sure the WikiEditor and MsUpload extensions are enabled
Either:
- Go to any page and edit it.
- Make sure $wgUseXssLanguage is enabled the uselang=x-xss parameter is appended to the end of the URL, e.g. w/index.php?title=Test23523195&action=edit&uselang=x-xss
- Drag a file into the "Drop files here" section (called msu-dropzone when using x-xss) that has the same name as a file that is already uploaded onto the wiki
Or:
- Edit MediaWiki:Msu-continue to <script>alert("XSS!")</script>
- Edit any article
- Drag a file into the "Drop files here" section that has the same name as a file that is already uploaded onto the wiki
Cause
https://github.com/wikimedia/mediawiki-extensions-MsUpload/blob/53c02fd8cd1f54c94ba2043a91705f3ad5c898ca/resources/MsUpload.js#L184
The msu-continue message is retrieved without sanitization using the text output mode (the shorthand mw.msg() is used here) and provided to the .append() function of jQuery, which appends it to the element as raw HTML.


