Open gotbadger opened 1 year ago
Rails 7 now has open redirect protection meaning the redirect path is evaluated at runtime and external urls are blocked:
https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_to-label-Open+Redirect+protection
As such we should only flag open redirects that have allow_other_host: true enabled. However we should consider if this is appropriate since some folks may not be on rails 6 or below.
allow_other_host: true
redirect_to request.referer, allow_other_host: true
Raises a finding
redirect_to request.referer
Remember we can do this https://github.com/Bearer/bearer-rules/blob/main/rules/javascript/third_parties/dom_purify.yml#L20-L24 :)
Description & Reproduction
Rails 7 now has open redirect protection meaning the redirect path is evaluated at runtime and external urls are blocked:
https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_to-label-Open+Redirect+protection
As such we should only flag open redirects that have
allow_other_host: true
enabled. However we should consider if this is appropriate since some folks may not be on rails 6 or below.Expected Behavior
Raises a finding
Actual Behavior
Raises a finding