Paid Advertising
web application security lab

MediaWiki 1.9.2 UTF-7 XSS

I got an email a few days ago from Moshe Ben-Abu talking about an XSS using UTF-7 in MediaWiki (version 1.9.2 LATEST). The advisory is available here. Here is his email:

A Cross-site scripting vulnerability has been found in MediaWiki 1.9.2 (latest version) in the experimental AJAX feature. Actually it’s the same one that they fixed on 9/1/07 (http://www.mediawiki.org/wiki/News) but UTF-7 encoded.

After doing some testing I was coming up empty handed - I couldn’t repeat it. Well it turns out it only works if Firefox is set up to view UTF-7 by default (which it next to never will be) and IE7.0 ignores it by outputting it’s default 400 page. So this would appear to work only in IE6.0 (which is not particularly useful). However, there’s an old trick in IE where you can force the output to show and get rid of that pesky default message. You just need to put in enough data. Here’s a demo that should work in IE7.0:

So, yes, anyone using IE7.0 viewing MediaWiki is now vulnerable to the UTF-7 injection. This is a tricky one to solve, but could most easily be fixed by setting the charset to something rather than leaving it blank. Nice find, Moshe!

4 Responses to “MediaWiki 1.9.2 UTF-7 XSS”

  1. Edward Z. Yang Says:

    The issue has been fixed with MediaWiki 1.9.3.

  2. Spikeman Says:

    And I just installed 1.9.2.. ughh.

  3. Stefan Esser Says:

    Firefox is also vulnerable to this kind of UTF-7 exploits.

    However the “exploit” that you need to get the example to work will hopefully be fixed in 2.0.0.2

    Right now every Firefox installation is vulnerable to this.

  4. Edward Z. Yang Says:

    Spikeman: Updating MediaWiki is very easy, and their very good about maintaining backwards compatibility between release branches. Usually, all you’ll have to do is unzip the tarball over the existing install.

Respond here or Discuss On the Forums