The poll-js-action-complete, poll-finished and poll-js-loading system messages are inserted as raw HTML by the PollNY extension, allowing for stored XSS.
Deleting polls
Reproduction steps
- Make sure $wgUseXssLanguage is set to true
- Create a poll
- Go to /wiki/Special:AdminPoll?uselang=x-xss
- Delete a poll
Cause
The message is retrieved unescaped using mw.msg and then inserted as raw HTML using jQuery's .html() function:
https://gerrit.wikimedia.org/g/mediawiki/extensions/PollNY/+/3805663fded6b92feaa8e67799a9b934b25d1274/resources/js/Poll.js#298
Changing a poll's status
Reproduction steps
- Make sure $wgUseXssLanguage is set to true
- Create a poll
- Go to /wiki/Special:AdminPoll?uselang=x-xss
- Change the status of a poll
Cause
The message is retrieved unescaped using mw.msg and then inserted as raw HTML using jQuery's .html() function:
https://gerrit.wikimedia.org/g/mediawiki/extensions/PollNY/+/3805663fded6b92feaa8e67799a9b934b25d1274/resources/js/Poll.js#276
poll-finished
Reproduction steps
- Edit MediaWiki:Poll-finished to <img src="" onerror="alert(1)">
- Create a poll
- Go to the poll's page
- Click on the "Skip" link and keep skipping further polls until there are no more polls left
Cause
LightBox.setText() takes raw HTML:
https://gerrit.wikimedia.org/g/mediawiki/extensions/PollNY/+/3805663fded6b92feaa8e67799a9b934b25d1274/resources/js/Poll.js#135
poll-js-loading
This one is only reproducible on Firefox on Mac, as the script checks for that before displaying the message, but it's quite obvious that it's an XSS as well, since setText takes HTML:
https://gerrit.wikimedia.org/g/mediawiki/extensions/PollNY/+/3805663fded6b92feaa8e67799a9b934b25d1274/resources/js/Poll.js#53
Additional information
- MediaWiki: 1.44.0
- PollNY: 3805663

