防止 Liferay 中的跨站点请求伪造

发布于 2024-09-12 14:38:47 字数 350 浏览 2 评论 0原文

对基于 Liferay 5.2.3 的站点进行 CSRF 防护的最佳实践是什么? OWASP 建议 (http://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#General_Recommendation:_Synchronizer_Token_Pattern) 使用 Synchronizer 令牌模式,但手动执行此操作似乎很乏味,特别是在多个 portlet 之间共享令牌。

应配备一个全面的 Portlet 容器来处理此问题,并提供来自Liferay 网站似乎也表明确实如此。但是,我找不到有关如何执行此操作的更多信息。

What are the best practices in CSRF-proofing a Liferay 5.2.3 based site? OWASP recommends (http://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#General_Recommendation:_Synchronizer_Token_Pattern) using the Synchronizer token pattern, but doing this manually seems to be tedious, especially sharing the token across multiple portlets.

A comprehensive portlet container should be equipped to deal with this, and a bug report from the Liferay site also seems to suggest that it does. However, I couldn't find any further information on how to do this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中二柚 2024-09-19 14:38:47

如果您使用 Tomcat 6 或更高版本,则可以使用跨站点请求伪造预防过滤器,
在 org.apache.catalina.filters.CsrfPreventionFilter 类中实现。请参阅 Apache Tomcat 文档。也许,对你有帮助。

If you use Tomcat 6 or later, you could use the Cross-Site Request Forgery Prevention filter,
implemented in class org.apache.catalina.filters.CsrfPreventionFilter. See Apache Tomcat docs. Maybe, helps you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文