Page MenuHomePhabricator

i18n XSS vulnerability in message 'tux-nojs'
Closed, ResolvedPublicSecurity

Description

Discovered with $wgUseXssLanguage.

To reproduce:

  • Visit Special:Translate with ?uselang=x-xss.
  • Visit Special:AggregateGroups with ?uselang=x-xss
  • Visit Special:PageMigration with ?uselang=x-xss
  • Visit Special:PagePreparation with ?uselang=x-xss
  • Visit Special:ManageTranslatorSandbox with ?uselang=x-xss

Details

Risk Rating
Medium
Author Affiliation
Wikimedia Communities

Event Timeline

Seems to have been introduced in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/772056

Maybe ->escaped() would be better than ->parse() to match the original behavior.

Wouldn't parsing be better if it's possible? I can imagine some languages may have a convention of putting "foreign terms" like JavaScript in italics, for instance.

Wouldn't parsing be better if it's possible? I can imagine some languages may have a convention of putting "foreign terms" like JavaScript in italics, for instance.

Looking through the Message, MessageCache and Parser code within core, parse and escaped are very similar, though escaped does add the extra htmlspecialchars call, which is likely safer (and shouldn't affect strings like "JavaScript") and maybe a bit better at discouraging the use of html in message strings which, from a security perspective, we'd like to actively discourage unless critically necessary.

I updated the existing patch to used escaped instead of parsed. If we agree to move forward with this, I can upload this on gerrit so that we can address this issue faster.

Change #1014537 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/extensions/Translate@master] Change message formatting in 'tux-nojs' message

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

Change #1014537 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Change message formatting in 'tux-nojs' message

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

sbassett assigned this task to jhsoby.
sbassett lowered the priority of this task from High to Medium.
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 Medium.
sbassett moved this task from Incoming to Our Part Is Done on the Security-Team board.
sbassett added a project: SecTeam-Processed.