public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Adrian Vovk <avovk@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/epiphany] f44: Fix CVE-2026-115683
Date: Fri, 30 Oct 2026 18:57:48 GMT [thread overview]
Message-ID: <179338666886.1.9962622995388679635.rpms-epiphany-2e46bd092cc3@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/epiphany
Branch : f44
Commit : 2e46bd092cc376bd0f11846a8c204c4b14d93211
Author : Adrian Vovk <avovk@redhat.com>
Date : 2026-10-30T14:41:57-04:00
Stats : +264/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/epiphany/c/2e46bd092cc376bd0f11846a8c204c4b14d93211?branch=f44
Log:
Fix CVE-2026-115683
Co-Authored-By: Claude
---
diff --git a/CVE-2026-115683.patch b/CVE-2026-115683.patch
new file mode 100644
index 0000000..db06a6a
--- /dev/null
+++ b/CVE-2026-115683.patch
@@ -0,0 +1,263 @@
+From 6007c3981e3217b86d4e1936d813e5c17f0a0f3d Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro@gnome.org>
+Date: Thu, 29 Oct 2026 08:13:49 -0500
+Subject: [PATCH] web-view: register main world message handlers when
+ LOAD_COMMITTED
+
+When registering the message handler immediately before the next page
+load, we allow a tiny race window where untrusted web content is able to
+access it for a few milliseconds. Oops. Instead, let's wait until the
+next load has been committed.
+
+Fixes #2978
+
+Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/2245>
+
+(cherry picked from commit 0b9a28d4f27893bf820562d4fc669d203c204077)
+
+Co-authored-by: Michael Catanzaro <mcatanzaro@gnome.org>
+
+[Adapted for epiphany 50: The upstream patch wouldn't apply because of
+a context-mismatch: the newer version uses G_CONNECT_DEFAULT, but the older
+uses just 0. Backported to make the patch apply]
+---
+ embed/ephy-about-handler.c | 6 +--
+ embed/ephy-web-view.c | 92 ++++++++++++++++++++++++++------------
+ embed/ephy-web-view.h | 10 +----
+ 3 files changed, 68 insertions(+), 40 deletions(-)
+
+diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
+index a515506..be249c2 100644
+--- a/embed/ephy-about-handler.c
++++ b/embed/ephy-about-handler.c
+@@ -246,13 +246,13 @@ handle_applications_finished_cb (EphyAboutHandler *handler,
+ GAsyncResult *result,
+ WebKitURISchemeRequest *request)
+ {
+- WebKitWebView *view;
++ WebKitWebView *view = webkit_uri_scheme_request_get_web_view (request);
+ GString *data_str;
+ gsize data_length;
+ GList *applications, *p;
+
+- view = webkit_uri_scheme_request_get_web_view (request);
+- ephy_web_view_register_message_handler (EPHY_WEB_VIEW (view), EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER, EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_CURRENT_PAGE);
++ /* The load has started, but has not been committed yet, so it's not too late to register. */
++ ephy_web_view_register_message_handler_for_next_load (EPHY_WEB_VIEW (view), EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER);
+
+ data_str = g_string_new (NULL);
+ applications = g_task_propagate_pointer (G_TASK (result), NULL);
+diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
+index 70c4bbc..2d35f8f 100644
+--- a/embed/ephy-web-view.c
++++ b/embed/ephy-web-view.c
+@@ -127,8 +127,8 @@ struct _EphyWebView {
+
+ EphyWebViewErrorPage error_page;
+
+- EphyWebViewMessageHandler message_handlers_to_unregister;
+- gboolean just_registered_message_handlers;
++ EphyWebViewMessageHandler message_handlers_to_register;
++ EphyWebViewMessageHandler registered_message_handlers;
+
+ guint unresponsive_process_timeout_id;
+
+@@ -1343,12 +1343,9 @@ about_apps_message_received_cb (WebKitUserContentManager *ucm,
+ }
+
+ void
+-ephy_web_view_register_message_handler (EphyWebView *view,
+- EphyWebViewMessageHandler handler,
+- EphyWebViewMessageHandlerScope scope)
++ephy_web_view_register_message_handler_for_next_load (EphyWebView *view,
++ EphyWebViewMessageHandler handler)
+ {
+- WebKitUserContentManager *ucm = webkit_web_view_get_user_content_manager (WEBKIT_WEB_VIEW (view));
+-
+ /* Use this function to temporarily register message handlers in the main
+ * script world so they are accessible to Epiphany's internal web content. Use
+ * main world message handlers only for internal Epiphany pages. They should
+@@ -1360,20 +1357,27 @@ ephy_web_view_register_message_handler (EphyWebView *view,
+ * WebKitUserContentManager is shared between many WebKitWebViews and the
+ * callback will execute for every view.
+ *
++ * We always delay registration until the next load is committed, to avoid
++ * opening a race window where web content can access the message handler.
++ *
+ * Message handlers registered here will be unregistered when starting a new
+- * load unless ephy_web_view_register_message_handler() has been called again.
+- * That is, it's possible for them to "stack" by loading different pages
+- * in succession without loading any pages that do not use message handlers.
+- * This should be fine, although there is theoretical abuse potential in
+- * unrealistic scenarios if there are XSS vulnerabilities in internal pages.
++ * load.
+ */
+
+- if (scope == EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_NEXT_LOAD)
+- view->just_registered_message_handlers = TRUE;
++ view->message_handlers_to_register |= handler;
++}
++
++static void
++register_message_handler (EphyWebView *view,
++ EphyWebViewMessageHandler handler)
++{
++ WebKitUserContentManager *ucm = webkit_web_view_get_user_content_manager (WEBKIT_WEB_VIEW (view));
+
+- if (view->message_handlers_to_unregister & handler)
++ if (view->registered_message_handlers & handler)
+ return;
+
++ view->registered_message_handlers |= handler;
++
+ switch (handler) {
+ case EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER:
+ webkit_user_content_manager_register_script_message_handler (ucm, "tlsErrorPage", NULL);
+@@ -1394,8 +1398,27 @@ ephy_web_view_register_message_handler (EphyWebView *view,
+ view, 0);
+ break;
+ }
++}
++
++static void
++register_pending_message_handlers (EphyWebView *view)
++{
++ if (view->message_handlers_to_register & EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER)
++ register_message_handler (view, EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER);
++
++ if (view->message_handlers_to_register & EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER)
++ register_message_handler (view, EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER);
++
++ if (view->message_handlers_to_register & EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER)
++ register_message_handler (view, EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER);
+
+- view->message_handlers_to_unregister |= handler;
++ view->message_handlers_to_register = 0;
++}
++
++static void
++unregister_pending_message_handlers (EphyWebView *view)
++{
++ view->message_handlers_to_register = 0;
+ }
+
+ static void
+@@ -1403,22 +1426,22 @@ unregister_message_handlers (EphyWebView *view)
+ {
+ WebKitUserContentManager *ucm = webkit_web_view_get_user_content_manager (WEBKIT_WEB_VIEW (view));
+
+- if (view->message_handlers_to_unregister & EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER) {
++ if (view->registered_message_handlers & EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER) {
+ webkit_user_content_manager_unregister_script_message_handler (ucm, "tlsErrorPage", NULL);
+ g_signal_handlers_disconnect_by_func (ucm, tls_error_page_message_received_cb, view);
+ }
+
+- if (view->message_handlers_to_unregister & EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER) {
++ if (view->registered_message_handlers & EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER) {
+ webkit_user_content_manager_unregister_script_message_handler (ucm, "reloadPage", NULL);
+ g_signal_handlers_disconnect_by_func (ucm, reload_page_message_received_cb, view);
+ }
+
+- if (view->message_handlers_to_unregister & EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER) {
++ if (view->registered_message_handlers & EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER) {
+ webkit_user_content_manager_unregister_script_message_handler (ucm, "aboutApps", NULL);
+ g_signal_handlers_disconnect_by_func (ucm, about_apps_message_received_cb, view);
+ }
+
+- view->message_handlers_to_unregister = 0;
++ view->registered_message_handlers = 0;
+ }
+
+ static int
+@@ -1592,11 +1615,6 @@ load_changed_cb (WebKitWebView *web_view,
+ }
+
+ ephy_web_view_set_loading_message (view, NULL);
+-
+- if (view->just_registered_message_handlers)
+- view->just_registered_message_handlers = FALSE;
+- else if (view->message_handlers_to_unregister)
+- unregister_message_handlers (view);
+ break;
+ }
+ case WEBKIT_LOAD_REDIRECTED:
+@@ -1638,11 +1656,27 @@ load_changed_cb (WebKitWebView *web_view,
+ else
+ view->error_page = EPHY_WEB_VIEW_ERROR_PAGE_NONE;
+
+- /* Zoom level. */
++ unregister_message_handlers (view);
++ register_pending_message_handlers (view);
++
+ restore_zoom_level (view, uri);
+ break;
+ }
+ case WEBKIT_LOAD_FINISHED:
++ /* If the load was canceled before WEBKIT_LOAD_COMMITTED, we must avoid
++ * improper message handler registration on next WEBKIT_LOAD_COMMITTED, so
++ * we need to unregister here.
++ *
++ * But if the load has just failed, we may be about to start a subsequent
++ * load to display an error page, in which case we must not unregister.
++ *
++ * Confusing: although view->loading_error_page is set to FALSE on
++ * WEBKIT_LOAD_COMMITTED, above, it will get set to TRUE later on. Error
++ * pages are loaded in load_failed_cb().
++ */
++ if (!view->loading_error_page)
++ unregister_pending_message_handlers (view);
++
+ ephy_web_view_unset_loading_message (view);
+
+ /* Ensure we load the icon for this web view, if available. */
+@@ -2277,7 +2311,9 @@ ephy_web_view_load_error_page (EphyWebView *view,
+ button_accesskey, button_label);
+ #pragma GCC diagnostic pop
+
+- ephy_web_view_register_message_handler (view, EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER, EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_NEXT_LOAD);
++ ephy_web_view_register_message_handler_for_next_load (view, EPHY_WEB_VIEW_RELOAD_PAGE_MESSAGE_HANDLER);
++ if (page == EPHY_WEB_VIEW_ERROR_INVALID_TLS_CERTIFICATE)
++ ephy_web_view_register_message_handler_for_next_load (view, EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER);
+
+ /* Make our history backend ignore the next page load, since it will be an error page. */
+ ephy_web_view_freeze_history (view);
+@@ -2353,8 +2389,6 @@ load_failed_with_tls_error_cb (WebKitWebView *web_view,
+ g_clear_object (&view->certificate);
+ g_clear_pointer (&view->tls_error_failing_uri, g_free);
+
+- ephy_web_view_register_message_handler (view, EPHY_WEB_VIEW_TLS_ERROR_PAGE_MESSAGE_HANDLER, EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_NEXT_LOAD);
+-
+ view->certificate = g_object_ref (certificate);
+ view->tls_errors = errors;
+ view->tls_error_failing_uri = g_strdup (uri);
+diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
+index b718832..ef98b63 100644
+--- a/embed/ephy-web-view.h
++++ b/embed/ephy-web-view.h
+@@ -83,11 +83,6 @@ typedef enum {
+ EPHY_WEB_VIEW_ABOUT_APPS_MESSAGE_HANDLER = 1 << 2,
+ } EphyWebViewMessageHandler;
+
+-typedef enum {
+- EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_CURRENT_PAGE,
+- EPHY_WEB_VIEW_REGISTER_MESSAGE_HANDLER_FOR_NEXT_LOAD
+-} EphyWebViewMessageHandlerScope;
+-
+ GtkWidget * ephy_web_view_new (void);
+ GtkWidget *ephy_web_view_new_with_related_view (WebKitWebView *related_view);
+ void ephy_web_view_load_request (EphyWebView *view,
+@@ -187,9 +182,8 @@ char *ephy_web_view_get_web_app_manifest_url_finish (EphyWe
+ GAsyncResult *result,
+ GError **error);
+
+-void ephy_web_view_register_message_handler (EphyWebView *view,
+- EphyWebViewMessageHandler handler,
+- EphyWebViewMessageHandlerScope scope);
++void ephy_web_view_register_message_handler_for_next_load (EphyWebView *view,
++ EphyWebViewMessageHandler handler);
+
+ void ephy_web_view_autofill (EphyWebView *view,
+ const char *selector,
+--
+GitLab
+
diff --git a/epiphany.spec b/epiphany.spec
index 57483f6..2b87d49 100644
--- a/epiphany.spec
+++ b/epiphany.spec
@@ -22,6 +22,7 @@ Patch1: CVE-2026-18487.patch
Patch2: CVE-2026-94291.patch
Patch3: CVE-2026-118599.patch
Patch4: CVE-2026-118598.patch
+Patch5: CVE-2026-115683.patch
BuildRequires: /usr/bin/rst2man
BuildRequires: blueprint-compiler
reply other threads:[~2026-10-30 18:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179338666886.1.9962622995388679635.rpms-epiphany-2e46bd092cc3@fedoraproject.org \
--to=avovk@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox