Browse code

wget : Fix CVE-2017-13089 and CVE-2017-13090

Change-Id: Iae30742f01ba1ef088b16e8cf26a7f7995df0ea5
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4356
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

xiaolin-vmware authored on 2017/11/21 10:33:45
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+From d892291fb8ace4c3b734ea5125770989c215df3f Mon Sep 17 00:00:00 2001
1
+From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
2
+Date: Fri, 20 Oct 2017 10:59:38 +0200
3
+Subject: Fix stack overflow in HTTP protocol handling (CVE-2017-13089)
4
+MIME-Version: 1.0
5
+Content-Type: text/plain; charset=UTF-8
6
+Content-Transfer-Encoding: 8bit
7
+
8
+* src/http.c (skip_short_body): Return error on negative chunk size
9
+
10
+Reported-by: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
11
+Reported-by: Juhani Eronen from Finnish National Cyber Security Centre
12
+---
13
+ src/http.c | 3 +++
14
+ 1 file changed, 3 insertions(+)
15
+
16
+diff --git a/src/http.c b/src/http.c
17
+index 5536768..dc31823 100644
18
+--- a/src/http.c
19
+@@ -973,6 +973,9 @@ skip_short_body (int fd, wgint contlen, bool chunked)
20
+               remaining_chunk_size = strtol (line, &endl, 16);
21
+               xfree (line);
22
+ 
23
++              if (remaining_chunk_size < 0)
24
++                return false;
25
++
26
+               if (remaining_chunk_size == 0)
27
+                 {
28
+                   line = fd_read_line (fd);
29
+-- 
30
+cgit v1.0-41-gc330
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+From ba6b44f6745b14dce414761a8e4b35d31b176bba Mon Sep 17 00:00:00 2001
1
+From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
2
+Date: Fri, 20 Oct 2017 15:15:47 +0200
3
+Subject: Fix heap overflow in HTTP protocol handling (CVE-2017-13090)
4
+MIME-Version: 1.0
5
+Content-Type: text/plain; charset=UTF-8
6
+Content-Transfer-Encoding: 8bit
7
+
8
+* src/retr.c (fd_read_body): Stop processing on negative chunk size
9
+
10
+Reported-by: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
11
+Reported-by: Juhani Eronen from Finnish National Cyber Security Centre
12
+---
13
+ src/retr.c | 6 ++++++
14
+ 1 file changed, 6 insertions(+)
15
+
16
+diff --git a/src/retr.c b/src/retr.c
17
+index c1bc600..6555ed4 100644
18
+--- a/src/retr.c
19
+@@ -378,6 +378,12 @@ fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread,
20
+               remaining_chunk_size = strtol (line, &endl, 16);
21
+               xfree (line);
22
+ 
23
++              if (remaining_chunk_size < 0)
24
++                {
25
++                  ret = -1;
26
++                  break;
27
++                }
28
++
29
+               if (remaining_chunk_size == 0)
30
+                 {
31
+                   ret = 0;
32
+-- 
33
+cgit v1.0-41-gc330
34
+
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A network utility to retrieve files from the Web
2 2
 Name:           wget
3 3
 Version:        1.19.1
4
-Release:        2%{?dist}
4
+Release:        3%{?dist}
5 5
 License:        GPLv3+
6 6
 URL:            http://www.gnu.org/software/wget/wget.html
7 7
 Group:          System Environment/NetworkingPrograms
... ...
@@ -9,6 +9,8 @@ Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 Source0:        ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
11 11
 %define sha1    wget=cde25e99c144191644406793cbd1c69c102c6970
12
+Patch0:         wget-CVE-2017-13089.patch
13
+Patch1:         wget-CVE-2017-13090.patch
12 14
 Requires:       openssl
13 15
 BuildRequires:  openssl-devel
14 16
 %if %{with_check}
... ...
@@ -20,6 +22,8 @@ The Wget package contains a utility useful for non-interactive
20 20
 downloading of files from the Web.
21 21
 %prep
22 22
 %setup -q
23
+%patch0 -p1
24
+%patch1 -p1
23 25
 
24 26
 %build
25 27
 ./configure \
... ...
@@ -56,6 +60,8 @@ rm -rf %{buildroot}/*
56 56
 %{_bindir}/*
57 57
 %{_mandir}/man1/*
58 58
 %changelog
59
+*   Mon Nov 20 2017 Xiaolin Li <xiaolinl@vmware.com> 1.19.1-3
60
+-   Fix CVE-2017-13089 and CVE-2017-13090
59 61
 *   Wed Aug 09 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.19.1-2
60 62
 -   Install HTTP::Daemon perl module for the tests to pass.
61 63
 *   Wed Apr 05 2017 Xiaolin Li <xiaolinl@vmware.com> 1.19.1-1