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

            A new commit has been pushed.

            Repo   : rpms/epiphany
            Branch : f43
            Commit : 035aea647640d2d4c8456b98b5cd407cd543c072
            Author : Adrian Vovk <avovk@redhat.com>
            Date   : 2026-10-23T17:30:16-04:00
            Stats  : +176/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/epiphany/c/035aea647640d2d4c8456b98b5cd407cd543c072?branch=f43

            Log:
            Fix CVE-2026-18487

rhbz#2509773

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---
diff --git a/CVE-2026-18487.patch b/CVE-2026-18487.patch
new file mode 100644
index 0000000..d5a9688
--- /dev/null
+++ b/CVE-2026-18487.patch
@@ -0,0 +1,174 @@
+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 1/3] 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        | 18 +++++++++++++++++-
+ tests/ephy-uri-helpers-test.c | 14 ++++++++++++++
+ 2 files changed, 31 insertions(+), 1 deletion(-)
+
+diff --git a/lib/ephy-uri-helpers.c b/lib/ephy-uri-helpers.c
+index dd701d6..138eac8 100644
+--- a/lib/ephy-uri-helpers.c
++++ b/lib/ephy-uri-helpers.c
+@@ -124,6 +124,22 @@ ephy_uri_get_base_domain (const char *hostname)
+   return g_strdup (base_domain);
+ }
+ 
++static const char *
++get_first_colon_after_host (const char *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 (search_start[0] == '[') {
++    const char *bracket_close = strchr (search_start, ']');
++    if (bracket_close)
++      search_start = bracket_close;
++  }
++
++  return g_utf8_strchr (search_start, -1, ':');
++}
++
+ char *
+ ephy_uri_get_decoded_host (const char *decoded_uri)
+ {
+@@ -151,7 +167,7 @@ ephy_uri_get_decoded_host (const char *decoded_uri)
+ 
+   authority_start = protocol_end + strlen ("://");
+ 
+-  first_colon = g_utf8_strchr (authority_start, -1, ':');
++  first_colon = get_first_colon_after_host (authority_start);
+   first_slash = g_utf8_strchr (authority_start, -1, '/');
+   first_question_mark = g_utf8_strchr (authority_start, -1, '?');
+   first_octothorpe = g_utf8_strchr (authority_start, -1, '#');
+diff --git a/tests/ephy-uri-helpers-test.c b/tests/ephy-uri-helpers-test.c
+index b115b83..3362e84 100644
+--- a/tests/ephy-uri-helpers-test.c
++++ b/tests/ephy-uri-helpers-test.c
+@@ -49,6 +49,19 @@ test_ephy_uri_normalize (void)
+    */
+ }
+ 
++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[])
+@@ -59,6 +72,7 @@ main (int   argc,
+ 
+   g_test_add_func ("/lib/ephy-uri-helpers/decode", test_ephy_uri_decode);
+   g_test_add_func ("/lib/ephy-uri-helpers/normalize", test_ephy_uri_normalize);
++  g_test_add_func ("/lib/ephy-uri-helpers/get-decoded-host", test_ephy_uri_get_decoded_host);
+ 
+   ret = g_test_run ();
+ 
+-- 
+2.56.0
+
+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 2/3] 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 82a4457..03e3c50 100644
+--- a/embed/ephy-web-view.c
++++ b/embed/ephy-web-view.c
+@@ -1185,6 +1185,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. */
+-- 
+2.56.0
+
+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 3/3] 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 138eac8..0329475 100644
+--- a/lib/ephy-uri-helpers.c
++++ b/lib/ephy-uri-helpers.c
+@@ -165,6 +165,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 3362e84..8d116d1 100644
+--- a/tests/ephy-uri-helpers-test.c
++++ b/tests/ephy-uri-helpers-test.c
+@@ -60,6 +60,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
+-- 
+2.56.0
+

diff --git a/epiphany.spec b/epiphany.spec
index 18e7d2b..362707b 100644
--- a/epiphany.spec
+++ b/epiphany.spec
@@ -18,6 +18,8 @@ Source0:        https://download.gnome.org/sources/epiphany/49/%{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:42 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:42 [rpms/epiphany] f43: 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