Browse code

Fixing CVE-2017-7529 in nginx

Change-Id: Ie9c1fcf89a6c7957b9a00acbe79a75959b5137c6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4065
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>

DheerajSShetty authored on 2017/10/18 08:55:32
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+diffsrc/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c
1
+--- src/http/modules/ngx_http_range_filter_module.c
2
+@@ -377,6 +377,10 @@ ngx_http_range_parse(ngx_http_request_t 
3
+             range->start = start;
4
+             range->end = end;
5
+ 
6
++            if (size > NGX_MAX_OFF_T_VALUE - (end - start)) {
7
++                return NGX_HTTP_RANGE_NOT_SATISFIABLE;
8
++            }
9
++
10
+             size += end - start;
11
+ 
12
+             if (ranges-- == 0) {
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:    High-performance HTTP server and reverse proxy
2 2
 Name:       nginx
3 3
 Version:    1.11.13
4
-Release:    3%{?dist}
4
+Release:    4%{?dist}
5 5
 License:    BSD-2-Clause
6 6
 URL:        http://nginx.org/download/nginx-1.11.13.tar.gz
7 7
 Group:      Applications/System
... ...
@@ -9,6 +9,7 @@ Vendor:     VMware, Inc.
9 9
 Distribution: Photon
10 10
 Source0:    %{name}-%{version}.tar.gz
11 11
 %define sha1 nginx=84f27729754796181dc39d47da761c7e85eb3ae2
12
+Patch0:     CVE-2017-7529.patch
12 13
 Source1:    nginx.service
13 14
 BuildRequires:  openssl-devel
14 15
 BuildRequires:  pcre-devel
... ...
@@ -17,6 +18,7 @@ NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as
17 17
 
18 18
 %prep
19 19
 %setup -q
20
+%patch0 -p0
20 21
 
21 22
 %build
22 23
 ./configure \
... ...
@@ -50,6 +52,8 @@ make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
50 50
 %dir %{_var}/log/nginx
51 51
 
52 52
 %changelog
53
+*   Tue Oct 17 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.11.13-4
54
+-   Add patch for CVE-2017-7529
53 55
 *   Fri Jun 23 2017 Divya Thaluru <dthaluru@vmware.com> 1.11.13-3
54 56
 -   Removed packaging of debug files
55 57
 *   Mon May 01 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.11.13-2