Skip to content

Commit ffea870

Browse files
committed
AncestorThrottle: Short-circuit same origin check for frame load if websecurity is disabled
1 parent 771a51a commit ffea870

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

patches/chromium/.patches

+1
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,4 @@ fix_nexus_fix_window_focus_management_for_vk_os-17597.patch
182182
fix_track_keyboard_focus_on_nexuswindowmanager_os-18564.patch
183183
fix_wayland_window_always_dispatch_keyevent_os-18589.patch
184184
fix_wayland_track_keyboard_focus_os-18548.patch
185+
os-17051_short-circuit_same_origin_check_for_frame_load_if.patch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Tariq Bashir <120014322+t-bashir-bs@users.noreply.github.com>
3+
Date: Thu, 27 Feb 2025 14:29:55 +0000
4+
Subject: OS-17051: Short-circuit same origin check for frame load if
5+
websecurity is disabled
6+
7+
Disable the same origin check for frame loads if web security is disabled.
8+
This is to allow the loading of iframes from different origins when web
9+
security is disabled.
10+
11+
This is a cherry pick of https://cam-gerrit.brightsign.info/c/qtwebengine-chromium/+/6236
12+
13+
diff --git a/content/browser/renderer_host/ancestor_throttle.cc b/content/browser/renderer_host/ancestor_throttle.cc
14+
index d17a791b05bf59b64cdc055620560a3cf1d75b1b..19f7ee73fcdeefcbf6a1f756daa9a44f01624312 100644
15+
--- a/content/browser/renderer_host/ancestor_throttle.cc
16+
+++ b/content/browser/renderer_host/ancestor_throttle.cc
17+
@@ -25,6 +25,7 @@
18+
#include "content/public/browser/navigation_handle.h"
19+
#include "content/public/browser/navigation_throttle.h"
20+
#include "content/public/browser/storage_partition.h"
21+
+#include "content/public/browser/web_contents.h"
22+
#include "content/public/common/content_client.h"
23+
#include "net/http/http_response_headers.h"
24+
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
25+
@@ -253,7 +254,9 @@ AncestorThrottle::CheckResult AncestorThrottle::EvaluateXFrameOptions(
26+
url::Origin current_origin =
27+
url::Origin::Create(navigation_handle()->GetURL());
28+
while (parent) {
29+
- if (!parent->GetLastCommittedOrigin().IsSameOriginWith(
30+
+ if ((!navigation_handle()->GetWebContents()
31+
+ || navigation_handle()->GetWebContents()->GetOrCreateWebPreferences().web_security_enabled)
32+
+ && !parent->GetLastCommittedOrigin().IsSameOriginWith(
33+
current_origin)) {
34+
if (logging == LoggingDisposition::LOG_TO_CONSOLE)
35+
ConsoleErrorXFrameOptions(disposition);

0 commit comments

Comments
 (0)