16

From hi.baidu.com/monyer/blog/item/d0f5d8b48fc442758bd4b2a4.html

Char 192 is <font face="xyz[0xC0]">not </font><font face=" onmouseover=alert(192) s=[0xC0]" >available</font>

0xC0 is one of the 32 first bytes of 2-byte sequences (0xC0-0xDF) in UTF-8. So when IE parses the above code, it will consider 0xC0 and the following quote as a sequence, and therefore these two pairs of FONT elements will become one with "xyz[0xC0]">not </font><font face=" as the value of FACE parameter. The second 0xC0 will start another 2-byte sequence as a value of NOTEXIST parameter which is not quoted. Due to a space character following by the quote, 0xE0-0xEF which are first bytes of 3-byte sequences, together with the following quote and one space character will be considered as the value of NOTEXIST parameter.

Essentially, certain bytes indicate the start of a 3-byte character in a UTF-8 string. If those bytes make their way onto a webpage, IE will eat up the next two bytes even if the resulting three bytes don't make up a valid UTF-8 character. This can cause IE to eat up ending quotes in HTML attributes, wreaking XSS-flavored havoc.

The article is about IE6, so I have two tightly-coupled questions:

  1. Is this still an issue in later versions of IE?
  2. If so, is there a purely client-side method of avoiding it? In other words, assuming a "poisoned" string is received from the server, is there anything that can be done client-side to prevent this vulnerability?
3
  • @Karl I appreciate the edit, but I was trying to avoid linking to that site, as it seemed to be a bit seedy. I'm not sure about the rules regarding linking to sites here. Do you think it should be link (honest question)? May 8, 2011 at 15:54
  • The page is indeed seedy :) I don't know if there are any rules, so let's rather not link it. May 8, 2011 at 16:01
  • Could be I have no idea what's actually going on. But I tried this on JSFiddle in IE9, and there was no mouseover. May 8, 2011 at 16:49

1 Answer 1

6

If I understand the vulnerability correctly, it was addressed in 2006 in Microsoft Security Bulletin MS06-021.

A remote code execution vulnerability exists in the way Internet Explorer decodes specially crafted UTF-8 encoded HTML. An attacker could exploit the vulnerability by constructing a specially crafted Web page that could potentially allow remote code execution if a user visited the specially crafted Web site.

2
  • +1 Thank you for your answer. The date of the security bulletin is 2006/06/13; the date of the article is 2006/08/7. Additionally, the posts in this mailing list – discussing the same vulnerability – are also from August. Additionally, some recent XSS-related chatter on tech blogs have mentioned this issue, referencing the originally cited article. This makes me wonder whether the issue has actually been resolved. Sadly, I don't have a Windows machine to test this on (and I'm not sure how I'd insert those invalid bytes). May 10, 2011 at 0:00
  • The timing implies to me that the articles were written in response to the bulletin.
    – Ben Fulton
    May 10, 2011 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.