Update Jul 29 2010

This "feature", eventually publicized by Sirdardckcat and Thornmaker, allowed Microsoft to win the BlackHat 2010 Pwnie award for the "Most Epic FAIL":)

Internet Explorer 8's famous XSS filter can be exploited to perform successful XSS attacks against web sites which would be otherwise safe. In other words, XSS "protection" is helping XSS attackers, oh the irony.

Well, this is not exactly news among security researchers, but those aware of the details (including Microsoft of course, Eduardo "Sirdarckcat" Vela and myself) have kept a low profile so far. Check, for instance, slide #17 in my OWASP presentation (alternate link), given two weeks ago.

However, after Microsoft left it unfixed for many months, someone apparently decided to whisper this dirty little secret in Dan Goodin (The Register)'s ear.

To Microsoft's credit, this problem has no quick fix: in fact, it's way worse than a simple implementation bug. Its root is a flawed design choice: when a potential XSS attack is detected, IE 8 modifies the response (the content of the target page) in order to neuter the malicious code. This is, incidentally, the only significant departure from NoScript's approach, which modifies the request (the data sent by the client) instead, and is therefore immune.

Anyway, here's the juice: IE 8's response-changing mechanism can be easily exploited to turn a normally innocuous fragment of the victim page into a XSS injection. The attacker just needs a certain degree of control on the content of the web site to be injected: social networks, forums, wikis and even Google Apps are good prey. To be fair, Google Apps are not vulnerable anymore, since Google's properties wisely choose to deploy the

X-XSS-Protection: 0

header, which is the "safety switch" disabling IE 8's XSS protection.

So, web site owners' dilemma is, opt out or not opt out?

For browser users, there should be no dilemma at all ;-)