iframe页面嵌套,浏览器提示XXS跨脚本攻击被拦截

Chrome下出现:
  The XSS Auditor refused to execute a script in 'http://192.168.16.53/ads/index/viewPostion' because its source code was found within the request. The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.

情景:当你在一个页面里输出了一段 html代码 而该html代码里含有一个http的请求;
 例如:
我要把以下这段代码直接在viewPostion 页面中输出   
<!--ad100广告位 营销广告路由-->
<iframe style="overflow:hidden; 
               width:320px;
               height:100px;
               position:fixed;
               left:0px;
               top:0px;
               border:none;
               margin:0px;
               padding:0px;"
</iframe>
就会出现上述的XXS跨脚本攻击 ;

不论你使用js先获取到值,还是使用json在解析以后,在用document.wirte写到页面上,依旧会出现XXS的错误。

如何跳过XXS呢?

其实上边的红色字已经告诉你了,就是   X-XSS-Protection = 0

下面列出的为有用和安全相关的 http 响应头

X-XSS-Protection xxs 用于构建到最新的浏览器中ie8以上chrome(不确定版本) 默认开启

Strict-Transport-Security 安全的执行http通过ssl/ tls 链接到服务器

X-Frame-Options  , Frame-Options    提供Clickjacking 保护

X-Content-Type-Options

Content-Security-Policy、X-Content-Security-Policy X-WebKit-CSP

Content-Security-Policy-Report-Only   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值