public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/epiphany] f44: Fix CVE-2026-18487
@ 2026-10-23 21:06 Adrian Vovk
  0 siblings, 0 replies; only message in thread
From: Adrian Vovk @ 2026-10-23 21:06 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/epiphany
            Branch : f44
            Commit : 74e872cdeb6bdc31bd2cc966de60f02dc76737c7
            Author : Adrian Vovk <avovk@redhat.com>
            Date   : 2026-10-23T17:02:49-04:00
            Stats  : +168/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/epiphany/c/74e872cdeb6bdc31bd2cc966de60f02dc76737c7?branch=f44

            Log:
            Fix CVE-2026-18487

rhbz#2509773

---
diff --git a/CVE-2026-18487.patch b/CVE-2026-18487.patch
new file mode 100644
index 0000000..f2b69d7
--- /dev/null
+++ b/CVE-2026-18487.patch
@@ -0,0 +1,166 @@
+From ae56ad5964dede1930cf816120dbd9e73f54beae Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro@gnome.org>
+Date: Wed, 8 Jul 2026 16:27:11 -0500
+Subject: [PATCH] Fix address bar spoofing when userinfo contains : character
+
+Our algorithm for finding the host component of the URL without using a
+URL parser is easily defeated by a colon in the userinfo section.
+Tighten this up.
+
+It's a real shame that we cannot use a normal URL parser here. But the
+goal is to return a pointer into the original string, without mutating
+it, so that's not an option.
+
+Fixes #2897
+---
+ lib/ephy-uri-helpers.c        |  7 ++++---
+ tests/ephy-uri-helpers-test.c | 16 +++++++++++++++-
+ 2 files changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/lib/ephy-uri-helpers.c b/lib/ephy-uri-helpers.c
+index aa11edb43..a67005741 100644
+--- a/lib/ephy-uri-helpers.c
++++ b/lib/ephy-uri-helpers.c
+@@ -96,11 +96,12 @@ ephy_uri_get_base_domain (const char *hostname)
+ static const char *
+ get_first_colon_after_host (const char *authority_start)
+ {
+-  const char *search_start = authority_start;
++  const char *userinfo_end = strchr (authority_start, '@');
++  const char *search_start = userinfo_end ? userinfo_end + 1 : authority_start;
+ 
+   /* Skip colons in IPv6 addresses */
+-  if (authority_start[0] == '[') {
+-    const char *bracket_close = strchr (authority_start, ']');
++  if (search_start[0] == '[') {
++    const char *bracket_close = strchr (search_start, ']');
+     if (bracket_close)
+       search_start = bracket_close;
+   }
+diff --git a/tests/ephy-uri-helpers-test.c b/tests/ephy-uri-helpers-test.c
+index daf5b7180..b800419db 100644
+--- a/tests/ephy-uri-helpers-test.c
++++ b/tests/ephy-uri-helpers-test.c
+@@ -30,12 +30,25 @@ test_ephy_uri_decode (void)
+ 
+   result = ephy_uri_decode ("https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8");
+   g_assert_cmpstr (result, ==, "https://ja.wikipedia.org/wiki/メインページ");
+-
+   g_clear_pointer (&result, g_free);
++
+   result = ephy_uri_decode ("https://xn--9dbaqfu.xn--4dbrk0ce/");
+   g_assert_cmpstr (result, ==, "https://כולנו.ישראל/");
+ }
+ 
++static void
++test_ephy_uri_get_decoded_host (void)
++{
++  g_autofree char *result = NULL;
++
++  result = ephy_uri_get_decoded_host ("https://example.com:80@www.gnome.org/");
++  g_assert_cmpstr (result, ==, "www.gnome.org");
++  g_clear_pointer (&result, g_free);
++
++  result = ephy_uri_get_decoded_host ("https://[::1]:8080/");
++  g_assert_cmpstr (result, ==, "[::1]");
++}
++
+ int
+ main (int   argc,
+       char *argv[])
+@@ -45,6 +58,7 @@ main (int   argc,
+   g_test_init (&argc, &argv, NULL);
+ 
+   g_test_add_func ("/lib/ephy-uri-helpers/decode", test_ephy_uri_decode);
++  g_test_add_func ("/lib/ephy-uri-helpers/get-decoded-host", test_ephy_uri_get_decoded_host);
+ 
+   ret = g_test_run ();
+ 
+-- 
+GitLab
+
+
+From 9c741b210c8b9fa2554bf3273ff10add3126bfc7 Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro@gnome.org>
+Date: Tue, 25 Aug 2026 17:06:10 -0500
+Subject: [PATCH] web-view: data URIs use local security level
+
+This makes sense, because all the data loaded by the URI is provided by
+the URI itself.
+
+What am I actually trying to achieve here? It blocks opening the
+Security & Permissions page. Helps: #2934
+---
+ embed/ephy-web-view.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
+index b3aaec1e0..c310fef51 100644
+--- a/embed/ephy-web-view.c
++++ b/embed/ephy-web-view.c
+@@ -1187,6 +1187,7 @@ update_security_status_for_committed_load (EphyWebView *view,
+   if (!guri ||
+       strcmp (g_uri_get_scheme (guri), EPHY_VIEW_SOURCE_SCHEME) == 0 ||
+       strcmp (g_uri_get_scheme (guri), EPHY_READER_SCHEME) == 0 ||
++      strcmp (g_uri_get_scheme (guri), "data") == 0 ||
+       g_strcmp0 (tld, "127.0.0.1") == 0 ||
+       g_strcmp0 (tld, "::1") == 0 ||
+       g_strcmp0 (tld, "localhost") == 0 || /* We trust localhost to be local since glib!616. */
+-- 
+GitLab
+
+
+From 75922d7ab0706621786c5d82060bbd37466db1fb Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro@gnome.org>
+Date: Tue, 25 Aug 2026 19:29:20 -0500
+Subject: [PATCH] Fix address bar spoofing when data URL contains ://
+
+My insufficient creativity bites again. The URL
+data:text/html,hello%20i%20am%20https://microsoft.com is currently
+displayed as microsoft.com.
+
+This time, it's not a bug copied from applyHostNameFunctionToURLString.
+That function contains a check to ensure all characters before the ://
+are valid scheme characters, which notably prohibits the colon in a
+data: URL. But I didn't copy that into Epiphany because I'm a dumb human
+and foolishly assumed it was not important.
+
+Fixes #2934
+---
+ lib/ephy-uri-helpers.c        | 5 +++++
+ tests/ephy-uri-helpers-test.c | 3 +++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/lib/ephy-uri-helpers.c b/lib/ephy-uri-helpers.c
+index a67005741..63702747e 100644
+--- a/lib/ephy-uri-helpers.c
++++ b/lib/ephy-uri-helpers.c
+@@ -134,6 +134,11 @@ ephy_uri_get_decoded_host (const char *decoded_uri)
+   if (!protocol_end)
+     return NULL;
+ 
++  for (const char *c = copy; c != protocol_end; c++) {
++    if (!g_ascii_isalnum (c[0]) && c[0] != '+' && c[0] != '-' && c[0] != '.')
++      return NULL;
++  }
++
+   authority_start = protocol_end + strlen ("://");
+ 
+   first_colon = get_first_colon_after_host (authority_start);
+diff --git a/tests/ephy-uri-helpers-test.c b/tests/ephy-uri-helpers-test.c
+index b800419db..6e6c057aa 100644
+--- a/tests/ephy-uri-helpers-test.c
++++ b/tests/ephy-uri-helpers-test.c
+@@ -47,6 +47,9 @@ test_ephy_uri_get_decoded_host (void)
+ 
+   result = ephy_uri_get_decoded_host ("https://[::1]:8080/");
+   g_assert_cmpstr (result, ==, "[::1]");
++
++  result = ephy_uri_get_decoded_host ("data:text/html,hello i am https://microsoft.com");
++  g_assert_cmpstr (result, ==, NULL);
+ }
+ 
+ int
+-- 
+GitLab
+

diff --git a/epiphany.spec b/epiphany.spec
index 0545521..f4908ee 100644
--- a/epiphany.spec
+++ b/epiphany.spec
@@ -18,6 +18,8 @@ Source0:        https://download.gnome.org/sources/epiphany/50/%{name}-%{tarball
 # Fedora bookmarks
 Patch0:         epiphany-default-bookmarks.patch
 
+Patch1:         CVE-2026-18487.patch
+
 BuildRequires:  /usr/bin/rst2man
 BuildRequires:  blueprint-compiler
 BuildRequires:  desktop-file-utils

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-23 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 21:06 [rpms/epiphany] f44: Fix CVE-2026-18487 Adrian Vovk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox