Page MenuHomePhabricator

HTML injection / XSS from i18n message in WikibaseClient edit hook (CVE-2022-28208)
Closed, ResolvedPublicSecurity

Description

Steps to reproduce:

  • be on a wiki with WikibaseClient configured/enabled (including a connection to a repo)
  • put HTML into MediaWiki:colon-separator
  • edit a page which uses Wikibase entities (e.g. contains wikitext like {{#statements:P123|from=Q456}}, where P123 and Q456 are IDs of real, existing entities on the repo)

Outcome:
Wikibase shows the entities being used on the page below the edit form (above the template(s) used on this page); in doing this, it builds an Html::rawElement() using $context->msg( 'colon-separator' )->plain(), so the contents of the colon-separator message are not escaped. If you changed the message to <script>alert("xss")</script>:&#x20;, then the alert will be shown.

Impact:
Limited, I’d say. On an individual wiki, editing that message is guarded by the interfaceadmin right, and users with that right can also edit common.js directly; in Wikibase as a whole, the message contents are guarded by the “unexpected HTML” check that all translatewiki.net exports are subject to, so it should not be possible for a TWN user to get bad HTML into this message.

Event Timeline

Lucas_Werkmeister_WMDE added a subscriber: ItamarWMDE.

Deployed with @ItamarWMDE’s approval.

sbassett changed Author Affiliation from N/A to Wikimedia Deutschland.
sbassett changed Risk Rating from N/A to Low.
sbassett renamed this task from HTML injection / XSS from i18n message in WikibaseClient edit hook to HTML injection / XSS from i18n message in WikibaseClient edit hook (CVE-2022-28208).Mar 30 2022, 7:21 PM
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".Mar 31 2022, 5:43 PM
sbassett changed the edit policy from "Custom Policy" to "All Users".

Change 775912 had a related patch set uploaded (by SBassett; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] SECURITY: Escape message in hook handler

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

Change 775444 had a related patch set uploaded (by SBassett; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_37] SECURITY: Escape message in hook handler

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

Change 775445 had a related patch set uploaded (by SBassett; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_36] SECURITY: Escape message in hook handler

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

Change 775926 had a related patch set uploaded (by SBassett; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_35] SECURITY: Escape message in hook handler

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

Change 775926 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_35] SECURITY: Escape message in hook handler

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

Change 775912 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] SECURITY: Escape message in hook handler

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

Change 775444 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_37] SECURITY: Escape message in hook handler

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

Change 775445 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_36] SECURITY: Escape message in hook handler

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

Change 776032 had a related patch set uploaded (by Zabe; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_38] SECURITY: Escape message in hook handler

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

Change 776032 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_38] SECURITY: Escape message in hook handler

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