Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Set allow_other_host=true for external redirects

Oliver Günther42d532c71a6c
diff --git a/app/controllers/concerns/auth_source_sso.rb b/app/controllers/concerns/auth_source_sso.rb
index 3147ffa8445..510bd7a865b 100644
--- a/app/controllers/concerns/auth_source_sso.rb
+++ b/app/controllers/concerns/auth_source_sso.rb
@@ -185,7 +185,7 @@ module AuthSourceSSO
def perform_post_logout(prev_session, previous_user)
if prev_session[:user_from_auth_header] && header_slo_url.present?
- redirect_to header_slo_url
+ redirect_to(header_slo_url, allow_other_host: true)
else
super
end
diff --git a/app/controllers/oauth_clients_controller.rb b/app/controllers/oauth_clients_controller.rb
index a2a09b3c1eb..f01596c47b3 100644
--- a/app/controllers/oauth_clients_controller.rb
+++ b/app/controllers/oauth_clients_controller.rb
@@ -95,7 +95,7 @@ class OAuthClientsController < ApplicationController
else
nonce = SecureRandom.uuid
cookies["oauth_state_#{nonce}"] = { value: { href: destination_url, storageId: storage_id }.to_json, expires: 1.hour }
- redirect_to(storage.oauth_configuration.authorization_uri(state: nonce))
+ redirect_to(storage.oauth_configuration.authorization_uri(state: nonce), allow_other_host: true)
end
end
diff --git a/modules/storages/app/controllers/storages/admin/project_storages_controller.rb b/modules/storages/app/controllers/storages/admin/project_storages_controller.rb
index 17e9edaee42..7a08fc19baf 100644
--- a/modules/storages/app/controllers/storages/admin/project_storages_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/project_storages_controller.rb
@@ -86,7 +86,7 @@ class Storages::Admin::ProjectStoragesController < Projects::SettingsController
expires: 1.hour
}
session[:oauth_callback_flash_modal] = oauth_access_grant_nudge_modal(authorized: true)
- redirect_to(storage.oauth_configuration.authorization_uri(state: nonce))
+ redirect_to(storage.oauth_configuration.authorization_uri(state: nonce), allow_other_host: true)
end
end