Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Unreleased
----------
- [Patch] Validate host param in generated HomeController template to prevent open redirect
- [Patch] Fix sorbet errors in generated webhook handlers

23.0.1 (December 22, 2025)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ class HomeController < ApplicationController

def index
if ShopifyAPI::Context.embedded? && (!params[:embedded].present? || params[:embedded] != "1")
redirect_to(ShopifyAPI::Auth.embedded_app_url(params[:host]) + request.path, allow_other_host: true)
redirect_url = ShopifyAPI::Auth.embedded_app_url(params[:host]) + request.path
redirect_url = ShopifyApp.configuration.root_url if deduced_phishing_attack?(redirect_url)
redirect_to(redirect_url, allow_other_host: true)
else
@shop_origin = current_shopify_domain
@host = params[:host]
Expand Down
1 change: 1 addition & 0 deletions test/generators/home_controller_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class HomeControllerGeneratorTest < Rails::Generators::TestCase
assert_match "include ShopifyApp::ShopAccessScopesVerification", file
assert_match "include ShopifyApp::EmbeddedApp", file
assert_match "include ShopifyApp::EnsureInstalled", file
assert_match "deduced_phishing_attack?", file
end
assert_file "app/views/home/index.html.erb"
end
Expand Down