Last modified: 2014-10-23 00:06:26 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 T48852, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46852 - XSS in Semantic Search
XSS in Semantic Search
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticBundle (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Chris Steipp
http://semantic-mediawiki.org/wiki/Sp...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-03 18:47 UTC by Andrei Hajdukewycz
Modified: 2014-10-23 00:06 UTC (History)
10 users (show)

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


Attachments
Patch to rawurlencode parameters and use Html::openElement() (1.52 KB, patch)
2013-04-03 19:28 UTC, Chris Steipp
Details

Description Andrei Hajdukewycz 2013-04-03 18:47:17 UTC
http://semantic-mediawiki.org/wiki/Special:Ask?eq=yes&order_num=ASC&p[default]=3&p[format]=broadtable&p[headers]=show&p[intro]=3&p[limit]='" ns= alert(0x012480) &p[link]=all&p[mainlabel]=3&p[offset]=0&p[outro]=3&po=3&q=3&sort_num=3&title=Special%3aAsk&p[limit]=" javascript=prompt(0) onclick=prompt(0) onmouseover=prompt(/XSSHERE/) onload=prompt(0) onfocus=prompt(0) ns="

The above url produces an alert box when you mouseover the formatSelector select box next to "Format as:"
Comment 1 Chris Steipp 2013-04-03 19:08:05 UTC
Verified on wikitech too.

Adding Ryan and Jeroen.
Comment 2 Chris Steipp 2013-04-03 19:19:36 UTC
Issue is that Ex:SemanticMediaWiki is using Xml::escapeJsString() to escape $url parameters instead of rawurlencode. $url is then written directly into an element instead of using an Html/Xml builder, which also would have prevented breaking out of the attr.
Comment 3 Chris Steipp 2013-04-03 19:28:45 UTC
Created attachment 12031 [details]
Patch to rawurlencode parameters and use Html::openElement()

Untested, but this should fix the issue. Not sure if it breaks the assumptions of the form processing (Jeroen would probably be the one to comment on that).
Comment 4 Jeroen De Dauw 2013-04-03 22:31:08 UTC
https://gerrit.wikimedia.org/r/#/c/57433/
Comment 5 Jeroen De Dauw 2013-04-03 22:32:07 UTC
Don’t think that will break anything - though who knows, sort of hard to tell with a pile of rotten code like Special:Ask :)
Comment 6 Chris Steipp 2013-04-03 22:39:45 UTC
Hi Jeroen, in the future, please don't publicly post security patches to gerrit until we confirm that our systems are patched.

Adding Niklas so he can patch twn.
Comment 7 Jeroen De Dauw 2013-04-03 22:55:41 UTC
Ok, sorry, was not aware of this process, or even that this bug was not public.
Comment 8 Chris Steipp 2013-04-10 23:09:00 UTC
Merged by Jeroen

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


Navigation
Links