Skip to content

Commit e8798eb

Browse files
authored
Pass values to CSP frame_ancestors as individual arguments (#1929)
* Pass values to CSP frame_ancestors as individual arguments Rails core has patched a CVE preventing passing a string with whitespace as an argument. rails/rails@3da2479 This patch passes the arguments individually instead which achieves the same result whilst meeting the new requirements. * Reimplement frame_ancestors proc to fix tests @sle-c has pointed out that the tests rely on the proc and suggests reimplemeting the proc and returning an array. This patch implements the recommendation and achieves the same result.
1 parent 7411e62 commit e8798eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/shopify_app/controller_concerns/frame_ancestors.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ module FrameAncestors
88
content_security_policy do |policy|
99
policy.frame_ancestors(-> do
1010
domain_host = current_shopify_domain || "*.#{::ShopifyApp.configuration.myshopify_domain}"
11-
"#{ShopifyAPI::Context.host_scheme}://#{domain_host} https://admin.#{::ShopifyApp.configuration.unified_admin_domain}"
11+
[
12+
"#{ShopifyAPI::Context.host_scheme}://#{domain_host}",
13+
"https://admin.#{::ShopifyApp.configuration.unified_admin_domain}",
14+
]
1215
end)
1316
end
1417
end

0 commit comments

Comments
 (0)