何时跳过 verify_authenticity_token

发布于 2025-01-08 20:52:55 字数 57 浏览 0 评论 0原文

为什么人们会跳过验证并增加应用程序的安全漏洞?在只有 GET 请求的页面上禁用它是否有益?提前致谢。

Why would people skip the verification and increase the security vulnerability of their app? Is it beneficial to disable it on pages that have only GET requests? Thanks in advance.

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

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

发布评论

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

评论(2

痴情 2025-01-15 20:52:55

Rails 中的 GET 请求已跳过 CRSF 检查

http://guides.rubyonrails.org/security.html

3.1 CSRF对策
— 首先,按照W3C的要求,适当使用GET和POST。其次,非 GET 请求中的安全令牌将保护您的应用程序免受 CSRF 的侵害。

您也可以看到该方法本身。

http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection .html#method-i-verify_authenticity_token

 .... Also, GET requests are not protected as these should be idempotent. ....

 verified_request?()
   Returns true or false if a request is verified. Checks:
   is it a GET request? Gets should be safe and idempotent

CRSF check is already skipped for GET request in rails

http://guides.rubyonrails.org/security.html

3.1 CSRF Countermeasures
— First, as is required by the W3C, use GET and POST appropriately. Secondly, a security token in non-GET requests will protect your application from CSRF.

You can see the method itself as well.

http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html#method-i-verify_authenticity_token

 .... Also, GET requests are not protected as these should be idempotent. ....

 verified_request?()
   Returns true or false if a request is verified. Checks:
   is it a GET request? Gets should be safe and idempotent
喜你已久 2025-01-15 20:52:55

如果您有跨域应用程序,则 authtoken 验证可能会出现错误,您可以禁用它,但当然您的应用程序将不安全。 Rails 3 中有一些开箱即用的跨域解决方案的特殊方法

If you have cross domain application you could have errors with authtoken verifying and you can disable it, but of course your application won't be secure. In rails 3 there are special methods for cross domain solution in out of box

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