首页 > 解决方案 > 我们可以覆盖 JSON.stringify 来获取 XSS

问题描述

我们如何绕过这个函数来获得完整的 XSS?

 var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function() { 
      if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        response = JSON.parse(xmlHttp.responseText);
        AnyFunction(response);
      }
      else if (xmlHttp.readyState == 4 && xmlHttp.status != 200) {
        console.log(xmlHttp.responseText);
      }
    }
    xmlHttp.open('POST', url, true); 
    xmlHttp.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
    xmlHttp.setRequestHeader('Accept', 'application/json');
    data = {'searchTerm':item}
    xmlHttp.send(JSON.stringify(data));

用户输入只有一个搜索栏。

标签: securityweb

解决方案


推荐阅读