是否存在与 Web 保护库(Anti-XSS)同等的最低信任?
我正在开发一个需要一些 HTML 清理的项目。通常,我会求助于 Microsoft Web Protection Library;然而,在这种情况下,我正在开发一个以最小信任运行的应用程序。 WPL 的一部分需要中等信任,其余部分似乎需要完全信任。
谁能推荐一个可以在最小信任环境中运行的良好 HTML 清理程序?
I am working on a project that requires some HTML sanitization. Normally, I would turn to the Microsoft Web Protection Library; however, in this case, I am developing an application running in minimal trust. Part of the WPL requires medium trust, and the rest seems to require full trust.
Can anyone suggest a good HTML sanitizer that can operate in a minimal trust environment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Jeff Atwood 的消毒剂位于此处
根据我有限的测试,效果更好的 C# Sanitizer 是 这里
我采用了 C# 并转换为 vbnet,现在正在使用它作为一个项目,它似乎捕获了我不想通过的 html 和 javascript。
Jeff Atwood's sanitizer is here
And a C# Sanitizer that works better based on my limited testing is here
I took the c# and converted to vbnet and am using it a project now and it seems to catch html and javascript i dont want getting through.
您能详细解释一下您的项目吗?比如你在什么框架中?
这是我在不了解更多细节的情况下建议的:
AntiXSS 4.0(2010 年 10 月 5 日发布):http://www.antiXSS. microsoft.com/download/en/details.aspx?id=5242
在下面的文章中,我演示了如何执行简单的 XSS,但您会注意到它仅适用于 .Net 2.0项目。一旦您超过此限制,系统就会代表您采取某些安全措施,并且每当将不安全的文本放入用户输入字段时,它都会发出警告。
http://mdukehall.wordpress.com/ 2011/11/03/intro-to-xss-for-web-developers/
这是一个关于它的替代博客:
http://jimbojw.com/wiki/index.php?title=Sanitizing_user_input_against_XSS
Can you explain more about your project? Like what framework are you in?
This is what I would suggest without knowing more details:
AntiXSS 4.0 (released 10/5/2010): http://www.microsoft.com/download/en/details.aspx?id=5242
In the following post I demonstrate how to execute a simple XSS, but you'll notice that it only works in .Net 2.0 projects. Once you're above that, certain security measures are taken on your behalf and it will warn anytime unsafe text is put into user input fields.
http://mdukehall.wordpress.com/2011/11/03/intro-to-xss-for-web-developers/
Here is an alternative blog on it:
http://jimbojw.com/wiki/index.php?title=Sanitizing_user_input_against_XSS