* Don't give attackers an opening by echoing back known bad parameter inputs.
authorNick Jenkins <nickj@users.mediawiki.org>
Thu, 19 Oct 2006 08:18:19 +0000 (08:18 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Thu, 19 Oct 2006 08:18:19 +0000 (08:18 +0000)
commit33b7c11dedde893dd3a798f99ff4ab3ee598e912
tree4e46ffd2c6e4f3054ed6badab27304a92bba8e58
parent0d2132fe0220bfe9993ef99646a1ceb7451360e9
* Don't give attackers an opening by echoing back known bad parameter inputs.
* Create magic links only using a whitelist of protocols.

Have no proof of vuln, but allowing the user to make JavaScript links and have a lot of control over what goes into them probably isn't desirable.
Example attack input:
  http://en.wikipedia.org/w/api.php?action=query&meta=javascript://**/alert(1);

Example pre-patch HTML output contains this string:
  <a href="javascript://**/alert">javascript://**/alert</a>(1);
Which doesn't work, due to:
 1) the double slash - one slash someone can work around by faking a C-style comment (by appending "**/" as shown above), but two is a problem
 2) the parentheses being excluded, so we can't pass parameters
... but best to put a stop to it anyway.
includes/api/ApiBase.php
includes/api/ApiFormatBase.php