Page MenuHomePhabricator

CVE-2025-62653: Stored XSS through system messages in PollNY
Closed, ResolvedPublicSecurity

Description

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

  1. Make sure $wgUseXssLanguage is set to true
  2. Create a poll
  3. Go to /wiki/Special:AdminPoll?uselang=x-xss
  4. Delete a poll

image.png (511×213 px, 27 KB)

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

  1. Make sure $wgUseXssLanguage is set to true
  2. Create a poll
  3. Go to /wiki/Special:AdminPoll?uselang=x-xss
  4. Change the status of a poll

image.png (511×213 px, 27 KB)

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

  1. Edit MediaWiki:Poll-finished to <img src="" onerror="alert(1)">
  2. Create a poll
  3. Go to the poll's page
  4. Click on the "Skip" link and keep skipping further polls until there are no more polls left

image.png (555×247 px, 11 KB)

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

Event Timeline

LightBox.setText is used with a system message in QuizGame too: https://gerrit.wikimedia.org/g/mediawiki/extensions/QuizGame/+/54352e7f398242788c579eb386b7c7316301b936/resources/js/QuizGame.js#412
I'll open a separate task later, but it should be considered whether the function should be renamed from setText to setHtml as text is supposed to be escaped.
Edit: Done with T403924

Thanks, @SomeRandomDeveloper. This patch can go through gerrit whenever you have the time.

Patch LGTM (not tested though, but I trust you), though I wonder...do the formats like .escaped(), .parse() etc. work just like that, i.e. don't you need to declare a dependency on mediawiki.jqueryMsg? (I think at one point you needed to, but that was literally years ago and core probably has changed a fair bit since that.)

Also re:Firefox on Mac special case handling, that could probably be removed altogether. It's a leftover from Adobe Flash (remember that thing?) days; see T391901 and whatnot. Basically Flash-capable browsers were served a Flash applet, others were served the same .gif image all other browsers these days are, and Mac on Firefox was treated differently because...I honestly don't know. What made sense back in 2006-2007 and that browser/OS/platform landscape doesn't necessarily make much sense anymore in 2025. :)

Patch LGTM (not tested though, but I trust you), though I wonder...do the formats like .escaped(), .parse() etc. work just like that, i.e. don't you need to declare a dependency on mediawiki.jqueryMsg? (I think at one point you needed to, but that was literally years ago and core probably has changed a fair bit since that.)

In theory you do need to, but in this case, there is already an indirect dependency on jQueryMsg through mediawiki.api. Though of course, it would be safer to still add an explicit dependency on jQueryMsg.

Updated patch with jQueryMsg as a dependency:

Also re:Firefox on Mac special case handling, that could probably be removed altogether. It's a leftover from Adobe Flash (remember that thing?) days; see T391901 and whatnot. Basically Flash-capable browsers were served a Flash applet, others were served the same .gif image all other browsers these days are, and Mac on Firefox was treated differently because...I honestly don't know. What made sense back in 2006-2007 and that browser/OS/platform landscape doesn't necessarily make much sense anymore in 2025. :)

Yes, that should probably be done afterwards in a separate non-security patch

In theory you do need to, but in this case, there is already an indirect dependency on jQueryMsg through mediawiki.api. Though of course, it would be safer to still add an explicit dependency on jQueryMsg.

Updated patch with jQueryMsg as a dependency:

Awesome, feel free to push this to gerrit whenever you're ready! 🎉

Yes, that should probably be done afterwards in a separate non-security patch

👍

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

[mediawiki/extensions/PollNY@master] SECURITY: Fix several stored i18n XSS vulnerabilities

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

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

[mediawiki/extensions/PollNY@REL1_44] SECURITY: Fix several stored i18n XSS vulnerabilities

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

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

[mediawiki/extensions/PollNY@REL1_43] SECURITY: Fix several stored i18n XSS vulnerabilities

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

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

[mediawiki/extensions/PollNY@REL1_39] SECURITY: Fix several stored i18n XSS vulnerabilities

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

Change #1185999 merged by Jack Phoenix:

[mediawiki/extensions/PollNY@master] SECURITY: Fix several stored i18n XSS vulnerabilities

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

Change #1186002 merged by Jack Phoenix:

[mediawiki/extensions/PollNY@REL1_39] SECURITY: Fix several stored i18n XSS vulnerabilities

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

Change #1186000 merged by jenkins-bot:

[mediawiki/extensions/PollNY@REL1_44] SECURITY: Fix several stored i18n XSS vulnerabilities

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

Change #1186001 merged by jenkins-bot:

[mediawiki/extensions/PollNY@REL1_43] SECURITY: Fix several stored i18n XSS vulnerabilities

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

Merged and backported, thanks @ashley!

sbassett removed a project: Patch-For-Review.
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Low.
sbassett renamed this task from Stored XSS through system messages in PollNY to CVE-2025-62653: Stored XSS through system messages in PollNY.Oct 17 2025, 10:22 PM