From 5b6f36dfeab05ed1594117f947bc2fe6668842c5 Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Sun, 2 May 2021 16:41:01 +0300 Subject: [PATCH] LaunchServer: Only consider path in OpenURL This resolves the crash in #6812 where the browser was trying to open a file in the Download directory, but the check against allowed paths was also trying to match the URL fragment. Resolves #6812 --- Userland/Services/LaunchServer/ClientConnection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Services/LaunchServer/ClientConnection.cpp b/Userland/Services/LaunchServer/ClientConnection.cpp index 591390e961..09fc142250 100644 --- a/Userland/Services/LaunchServer/ClientConnection.cpp +++ b/Userland/Services/LaunchServer/ClientConnection.cpp @@ -36,9 +36,11 @@ Messages::LaunchServer::OpenURLResponse ClientConnection::handle(const Messages: { if (!m_allowlist.is_empty()) { bool allowed = false; + auto request_url_without_fragment = request.url(); + request_url_without_fragment.set_fragment({}); for (auto& allowed_handler : m_allowlist) { if (allowed_handler.handler_name == request.handler_name() - && (allowed_handler.any_url || allowed_handler.urls.contains_slow(request.url()))) { + && (allowed_handler.any_url || allowed_handler.urls.contains_slow(request_url_without_fragment))) { allowed = true; break; }