Skip to content

Conversation

@virusdefender
Copy link

1 json标准中都是使用双引号的,http://www.json.org/json-zh.html 。最近使用django和您的xss probe写一个xss平台,发现python的json.loads()等函数在处理单引号的json的时候会报错。规范一下比较好。

2 去掉了window.onload 这样在部分xss利用场景中可以插入xss代码后就立即起作用。比如我上面自己写的平台,构造一个dom xss,提供一个文本框,点击后插入到html中,如果使用window.onload,就不会起作用。

我说的有什么问题,还希望大神提出来~~

virusdefender added 2 commits May 18, 2014 21:03
如果部分xss是动态插入dom的,这个js可能不会工作。
去掉windows.onload修改了这个问题。
@virusdefender
Copy link
Author

后来发现还有点问题,不单独pull request了,在这说吧.
cookie和title那里也应该进行escape, 防止有&等特殊符号出现导致问题.
还有就是处理双引号,否则获取的json还是会出问题.我写的是替换成了单引号,但是我不是很熟悉js,不知道您还有没有别的办法.
info.cookie = escape(document.cookie.replace(/"/g,"'"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant