修改密码形式如何防止反xss
好的这是一个基本的更改密码表格, 我该如何清理这个输入?使用 AntiXSS HtmlEncode 安全吗?我想确保编码不会更改随机输入的字符,
最好的方法是什么?
请指教
OK This is a basic change password form,
how can I sanitize this input? is it safe to use AntiXSS HtmlEncode? I want to make sure that the encoding won't change randomly entered characters
what's the best way to do it?
please advise
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要编码。您不需要 - 当您在输出中反映用户输入时进行编码。我假设当您处理密码时,您只需将其推入数据库(显然在对其进行哈希和加盐之后)并且它永远不会输出。由于它永远不会以 HTML 形式输出,因此您不必担心。
Don't encode. You don't need to - you encode when you reflect user input in your output. I would assume that when you process the password you just shove it in the database (after hashing and salting it obviously) and it's never output. As it's never output in HTML you don't have to worry.