这个可怕的 XSS 向量在 Internet Explorer 中仍然是一个问题吗?

发布于 2024-11-05 18:33:04 字数 835 浏览 2 评论 0 原文

来自 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 的,所以我有两个紧密耦合的问题:

  1. 在更高版本的 IE 中这仍然是一个问题吗?
  2. 如果是这样,是否有纯粹的客户端方法来避免它?换句话说,假设从服务器收到“中毒”字符串,客户端是否可以采取任何措施来防止此漏洞?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ま昔日黯然 2024-11-12 18:33:04

如果我对该漏洞的理解正确的话,它已于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文