Browse code

libsoup: Fix for CVE-2018-12910

Added a patch to fix CVE-2018-12910

Change-Id: I8238446236a10c6c4ee87bfe064bb503775cf488
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5571
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Ankit Jain authored on 2018/09/03 23:59:50
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+From db2b0d5809d5f8226d47312b40992cadbcde439f Mon Sep 17 00:00:00 2001
1
+From: Michael Catanzaro <mcatanzaro@igalia.com>
2
+Date: Sun, 24 Jun 2018 19:46:19 -0500
3
+Subject: [PATCH] cookie-jar: bail if hostname is an empty string
4
+
5
+There are several other ways to fix the problem with this function, but
6
+skipping over all of the code is probably the simplest.
7
+
8
+Fixes #3
9
+---
10
+ libsoup/soup-cookie-jar.c | 2 +-
11
+ 1 file changed, 1 insertion(+), 1 deletion(-)
12
+
13
+diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
14
+index 2369c8a7..b2b78909 100644
15
+--- a/libsoup/soup-cookie-jar.c
16
+@@ -307,7 +307,7 @@ get_cookies (SoupCookieJar *jar, SoupURI *uri, gboolean for_http, gboolean copy_
17
+ 
18
+ 	priv = soup_cookie_jar_get_instance_private (jar);
19
+ 
20
+-	if (!uri->host)
21
++	if (!uri->host || !uri->host[0])
22
+ 		return NULL;
23
+ 
24
+ 	/* The logic here is a little weird, but the plan is that if
25
+-- 
26
+2.18.0
27
+
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:    libsoup HTTP client/server library
2 2
 Name:       libsoup
3 3
 Version:    2.57.1
4
-Release:    3%{?dist}
4
+Release:    4%{?dist}
5 5
 License:    GPLv2
6 6
 URL:        http://wiki.gnome.org/LibSoup
7 7
 Group:      System Environment/Development
... ...
@@ -10,6 +10,7 @@ Distribution:   Photon
10 10
 Source0:    http://ftp.gnome.org/pub/GNOME/sources/libsoup/2.57/%{name}-%{version}.tar.xz
11 11
 %define sha1 libsoup=a855a98c1d002a4e2bfb7562135265a8df4dad65
12 12
 Patch0:          CVE-2017-2885.patch
13
+Patch1:          CVE-2018-12910.patch
13 14
 BuildRequires:   glib
14 15
 BuildRequires:   glib-devel
15 16
 BuildRequires:   gobject-introspection
... ...
@@ -56,6 +57,7 @@ These are the additional language files of libsoup.
56 56
 %prep
57 57
 %setup -q
58 58
 %patch0 -p1
59
+%patch1 -p1
59 60
 
60 61
 %build
61 62
 export CFLAGS="%{optflags}"
... ...
@@ -93,6 +95,8 @@ make  check
93 93
 %defattr(-,root,root)
94 94
 
95 95
 %changelog
96
+*   Mon Sep 03 2018 Ankit Jain <ankitja@vmware.com> 2.57.1-4
97
+-   Fix for CVE-2018-12910
96 98
 *   Mon Jun 18 2018 Tapas Kundu <tkundu@vmware.com> 2.57.1-3
97 99
 -   CVE-2017-2885
98 100
 *   Fri Aug 11 2017 Chang Lee <changlee@vmware.com> 2.57.1-2