1. 29 3月, 2020 1 次提交
    • S
      Accept and default to base64_urlsafe CSRF tokens (#18496) · dabb587c
      Scott Blum 提交于
      Base64 strict-encoded CSRF tokens are not inherently websafe, which makes
      them difficult to deal with. For example, the common practice of sending
      the CSRF token to a browser in a client-readable cookie does not work properly
      out of the box: the value has to be url-encoded and decoded to survive transport.
      
      Now, we generate Base64 urlsafe-encoded CSRF tokens, which are inherently safe
      to transport.  Validation accepts both urlsafe tokens, and strict-encoded tokens
      for backwards compatibility.
      dabb587c
  2. 24 1月, 2020 1 次提交
  3. 11 1月, 2020 1 次提交
    • A
      Do not re-parse PATH_INFO when validating authenticity token · 08e4a71d
      Aaron Patterson 提交于
      PATH_INFO will never contain query parameters (that is the contract with
      the webserver), so there is no reason to call URI.parse on it.  In
      addition, clients can send garbage paths that raise an exception when
      being parsed rather than just failing the auth token check.
      08e4a71d
  4. 07 10月, 2019 1 次提交
  5. 04 8月, 2019 1 次提交
  6. 13 6月, 2019 1 次提交
  7. 27 5月, 2018 1 次提交
  8. 26 1月, 2018 1 次提交
  9. 04 11月, 2017 1 次提交
  10. 25 9月, 2017 1 次提交
    • M
      Add key rotation cookies middleware · 8b0af54b
      Michael Coyne 提交于
      Using the action_dispatch.cookies_rotations interface, key rotation is
      now possible with cookies. Thus the secret_key_base as well as salts,
      ciphers, and digests, can be rotated without expiring sessions.
      8b0af54b
  11. 29 7月, 2017 1 次提交
  12. 11 7月, 2017 1 次提交
  13. 02 7月, 2017 1 次提交
  14. 01 7月, 2017 1 次提交
  15. 16 4月, 2017 1 次提交
  16. 06 4月, 2017 1 次提交
    • J
      Improve logging when Origin header doesn't match · a500b479
      Jon Leighton 提交于
      I came up against this while dealing with a misconfigured server. The
      browser was setting the Origin header to "https://example.com", but the
      Rails app returned "http://example.com" from request.base_url (because
      it was failing to detect that HTTPS was used).
      
      This caused verify_authenticity_token to fail, but the message in the
      log was "Can't verify CSRF token", which is confusing because the
      failure had nothing to do with the CSRF token sent in the request. This
      made it very hard to identify the issue, so hopefully this will make it
      more obvious for the next person.
      a500b479
  17. 23 12月, 2016 1 次提交
  18. 16 8月, 2016 1 次提交
  19. 07 8月, 2016 5 次提交
  20. 17 7月, 2016 1 次提交
  21. 24 5月, 2016 1 次提交
  22. 20 4月, 2016 1 次提交
  23. 23 2月, 2016 1 次提交
  24. 22 2月, 2016 2 次提交
  25. 05 1月, 2016 1 次提交
  26. 07 12月, 2015 1 次提交
    • E
      Change the `protect_from_forgery` prepend default to `false` · 39794037
      eileencodes 提交于
      Per this comment
      https://github.com/rails/rails/pull/18334#issuecomment-69234050 we want
      `protect_from_forgery` to default to `prepend: false`.
      
      `protect_from_forgery` will now be insterted into the callback chain at the
      point it is called in your application. This is useful for cases where you
      want to `protect_from_forgery` after you perform required authentication
      callbacks or other callbacks that are required to run after forgery protection.
      
      If you want `protect_from_forgery` callbacks to always run first, regardless of
      position they are called in your application, then you can add `prepend: true`
      to your `protect_from_forgery` call.
      
      Example:
      
      ```ruby
      protect_from_forgery prepend: true
      ```
      39794037
  27. 26 11月, 2015 1 次提交
  28. 05 9月, 2015 1 次提交
  29. 25 8月, 2015 1 次提交
  30. 24 8月, 2015 1 次提交
  31. 18 7月, 2015 1 次提交
    • P
      Stop using deprecated `render :text` in test · 8cb8ce98
      Prem Sichanugrist 提交于
      This will silence deprecation warnings.
      
      Most of the test can be changed from `render :text` to render `:plain`
      or `render :body` right away. However, there are some tests that needed
      to be fixed by hand as they actually assert the default Content-Type
      returned from `render :body`.
      8cb8ce98
  32. 09 7月, 2015 1 次提交
  33. 28 5月, 2015 1 次提交
  34. 26 4月, 2015 1 次提交
  35. 13 2月, 2015 1 次提交