Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36768: Prevent redirection to other hosts via HTTP referer header #9840

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Sep 21, 2023

CVE-2022-4130: Blind SSRF via Referer header

For routes that use redirect_back_or_to the HTTP referer header can be set and cause a redirection to a different URL on a different machine. The presence of this option forces the fallback URL to be used.

https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_back_or_to

@theforeman-bot
Copy link
Member

Issues: #36768

@evgeni
Copy link
Member

evgeni commented Sep 26, 2023

Test failure related. I think the test needs adjustment:

@previous_url = "/bookmarks"

@previous_url = "http://test.host/bookmarks"

As I think otherwise the checker fails in
https://github.com/rails/rails/blob/90b0266e9bfaaadbd2d249ad2eeec042077a0063/actionpack/lib/action_controller/metal/redirecting.rb#L135-L139
as the URL has no host

@evgeni
Copy link
Member

evgeni commented Sep 26, 2023

Interestingly, in Rails 7, this does default to false :)

@evgeni evgeni merged commit 2517ba4 into theforeman:develop Sep 26, 2023
6 checks passed
@evgeni
Copy link
Member

evgeni commented Sep 26, 2023

can you please add this issue to https://github.com/theforeman/theforeman.org/blob/gh-pages/security.md?

@ehelms
Copy link
Member Author

ehelms commented Sep 26, 2023

can you please add this issue to https://github.com/theforeman/theforeman.org/blob/gh-pages/security.md?

Opened -- theforeman/theforeman.org#2102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants