Skip to content

Truly independent web browser

LibWeb+LibWebView+WebContent+WebWorker: Report worker CSP violations

Andreas Kling24f56b72add6
diff --git a/Libraries/LibWeb/ContentSecurityPolicy/Violation.cpp b/Libraries/LibWeb/ContentSecurityPolicy/Violation.cpp
index 834ed1e0689..d1e532682ba 100644
--- a/Libraries/LibWeb/ContentSecurityPolicy/Violation.cpp
+++ b/Libraries/LibWeb/ContentSecurityPolicy/Violation.cpp
@@ -11,11 +11,14 @@
#include <LibWeb/Bindings/PrincipalHostDefined.h>
#include <LibWeb/ContentSecurityPolicy/Directives/DirectiveOperations.h>
#include <LibWeb/ContentSecurityPolicy/Directives/Names.h>
+#include <LibWeb/ContentSecurityPolicy/PolicyList.h>
#include <LibWeb/ContentSecurityPolicy/SecurityPolicyViolationEvent.h>
#include <LibWeb/ContentSecurityPolicy/Violation.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOMURL/DOMURL.h>
#include <LibWeb/Fetch/Fetching/Fetching.h>
+#include <LibWeb/HTML/PolicyContainers.h>
+#include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
#include <LibWeb/HTML/Window.h>
@@ -90,6 +93,22 @@ GC::Ref<Violation> Violation::create_a_violation_object_for_request_and_policy(G
// targets to which the page MUST NOT be given access.
violation->m_resource = request->url();
+ // AD-HOC: A request whose client is a snapshot of an environment in another process, such as a worker's outside
+ // settings when the worker fetches its script, violates that environment's policies. Its global object is
+ // in that process, so the violation is reported there.
+ if (auto const* snapshot = as_if<HTML::EnvironmentSettingsSnapshot>(*request->client()); snapshot && snapshot->report_violation()) {
+ // NB: Request's policy container is a clone of the snapshot's, which lists the policies in the same order.
+ auto const& policies = request->policy_container().get<GC::Ref<HTML::PolicyContainer>>()->csp_list->policies();
+ for (size_t policy_index = 0; policy_index < policies.size(); ++policy_index) {
+ if (policies[policy_index].ptr() != policy.ptr())
+ continue;
+ violation->m_report_in_other_process = GC::create_function(GC::Heap::the(), [report_violation = GC::Ref { *snapshot->report_violation() }, policy_index, effective_directive = String { violation->m_effective_directive.to_utf8() }, resource = request->url()] {
+ report_violation->function()(policy_index, effective_directive, resource);
+ });
+ break;
+ }
+ }
+
// 4. Return violation.
return violation;
}
@@ -100,6 +119,7 @@ void Violation::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_global_scope);
visitor.visit(m_policy);
visitor.visit(m_element);
+ visitor.visit(m_report_in_other_process);
}
// https://w3c.github.io/webappsec-csp/#violation-url
@@ -271,6 +291,12 @@ void Violation::report_a_violation(JS::Realm& realm)
obtain_the_blocked_uri_of_resource(),
m_effective_directive);
+ // AD-HOC: See create_a_violation_object_for_request_and_policy().
+ if (m_report_in_other_process) {
+ m_report_in_other_process->function()();
+ return;
+ }
+
// 1. Let global be violation’s global object.
auto global_scope = m_global_scope;
diff --git a/Libraries/LibWeb/ContentSecurityPolicy/Violation.h b/Libraries/LibWeb/ContentSecurityPolicy/Violation.h
index 206dde29342..11f7ec06f89 100644
--- a/Libraries/LibWeb/ContentSecurityPolicy/Violation.h
+++ b/Libraries/LibWeb/ContentSecurityPolicy/Violation.h
@@ -8,6 +8,7 @@
#include <AK/Utf16String.h>
#include <LibGC/CellAllocator.h>
+#include <LibGC/Function.h>
#include <LibJS/Heap/Cell.h>
#include <LibURL/URL.h>
#include <LibWeb/ContentSecurityPolicy/Policy.h>
@@ -137,6 +138,9 @@ private:
// https://w3c.github.io/webappsec-csp/#violation-sample
// Each violation has a sample, which is a string. It is the empty string unless otherwise specified.
Utf16String m_sample;
+
+ // Reports this violation to its global object in another process. See create_a_violation_object_for_request_and_policy().
+ GC::Ptr<GC::Function<void()>> m_report_in_other_process;
};
}
diff --git a/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.cpp b/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.cpp
index 81299200405..206d97e9cdb 100644
--- a/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.cpp
+++ b/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.cpp
@@ -35,6 +35,7 @@ void EnvironmentSettingsSnapshot::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_policy_container);
+ visitor.visit(m_report_violation);
}
}
diff --git a/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h b/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h
index 0dbe0afd11f..d7bcc7d0115 100644
--- a/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h
+++ b/Libraries/LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h
@@ -6,6 +6,7 @@
#pragma once
+#include <LibGC/Function.h>
#include <LibWeb/Export.h>
#include <LibWeb/HTML/PolicyContainers.h>
#include <LibWeb/HTML/Scripting/Environments.h>
@@ -37,6 +38,13 @@ public:
// a realm of the process it's used in.
SerializedGlobal const& serialized_global() const { return m_serialized_global; }
+ // The violations of this environment's policies need to be reported to its global object, in the process it's
+ // from. If this is set, it does that, given the index of the violated policy in this environment's CSP list, the
+ // violation's effective directive, and its resource.
+ using ReportViolation = GC::Function<void(u64 policy_index, String effective_directive, URL::URL resource)>;
+ GC::Ptr<ReportViolation> report_violation() const { return m_report_violation; }
+ void set_report_violation(GC::Ref<ReportViolation> report_violation) { m_report_violation = report_violation; }
+
protected:
virtual void visit_edges(Cell::Visitor&) override;
@@ -50,6 +58,7 @@ private:
CrossOriginIsolationMode m_agent_cluster_cross_origin_isolation_mode { CrossOriginIsolationMode::None };
double m_time_origin { 0 };
SerializedGlobal m_serialized_global;
+ GC::Ptr<ReportViolation> m_report_violation;
};
}
diff --git a/Libraries/LibWeb/HTML/WorkerAgentParent.cpp b/Libraries/LibWeb/HTML/WorkerAgentParent.cpp
index 27f1a8c20f3..ed5c0a13bcc 100644
--- a/Libraries/LibWeb/HTML/WorkerAgentParent.cpp
+++ b/Libraries/LibWeb/HTML/WorkerAgentParent.cpp
@@ -9,6 +9,9 @@
#include <LibGC/Heap.h>
#include <LibWeb/Bindings/PrincipalHostDefined.h>
#include <LibWeb/Bindings/WrapperWorld.h>
+#include <LibWeb/ContentSecurityPolicy/Directives/Names.h>
+#include <LibWeb/ContentSecurityPolicy/PolicyList.h>
+#include <LibWeb/ContentSecurityPolicy/Violation.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/EventTarget.h>
@@ -16,6 +19,7 @@
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/MessagePort.h>
+#include <LibWeb/HTML/PolicyContainers.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
#include <LibWeb/HTML/Window.h>
@@ -136,6 +140,14 @@ void WorkerAgentParent::did_report_worker_exception(WorkerAgentOwnerToken owner_
parent->value->dispatch_worker_exception(move(message), move(filename), lineno, colno);
}
+void WorkerAgentParent::did_report_content_security_policy_violation(WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource)
+{
+ auto parent = worker_agent_parents().find(owner_token);
+ if (parent == worker_agent_parents().end())
+ return;
+ parent->value->report_content_security_policy_violation(policy_index, move(effective_directive), move(resource));
+}
+
void WorkerAgentParent::did_close_worker(WorkerAgentOwnerToken owner_token)
{
auto parent = worker_agent_parents().find(owner_token);
@@ -213,6 +225,23 @@ void WorkerAgentParent::dispatch_worker_exception(Utf16String message, Utf16Stri
}));
}
+// NB: The worker fetches its script with outside settings as the request's client, from a snapshot of it in the
+// worker's process. The violations of its policies are reported here, where outside settings' global object is.
+void WorkerAgentParent::report_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource)
+{
+ // NB: The worker's snapshot of outside settings' CSP list lists its policies in the same order, and a CSP list
+ // only grows, so policy_index names the policy that was violated. The worker's process is less trusted than
+ // this one, so we only report violations of policies in outside settings' CSP list, and of worker-src, which
+ // is the effective directive of every worker script request.
+ auto const& policies = m_outside_settings->policy_container()->csp_list->policies();
+ if (policy_index >= policies.size() || ContentSecurityPolicy::Directives::Names::WorkerSrc != effective_directive.bytes_as_string_view())
+ return;
+
+ auto violation = ContentSecurityPolicy::Violation::create_a_violation_object_for_global_policy_and_directive(&m_outside_settings->global_object(), policies[policy_index], move(effective_directive));
+ violation->set_resource(move(resource));
+ violation->report_a_violation(m_outside_settings->realm());
+}
+
WorkerAgentOwnerToken WorkerAgentParent::next_owner_token()
{
static WorkerAgentOwnerToken s_next_owner_token = 0;
diff --git a/Libraries/LibWeb/HTML/WorkerAgentParent.h b/Libraries/LibWeb/HTML/WorkerAgentParent.h
index a443d1806fc..251d09e025e 100644
--- a/Libraries/LibWeb/HTML/WorkerAgentParent.h
+++ b/Libraries/LibWeb/HTML/WorkerAgentParent.h
@@ -28,6 +28,7 @@ public:
static WEB_API void did_fail_loading_worker_script(WorkerAgentOwnerToken);
static WEB_API void did_report_worker_exception(WorkerAgentOwnerToken, Utf16String message, Utf16String filename, u32 lineno, u32 colno);
+ static WEB_API void did_report_content_security_policy_violation(WorkerAgentOwnerToken, u64 policy_index, String effective_directive, URL::URL resource);
static WEB_API void did_close_worker(WorkerAgentOwnerToken);
static WEB_API void did_worker_agent_die(WorkerAgentOwnerToken);
@@ -46,6 +47,7 @@ private:
void forget_agent();
void dispatch_error_event();
void dispatch_worker_exception(Utf16String message, Utf16String filename, u32 lineno, u32 colno);
+ void report_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource);
static WorkerAgentOwnerToken next_owner_token();
diff --git a/Libraries/LibWebView/WebWorkerClient.cpp b/Libraries/LibWebView/WebWorkerClient.cpp
index d5ae74c2f58..c65509a873a 100644
--- a/Libraries/LibWebView/WebWorkerClient.cpp
+++ b/Libraries/LibWebView/WebWorkerClient.cpp
@@ -77,6 +77,11 @@ void WebWorkerClient::did_report_worker_exception(Utf16String message, Utf16Stri
WorkerProcessManager::the().worker_did_report_exception(m_agent_id, move(message), move(filename), lineno, colno);
}
+void WebWorkerClient::did_report_outside_settings_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource)
+{
+ WorkerProcessManager::the().worker_did_report_outside_settings_content_security_policy_violation(m_agent_id, policy_index, move(effective_directive), move(resource));
+}
+
void WebWorkerClient::remove_blob_url_entries()
{
if (auto session = m_session.strong_ref())
diff --git a/Libraries/LibWebView/WebWorkerClient.h b/Libraries/LibWebView/WebWorkerClient.h
index 98c961ffccc..30ae9aecd23 100644
--- a/Libraries/LibWebView/WebWorkerClient.h
+++ b/Libraries/LibWebView/WebWorkerClient.h
@@ -52,6 +52,7 @@ public:
virtual void did_finish_loading_worker_script(bool worker_is_secure_context) override;
virtual void did_fail_loading_worker_script() override;
virtual void did_report_worker_exception(Utf16String message, Utf16String filename, u32 lineno, u32 colno) override;
+ virtual void did_report_outside_settings_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource) override;
virtual Messages::WebWorkerClient::DidRequestCookieResponse did_request_cookie(URL::URL, HTTP::Cookie::Source) override;
virtual Messages::WebWorkerClient::DidAddBlobUrlEntryResponse did_add_blob_url_entry(Web::HTML::EnvironmentId environment_id, Utf16String url, Web::FileAPI::SerializedBlobURLEntry entry) override;
virtual void did_remove_blob_url_entries(Web::HTML::EnvironmentId environment_id, Vector<Utf16String> urls) override;
diff --git a/Libraries/LibWebView/WorkerProcessManager.cpp b/Libraries/LibWebView/WorkerProcessManager.cpp
index 728ade504e6..aaece7f1b2f 100644
--- a/Libraries/LibWebView/WorkerProcessManager.cpp
+++ b/Libraries/LibWebView/WorkerProcessManager.cpp
@@ -292,6 +292,7 @@ Web::HTML::WorkerAgentId WorkerProcessManager::start_worker_agent(Owner owner, O
.top_level_origin = top_level_origin,
.shared_worker_key = {},
.owners = move(owners),
+ .outside_settings_owner = owner,
.inside_settings = move(inside_settings),
.may_read_local_files = may_read_local_files,
.script_blob_url = {},
@@ -372,6 +373,7 @@ void WorkerProcessManager::remove_web_content_owner(WebContentClient& client)
auto const* web_content_owner = owner.client.get_pointer<WebContentOwner>();
return web_content_owner && web_content_owner->client.ptr() == &client;
});
+ forget_removed_outside_settings_owner(agent);
if (agent.owners.is_empty())
agents_to_close.append(agent.id);
}
@@ -389,6 +391,7 @@ void WorkerProcessManager::remove_web_worker_owner(WebWorkerClient& client)
auto const* web_worker_owner = owner.client.get_pointer<WebWorkerOwner>();
return web_worker_owner && web_worker_owner->client.ptr() == &client;
});
+ forget_removed_outside_settings_owner(agent);
if (agent.owners.is_empty())
agents_to_close.append(agent.id);
}
@@ -519,6 +522,18 @@ void WorkerProcessManager::notify_worker_exception(Owner const& owner, Utf16Stri
});
}
+void WorkerProcessManager::notify_worker_content_security_policy_violation(Owner const& owner, u64 policy_index, String const& effective_directive, URL::URL const& resource)
+{
+ owner.client.visit(
+ [&](WebContentOwner const& web_content_owner) {
+ if (web_content_owner.client)
+ web_content_owner.client->async_did_worker_agent_report_content_security_policy_violation(owner.token, policy_index, effective_directive, resource);
+ },
+ [&](WebWorkerOwner const& web_worker_owner) {
+ web_worker_owner.client->async_did_worker_agent_report_content_security_policy_violation(owner.token, policy_index, effective_directive, resource);
+ });
+}
+
void WorkerProcessManager::notify_worker_close(Owner const& owner)
{
owner.client.visit(
@@ -552,6 +567,7 @@ void WorkerProcessManager::worker_did_finish_loading_script(Web::HTML::WorkerAge
auto& agent = maybe_agent->value;
agent.worker_is_secure_context = worker_is_secure_context;
agent.script_blob_url = {};
+ agent.outside_settings_owner = {};
}
void WorkerProcessManager::worker_did_fail_loading_script(Web::HTML::WorkerAgentId agent_id)
@@ -565,6 +581,7 @@ void WorkerProcessManager::worker_did_fail_loading_script(Web::HTML::WorkerAgent
return;
agent.closing = true;
+ agent.outside_settings_owner = {};
auto owners = agent.owners;
for (auto const& owner : owners)
notify_worker_script_load_failure(owner);
@@ -584,6 +601,20 @@ void WorkerProcessManager::worker_did_report_exception(Web::HTML::WorkerAgentId
notify_worker_exception(owner, message, filename, lineno, colno);
}
+void WorkerProcessManager::worker_did_report_outside_settings_content_security_policy_violation(Web::HTML::WorkerAgentId agent_id, u64 policy_index, String effective_directive, URL::URL resource)
+{
+ auto maybe_agent = m_agents.find(agent_id);
+ if (maybe_agent == m_agents.end())
+ return;
+
+ // NB: Only the worker's script fetch uses outside settings as its client, so its violations are only reported
+ // until that fetch completes, and only to the owner that started the worker, while it still owns it.
+ auto const& agent = maybe_agent->value;
+ if (agent.closing || !agent.outside_settings_owner.has_value())
+ return;
+ notify_worker_content_security_policy_violation(*agent.outside_settings_owner, policy_index, effective_directive, resource);
+}
+
void WorkerProcessManager::worker_did_close(Web::HTML::WorkerAgentId agent_id)
{
auto maybe_agent = m_agents.find(agent_id);
@@ -690,6 +721,30 @@ void WorkerProcessManager::worker_process_did_exit(WebWorkerClient& client)
Core::deferred_invoke([exited_workers = move(exited_workers)] { });
}
+bool WorkerProcessManager::is_same_owner(Owner const& owner, Owner const& identity)
+{
+ if (owner.token != identity.token)
+ return false;
+
+ if (auto const* incoming = identity.client.get_pointer<WebContentOwner>()) {
+ auto const* candidate = owner.client.get_pointer<WebContentOwner>();
+ return candidate && candidate->client.ptr() == incoming->client.ptr();
+ }
+ if (auto const* incoming = identity.client.get_pointer<WebWorkerOwner>()) {
+ auto const* candidate = owner.client.get_pointer<WebWorkerOwner>();
+ return candidate && candidate->client.ptr() == incoming->client.ptr();
+ }
+ return false;
+}
+
+void WorkerProcessManager::forget_removed_outside_settings_owner(WorkerAgent& agent)
+{
+ if (!agent.outside_settings_owner.has_value())
+ return;
+ if (!any_of(agent.owners, [&](Owner const& owner) { return is_same_owner(owner, *agent.outside_settings_owner); }))
+ agent.outside_settings_owner = {};
+}
+
void WorkerProcessManager::remove_owner(Web::HTML::WorkerAgentId agent_id, Owner const& identity)
{
auto maybe_agent = m_agents.find(agent_id);
@@ -698,19 +753,9 @@ void WorkerProcessManager::remove_owner(Web::HTML::WorkerAgentId agent_id, Owner
auto& agent = maybe_agent->value;
auto agent_owned_by_specified_owner = agent.owners.remove_all_matching([&](Owner const& owner) {
- if (owner.token != identity.token)
- return false;
-
- if (auto const* incoming = identity.client.get_pointer<WebContentOwner>()) {
- auto const* candidate = owner.client.get_pointer<WebContentOwner>();
- return candidate && candidate->client.ptr() == incoming->client.ptr();
- }
- if (auto const* incoming = identity.client.get_pointer<WebWorkerOwner>()) {
- auto const* candidate = owner.client.get_pointer<WebWorkerOwner>();
- return candidate && candidate->client.ptr() == incoming->client.ptr();
- }
- return false;
+ return is_same_owner(owner, identity);
});
+ forget_removed_outside_settings_owner(agent);
if (!agent_owned_by_specified_owner)
return;
diff --git a/Libraries/LibWebView/WorkerProcessManager.h b/Libraries/LibWebView/WorkerProcessManager.h
index 5b96f2df21a..ef9ecc8b5a7 100644
--- a/Libraries/LibWebView/WorkerProcessManager.h
+++ b/Libraries/LibWebView/WorkerProcessManager.h
@@ -106,12 +106,14 @@ private:
void notify_worker_script_load_failure(Owner const&);
void notify_worker_exception(Owner const&, Utf16String const& message, Utf16String const& filename, u32 lineno, u32 colno);
+ void notify_worker_content_security_policy_violation(Owner const&, u64 policy_index, String const& effective_directive, URL::URL const& resource);
void notify_worker_close(Owner const&);
void notify_worker_death(Owner const&);
void worker_did_finish_loading_script(Web::HTML::WorkerAgentId, bool worker_is_secure_context);
void worker_did_fail_loading_script(Web::HTML::WorkerAgentId);
void worker_did_report_exception(Web::HTML::WorkerAgentId, Utf16String message, Utf16String filename, u32 lineno, u32 colno);
+ void worker_did_report_outside_settings_content_security_policy_violation(Web::HTML::WorkerAgentId, u64 policy_index, String effective_directive, URL::URL resource);
void worker_did_close(Web::HTML::WorkerAgentId);
void worker_did_die(Web::HTML::WorkerAgentId);
void worker_process_did_exit(WebWorkerClient&);
@@ -137,6 +139,9 @@ private:
Optional<URL::Origin> top_level_origin;
Optional<SharedWorkerKey> shared_worker_key;
Vector<Owner> owners;
+ // The owner that started the worker, whose outside settings are the client of the worker's script fetch, until
+ // that fetch completes or the owner goes away.
+ Optional<Owner> outside_settings_owner;
NonnullOwnPtr<CanonicalWorkerEnvironmentSettingsObject> inside_settings;
bool may_read_local_files { false };
// Keeps the blob URL entry of the worker's script alive until the script is loaded, so that the owner can
@@ -144,6 +149,9 @@ private:
BlobURLHandle script_blob_url;
};
+ static bool is_same_owner(Owner const&, Owner const& identity);
+ static void forget_removed_outside_settings_owner(WorkerAgent&);
+
// A worker whose agent is gone counts toward the workers of its top-level site until its process exits, or until its
// connection closes, which ends its process.
struct ExitingWorker {
diff --git a/Services/WebContent/ConnectionFromClient.cpp b/Services/WebContent/ConnectionFromClient.cpp
index bb27c4d63b7..0e998a7a076 100644
--- a/Services/WebContent/ConnectionFromClient.cpp
+++ b/Services/WebContent/ConnectionFromClient.cpp
@@ -3599,6 +3599,11 @@ void ConnectionFromClient::did_worker_agent_report_exception(Web::HTML::WorkerAg
Web::HTML::WorkerAgentParent::did_report_worker_exception(owner_token, move(message), move(filename), lineno, colno);
}
+void ConnectionFromClient::did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource)
+{
+ Web::HTML::WorkerAgentParent::did_report_content_security_policy_violation(owner_token, policy_index, move(effective_directive), move(resource));
+}
+
void ConnectionFromClient::did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token)
{
Web::HTML::WorkerAgentParent::did_close_worker(owner_token);
diff --git a/Services/WebContent/ConnectionFromClient.h b/Services/WebContent/ConnectionFromClient.h
index be206dab41a..a1a821423e0 100644
--- a/Services/WebContent/ConnectionFromClient.h
+++ b/Services/WebContent/ConnectionFromClient.h
@@ -339,6 +339,7 @@ private:
virtual void broadcast_channel_message(Web::HTML::BroadcastChannelMessage message) override;
virtual void did_worker_agent_fail_loading_script(Web::HTML::WorkerAgentOwnerToken owner_token) override;
virtual void did_worker_agent_report_exception(Web::HTML::WorkerAgentOwnerToken owner_token, Utf16String message, Utf16String filename, u32 lineno, u32 colno) override;
+ virtual void did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource) override;
virtual void did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token) override;
virtual void did_worker_agent_die(Web::HTML::WorkerAgentOwnerToken owner_token) override;
diff --git a/Services/WebContent/WebContentServer.ipc b/Services/WebContent/WebContentServer.ipc
index 60433949752..fe0854a2fe7 100644
--- a/Services/WebContent/WebContentServer.ipc
+++ b/Services/WebContent/WebContentServer.ipc
@@ -311,6 +311,7 @@ endpoint WebContentServer routed by Web::PageId page_id
did_worker_agent_fail_loading_script(Web::HTML::WorkerAgentOwnerToken owner_token) =|
did_worker_agent_report_exception(Web::HTML::WorkerAgentOwnerToken owner_token, Utf16String message, Utf16String filename, u32 lineno, u32 colno) =|
+ did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource) =|
did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token) =|
did_worker_agent_die(Web::HTML::WorkerAgentOwnerToken owner_token) =|
diff --git a/Services/WebWorker/ConnectionFromClient.cpp b/Services/WebWorker/ConnectionFromClient.cpp
index cf445e71bc0..5f74f53c356 100644
--- a/Services/WebWorker/ConnectionFromClient.cpp
+++ b/Services/WebWorker/ConnectionFromClient.cpp
@@ -200,6 +200,11 @@ void ConnectionFromClient::did_worker_agent_report_exception(Web::HTML::WorkerAg
Web::HTML::WorkerAgentParent::did_report_worker_exception(owner_token, move(message), move(filename), lineno, colno);
}
+void ConnectionFromClient::did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource)
+{
+ Web::HTML::WorkerAgentParent::did_report_content_security_policy_violation(owner_token, policy_index, move(effective_directive), move(resource));
+}
+
void ConnectionFromClient::did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token)
{
Web::HTML::WorkerAgentParent::did_close_worker(owner_token);
diff --git a/Services/WebWorker/ConnectionFromClient.h b/Services/WebWorker/ConnectionFromClient.h
index 56fa50e217c..6e26758ca0a 100644
--- a/Services/WebWorker/ConnectionFromClient.h
+++ b/Services/WebWorker/ConnectionFromClient.h
@@ -69,6 +69,7 @@ private:
virtual void blob_url_entry_removed(Utf16String url) override;
virtual void did_worker_agent_fail_loading_script(Web::HTML::WorkerAgentOwnerToken owner_token) override;
virtual void did_worker_agent_report_exception(Web::HTML::WorkerAgentOwnerToken owner_token, Utf16String message, Utf16String filename, u32 lineno, u32 colno) override;
+ virtual void did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource) override;
virtual void did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token) override;
virtual void did_worker_agent_die(Web::HTML::WorkerAgentOwnerToken owner_token) override;
virtual void broadcast_channel_message(Web::HTML::BroadcastChannelMessage message) override;
diff --git a/Services/WebWorker/PageHost.cpp b/Services/WebWorker/PageHost.cpp
index 28ac39e4da1..02fd58a7ee6 100644
--- a/Services/WebWorker/PageHost.cpp
+++ b/Services/WebWorker/PageHost.cpp
@@ -104,6 +104,11 @@ void PageHost::page_did_report_worker_exception(Utf16String const& message, Utf1
m_client.async_did_report_worker_exception(message, filename, lineno, colno);
}
+void PageHost::did_report_outside_settings_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource)
+{
+ m_client.async_did_report_outside_settings_content_security_policy_violation(policy_index, effective_directive, resource);
+}
+
void PageHost::page_did_post_broadcast_channel_message(Web::HTML::PostedBroadcastChannelMessage const& message)
{
m_client.async_did_post_broadcast_channel_message(message);
diff --git a/Services/WebWorker/PageHost.h b/Services/WebWorker/PageHost.h
index a1b31ca2fe1..cd2aacec166 100644
--- a/Services/WebWorker/PageHost.h
+++ b/Services/WebWorker/PageHost.h
@@ -61,6 +61,7 @@ public:
void set_maximum_frames_per_second(double maximum_frames_per_second) { m_maximum_frames_per_second = maximum_frames_per_second; }
void did_finish_loading_worker_script(bool worker_is_secure_context);
void did_fail_loading_worker_script();
+ void did_report_outside_settings_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource);
private:
explicit PageHost(ConnectionFromClient&);
diff --git a/Services/WebWorker/WebWorkerClient.ipc b/Services/WebWorker/WebWorkerClient.ipc
index 2551c57f637..ceb29a9058a 100644
--- a/Services/WebWorker/WebWorkerClient.ipc
+++ b/Services/WebWorker/WebWorkerClient.ipc
@@ -17,6 +17,7 @@ endpoint WebWorkerClient {
did_finish_loading_worker_script(bool worker_is_secure_context) =|
did_fail_loading_worker_script() =|
did_report_worker_exception(Utf16String message, Utf16String filename, u32 lineno, u32 colno) =|
+ did_report_outside_settings_content_security_policy_violation(u64 policy_index, String effective_directive, URL::URL resource) =|
did_request_cookie(URL::URL url, HTTP::Cookie::Source source) => (HTTP::Cookie::VersionedCookie cookie)
did_request_file(ByteString path, i32 request_id) =|
did_is_known_hsts_host(String domain) => (bool result)
diff --git a/Services/WebWorker/WebWorkerServer.ipc b/Services/WebWorker/WebWorkerServer.ipc
index 6e07427f9b6..af1e377d0a2 100644
--- a/Services/WebWorker/WebWorkerServer.ipc
+++ b/Services/WebWorker/WebWorkerServer.ipc
@@ -41,6 +41,7 @@ endpoint WebWorkerServer {
did_worker_agent_fail_loading_script(Web::HTML::WorkerAgentOwnerToken owner_token) =|
did_worker_agent_report_exception(Web::HTML::WorkerAgentOwnerToken owner_token, Utf16String message, Utf16String filename, u32 lineno, u32 colno) =|
+ did_worker_agent_report_content_security_policy_violation(Web::HTML::WorkerAgentOwnerToken owner_token, u64 policy_index, String effective_directive, URL::URL resource) =|
did_worker_agent_close(Web::HTML::WorkerAgentOwnerToken owner_token) =|
did_worker_agent_die(Web::HTML::WorkerAgentOwnerToken owner_token) =|
diff --git a/Services/WebWorker/WorkerHost.cpp b/Services/WebWorker/WorkerHost.cpp
index 6b5d575fc3b..7da922d0ea3 100644
--- a/Services/WebWorker/WorkerHost.cpp
+++ b/Services/WebWorker/WorkerHost.cpp
@@ -131,6 +131,12 @@ void WorkerHost::run(GC::Ref<Web::Page> page, Web::HTML::TransferDataEncoder mes
if (auto const* window = outside_settings_snapshot.global.get_pointer<Web::HTML::SerializedWindow>())
outside_settings->creation_url = window->associated_document.url;
+ // AD-HOC: Outside settings' global object is in the owner's process, so the violations of its policies, such as by
+ // the worker script fetch, are reported to the owner.
+ outside_settings->set_report_violation(GC::create_function(GC::Heap::the(), [page](u64 policy_index, String effective_directive, URL::URL resource) {
+ as<WebWorker::PageHost>(page->client()).did_report_outside_settings_content_security_policy_violation(policy_index, move(effective_directive), move(resource));
+ }));
+
// 10. If is shared is true, then:
if (is_shared) {
auto& shared_global_scope = static_cast<Web::HTML::SharedWorkerGlobalScope&>(*worker_global_scope);
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.txt
index 0cb8672f9ef..004246cd016 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http.txt
index 929e9c63085..da8c3288759 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.txt
index 0cb8672f9ef..004246cd016 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for sharedworker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/worker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/worker-import-data.http.txt
index 929e9c63085..da8c3288759 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/worker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-self/worker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.http.txt
index 929e9c63085..da8c3288759 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.txt
index e3bed1b8191..e6f34393d4d 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.txt
@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
-2 Pass
-2 Fail
+4 Pass
Pass Content Security Policy: Expects blocked for sharedworker-module to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-module to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for sharedworker-module to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for sharedworker-module to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for sharedworker-module to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for sharedworker-module to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-classic.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-classic.http.txt
index 7a557b0936a..26ac27c502f 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-classic.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-classic.http.txt
@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
-2 Pass
-2 Fail
+4 Pass
Pass Content Security Policy: Expects blocked for worker-classic to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-classic to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-classic to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-classic to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-classic to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-classic to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-import.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-import.http.txt
index 9829ac2a624..c0356fd7611 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-import.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-none/worker-import.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-import to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.http.txt b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.http.txt
index 929e9c63085..da8c3288759 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.http.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.http.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-6 Pass
-6 Fail
+12 Pass
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to cross-http origin and swap-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and keep-origin redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and no-redirect redirection from http context.: securitypolicyviolation
Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.
-Fail Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file
+Pass Content Security Policy: Expects blocked for worker-import-data to same-http origin and swap-origin redirection from http context.: securitypolicyviolation
\ No newline at end of file