Last modified: 2006-11-14 20:29:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 7888 - XSS on search form
XSS on search form
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Nobody - You can work on this!
http://xx.wikipedia.org/wiki/Special:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-12 17:38 UTC by mesca
Modified: 2006-11-14 20:29 UTC (History)
0 users

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


Attachments

Description mesca 2006-11-12 17:38:04 UTC
Problem
-------
It is possible to conduct a cross-site-scripting attack against the search page
when it displays Google and Yahoo search forms. There is a lack of validation
before returning the original query to the user.

Affected
--------
It seems that only French, Dutch and Russian pages are displaying Google and
Yahoo search forms.

Attack vector
-------------
"><script>alert('XSS')</script>

PoC
---
http://fr.wikipedia.org/wiki/Special:Search?search=%22%3E%3Cscript%3Ealert%28%27XSS%27%29%3C%2Fscript%3E&go=Go
http://nl.wikipedia.org/wiki/Special:Search?search=%22%3E%3Cscript%3Ealert%28%27XSS%27%29%3C%2Fscript%3E&go=Go
http://ru.wikipedia.org/wiki/Special:Search?search=%22%3E%3Cscript%3Ealert%28%27XSS%27%29%3C%2Fscript%3E&go=Go

Solution
--------
Filter :)
Comment 1 Rob Church 2006-11-12 18:55:35 UTC
Confirmed, though haven't identified if it's the Lucene extension, the built-in
search or something special about the fallback behaviour at the moment. Looking now.
Comment 2 Rob Church 2006-11-12 19:18:23 UTC
Aha. http://fr.wikipedia.org/wiki/MediaWiki:Monobook.js seems to have a useful
little hack (do a find in your browser for "yahooSearch") which contains the
vulnerability.
Comment 3 Brion Vibber 2006-11-14 00:59:47 UTC
I've corrected the bad JS code on these sites.

Sigh.
Comment 4 Rob Church 2006-11-14 08:44:08 UTC
Another vote against custom JavaScript. Sadly, administrators are not
necessarily l33t script writers as well...
Comment 6 Brion Vibber 2006-11-14 16:39:50 UTC
Man, I have JavaScript's class library (such as it is). String's replace() method only replaces the first occurance 
by default. *boggle*

Fixed.
Comment 7 dake 2006-11-14 20:28:48 UTC
>Another vote against custom JavaScript. Sadly, administrators are not
>necessarily l33t script writers as well...

Well, how long have we been waiting for a better search page ? Administrators
are just patching :) Though for that XSS stuff I plead 100% guilty, I completely
forgot the XSS issue. Another piece of code I made, the array generator
("popupTableau") is more secure (I hope) as inputs go through JS parsing functions. 
Comment 8 dake 2006-11-14 20:29:37 UTC
btw. Brion is right, JS sucks.

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


Navigation
Links