首页 > 编程 > HTML > 正文

HTMLencod-e解决QQ空间缺陷导致日志存储型XSS

2020-03-24 15:56:17
字体:
来源:转载
供稿:网友

  1. 接着看这个系列的第一个漏洞(content_gridsblog.js)中那部分的代码。

  腾讯为了修复这个漏洞,采用了更为安全的JSON.parse函数作为修复方案。这种修复是没有问题的。

HTMLencode解决QQ空间缺陷导致日志存储型XSS

  其它有类似缺陷的网站可以参考腾讯的修复方案。

  2. 但实际上,在这段代码下方的不远处,还存在着另外一处缺陷,如下图所示:


  可以看到, oGridInfo为 JSON.parse解析出来的一个[Object]

  而 oGridInfo.templateName 取出来后,没有经过任何过滤,就传入到了 innerHTML 中。

  而从抓包的数据来看,json数据里的templateName 我们是可控的,那么这里就显然存在问题啦~

  3. 修改日志数据包中的templateName,并发送。

{"g0":{"visible":1,"id":0,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"?????????"},"g5":{"visible":1,"id":5,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"2012?????????"},"g1":{"visible":1,"id":1,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"???????"},"templateName":"

","g4":{"visible":1,"id":4,"content":{"mood":"","image":"","date":"2013-03-20&1","text":""},"type":0,"title":"???? 2013-3-20"},"g7":{"visible":1,"id":7,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"??????????"},"version":"1.2","g2":{"visible":1,"id":2,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"??????"},"bgItem":{"bgId":"130","bgURL":"/qzone/newblog/v5/flashassets/bg130.swf?bgver=1.0&max_age=31104000","gridcolor":"0xF06368","alpha":1,"align":"right","wordcolor":"0xFFFFFF"},"tempId":56,"g8":{"visible":1,"id":8,"content":{"mood":"","image":"","date":"","text":"1"},"type":1,"title":"???????????"},"g6":{"visi

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表