【发布时间】:2018-01-23 09:05:31
【问题描述】:
我有 asp.net WEB API 在一个操作中我将 json 字符串放在 url 参数中,例如:
http://example.com?config=%7B%0D%0A%20%20%20%20%22paramete1%22%3A%22value1%22%2C%0D%0A%20%20%20%20%22serverulr%22%3A%22http%2F%2Fexample.com%22%0D%0A%7D
其中配置参数包含编码的 json:
{
"paramete1":"value1",
"serverulr":"http//example.com"
}
在所有浏览器上一切正常,我只遇到 Microsoft edge 和 Internet Explorer 的问题。在控制台中,它显示了下一个:
SEC7130: Potential cross-site scripting detected in 'http://example.com?config=%7B%0D%0A%20%20%20%20%22paramete1%22%3A%22value1%22%2C%0D%0A%20%20%20%20%22serverulr%22%3A%22http%2F%2Fexample.com%22%0D%0A%7D'. The content has been modified by the XSS Filter.
然后我的 json 如下所示:
{
"paramete1":"value1",
"serverulr":"http//example^com"
}
您知道如何避免这个问题吗?
【问题讨论】:
-
为什么不用
request payload发送json?使用 put 或 post 等动词代替 get -
我只能使用获取请求。
标签: asp.net json xss microsoft-edge