Page MenuHomePhabricator

CVE-2026-22711: Stored XSS through system messages in WikiLove
Closed, ResolvedPublicSecurity

Description

Multiple system messages in WikiLove can be abused by users with the editinterface permission to execute arbitrary JS.

wikilove-commons-text/wikilove-commons-url

  1. Edit MediaWiki:Wikilove-commons-text to <div class="$1">Hover over me!</div>
  2. Edit MediaWiki:Wikilove-commons-url to /onmouseenter=alert(1)//
  3. Make sure you have WikiLove enabled in your preferences
  4. Go to a user page
  5. Click on the heart icon next to the "View history" link
  6. Click on "Make your own"
  7. Hover over the text that says "Hover over me!"

Pasted image 20260129194109.png (929×672 px, 88 KB)

wikilove-terms/wikilove-terms-url

The same steps as above can be done with wikilove-terms and wikilove-terms-url. The element is shown after previewing an award.

It's also possible to use a javascript: link in either wikilove-commons-url or wikilove-terms-url.

Cause

https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiLove/+/93b9281a3f7f4d270cf510a3f28a48a6a6404d63/resources/ext.wikiLove.startup/WikiLoveDialog.vue#154
It's not safe to perform string replacements on HTML, especially when inserting another HTML element.

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLove/+/93b9281a3f7f4d270cf510a3f28a48a6a6404d63/resources/ext.wikiLove.startup/wikiLove.js#69
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLove/+/93b9281a3f7f4d270cf510a3f28a48a6a6404d63/resources/ext.wikiLove.startup/wikiLove.js#73
The URL protocol is not validated.

Additional information

MW: 1.46.0-alpha (2633444)
WikiLove: 1.3.1 (93b9281)

Event Timeline

sbassett added a project: SecTeam-Processed.
sbassett subscribed.

Patch looks fine to me. I think we can get this deployed to Wikimedia production during the ad-hoc security deployment window we have scheduled tomorrow (2026-02-04), after the late backport window.

sbassett changed the task status from Open to In Progress.Feb 4 2026, 9:18 PM
sbassett triaged this task as Medium priority.

Patch looks fine to me. I think we can get this deployed to Wikimedia production during the ad-hoc security deployment window we have scheduled tomorrow (2026-02-04), after the late backport window.

Deployed

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

[mediawiki/extensions/WikiLove@master] SECURITY: Sanitize URLs and use jQuery to build links

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

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

[mediawiki/extensions/WikiLove@REL1_45] SECURITY: Sanitize URLs and use jQuery to build links

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

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

[mediawiki/extensions/WikiLove@REL1_44] SECURITY: Sanitize URLs and use jQuery to build links

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

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

[mediawiki/extensions/WikiLove@REL1_43] SECURITY: Sanitize URLs and use jQuery to build links

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

Change #1251947 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@master] SECURITY: Sanitize URLs and use jQuery to build links

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

Change #1251950 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@REL1_44] SECURITY: Sanitize URLs and use jQuery to build links

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

Change #1251949 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@REL1_45] SECURITY: Sanitize URLs and use jQuery to build links

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

Change #1251952 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@REL1_43] SECURITY: Sanitize URLs and use jQuery to build links

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

Mstyles renamed this task from Stored XSS through system messages in WikiLove to CVE-2026-22711: Stored XSS through system messages in WikiLove.Apr 7 2026, 6:40 PM
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".Apr 8 2026, 3:05 PM
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Medium.
sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.