来自 hi.baidu.com/monyer/blog/item/d0f5d8b48fc442758bd4b2a4.html
字符 192 是 不是 可用< /字体>
0xC0 是 UTF-8 中 2 字节序列 (0xC0-0xDF) 的前 32 个字节之一。所以当 IE 解析上面的代码时,它会将 0xC0 和后面的引号视为一个序列,因此这两对 FONT 元素将成为 "xyz[0xC0]"> 而不是 < ;font face="
作为 FACE 参数的值。第二个 0xC0 将启动另一个 2 字节序列作为 NOTEXIST 参数的值,该参数不带引号。由于引号后面有空格,所以 0xE0-0xEF这是 3 字节序列的第一个字节,加上后面的引号和一个空格字符将被视为 NOTEXIST 参数的值。
本质上,某些字节指示 UTF-8 字符串中 3 字节字符的开始。这些字节进入网页后,即使生成的三个字节不能构成有效的 UTF-8 字符,IE 也会耗尽接下来的两个字节。 HTML 属性中的引号,造成 XSS 风格的破坏
这篇文章是关于 IE6 的,所以我有两个紧密耦合的问题:
- 在更高版本的 IE 中这仍然是一个问题吗?
- 如果是这样,是否有纯粹的客户端方法来避免它?换句话说,假设从服务器收到“中毒”字符串,客户端是否可以采取任何措施来防止此漏洞?
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:
- Is this still an issue in later versions of IE?
- 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?
发布评论
评论(1)
如果我对该漏洞的理解正确的话,它已于 2006 年在 Microsoft 安全公告 MS06 中得到解决-021。
Internet Explorer 解码特制 UTF-8 编码 HTML 的方式中存在远程执行代码漏洞。攻击者可以通过构建特制网页来利用此漏洞,如果用户访问特制网站,该网页可能允许远程执行代码。
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.