可见的正则是输入元素中的“ live”验证
因此,我正在考虑可能发生的安全问题,因为我的设置以下设置可能会发生:
我在文本输入字段的数据零件中写下正则代码。并且在键入时,我正在用jQuery验证对正则的用户输入。
我的安全性想法是:我是否在验证任何用户可以通过浏览器的开发人员工具进行验证时(从技术上讲)操纵的正则漏洞时,我是否打开了安全孔?
这就是我的输入的样子:
<input id="email-regex-asd" type="text" data-regex="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/">
编辑: 只是为了清楚地表明:我仍在验证后端中的完整用户输入,以防止SQL注入,交叉分解等。
so i am thinking about possible security-problems, that could occur because of my following setup:
I write the regex-code in a data-part of a text-input field. And while typing i am validating the user-input against the regex with jquery.
My security-thoughts are: Am i opening security holes while validating regex-code that could (technically) be manipulated by any user via, for example, the developer-tools of a browser?
This is how my input looks like:
<input id="email-regex-asd" type="text" data-regex="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/">
Edit:
Just to make it clear: I am still validating the complete user-input in the backend to prevent SQL-injection, crossite-scripting, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对提供的示例没有安全关注。
比较是与前端&amp;后端验证与仅后端的验证。如果具有前端验证会提高良好和/或性能,那么对您来说会有更多的力量。
No security concern with the example provided.
The comparison is an application with front-end & back-end validation vs one with just back-end. If having the front-end validation improves nicety and/or performance, more power to you.