Last modified: 2012-06-28 21:12:29 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39622, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37622 - Correctly escape uselang attribute to prevent xss in Extension:Translate
Correctly escape uselang attribute to prevent xss in Extension:Translate
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
unspecified
All All
: Highest major (vote)
: ---
Assigned To: Niklas Laxström
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-15 07:51 UTC by Liangent
Modified: 2012-06-28 21:12 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2012-06-15 07:51:57 UTC
A security bug which is exactly the same as bug 36938, fixed in our latest release, was introduced in Gerrit change #11588.
Comment 1 Liangent 2012-06-15 07:53:59 UTC
TWN maintainers should care this if it's using master version.
Comment 2 Chris Steipp 2012-06-27 18:38:05 UTC
Liangent, I haven't been able to verify that the change actually allows for xss, but it would be good to protect against it.

SPQRobin, maybe update the return to use the Xml class, something like:

$row = Xml::wrapClass( Xml::element( 'b', null, $legend ), 'mw-pt-languages-label', 'td' );
$row .= Xml::element('td', array( 'class'=>'mw-pt-languages-list' ), $languages );

$row = Xml::tags( 'tr', array( 'valign' => 'top' ), $row );
$table = Xml::tags( 'table', null, Xml::tags( 'tbody', null, $row ) );
$langAttribs = array( 'lang' => $userLangCode, 'dir' => $userLangDir );

return Xml::wrapClass( $table, 'mw-pt-languages', 'div', $langAttribs );
Comment 3 Liangent 2012-06-28 00:14:23 UTC
(In reply to comment #2)
> Liangent, I haven't been able to verify that the change actually allows for
> xss, but it would be good to protect against it.

https://meta.wikimedia.org/wiki/IPv6_initiative/2012_IPv6_Day_announcement?uselang=%22%20onmouseover=%22alert%28%27xss%27%29;%22%20x=%22
Comment 4 Chris Steipp 2012-06-28 00:24:48 UTC
Liangent, thank you!

Robin, can you get this fixed, or would you like me to submit this patch into gerrit?
Comment 5 Liangent 2012-06-28 03:14:35 UTC
(In reply to comment #4)
> Liangent, thank you!
> 
> Robin, can you get this fixed, or would you like me to submit this patch into
> gerrit?

Submitting means disclosing this bug, maybe this should be done after it's fixed on live sites?
Comment 6 Siebrand Mazeland 2012-06-28 06:31:13 UTC
(In reply to comment #5)

> Submitting means disclosing this bug, maybe this should be done after it's
> fixed on live sites?

Just submit it as draft (drafts instead of refs branch) and assign reviewers manually. Adding Chris and Nikerabbit should do the trick.
Comment 7 Liangent 2012-06-28 06:49:27 UTC
(In reply to comment #6)
> (In reply to comment #5)
> 
> > Submitting means disclosing this bug, maybe this should be done after it's
> > fixed on live sites?
> 
> Just submit it as draft (drafts instead of refs branch) and assign reviewers
> manually. Adding Chris and Nikerabbit should do the trick.

How to do it?
Comment 8 Siebrand Mazeland 2012-06-28 08:28:28 UTC
I gave it a stab at Gerrit change #13300.

Used this command to push the patch set:
git push ssh://siebrand@gerrit.wikimedia.org:29418/mediawiki/extensions/Translate HEAD:refs/drafts/master
Comment 9 Liangent 2012-06-28 10:23:21 UTC
(In reply to comment #8)
> I gave it a stab at Gerrit change #13300.
> 
> Used this command to push the patch set:
> git push
> ssh://siebrand@gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
> HEAD:refs/drafts/master

“ 	
Not Found
	 	 
The page you requested was not found.
”

Should it be using a more informative message?
Comment 10 Siebrand Mazeland 2012-06-28 10:30:54 UTC
Ah, sorry. I forgot to add you as reviewer.
Comment 11 Siebrand Mazeland 2012-06-28 18:26:20 UTC
Merged and deployment to Wikimedia 1.20wmf6 imminent.
Comment 12 Siebrand Mazeland 2012-06-28 18:40:20 UTC
The merged fix contained a syntax error. Fixed in Gerrit change #13361.
Comment 13 Robin Pepermans (SPQRobin) 2012-06-28 21:12:29 UTC
Thank you for fixing. (Marking as FIXED since the change is merged.)

Btw, wouldn't it be better if we filtered the uselang input to only contain a-z letters and dashes? It seems to already fallback to English if it contains some invalid characters.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links