如果我传递这个值
return String.Format(CultureInfo.InvariantCulture, "<input type=\"hidden\" id=\"{0}\" post=\"True\" type=\"{1}\" value=\"{2}\" />", controlId,type,post)
到一个文本框,这是暴露给XSS了吗?由于我是新手,谁能帮我解决这个问题?
最佳答案
开始的好地方是 OWASP XSS Cheat Sheet
基本上,XSS 是一个难题。如果您不需要在您的页面上允许 html,请不要。适本地编码您的输入。不要试图手动过滤东西。那是困难,而且很容易出错。要么使用经过验证的库,要么阻止所有 html。
关于c# - 跨站点脚本的可能性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21900022/