防止 Liferay 中的跨站点请求伪造
对基于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 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.