summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-10-22 14:06:48 +0200
committerRemi Collet <remi@remirepo.net>2019-10-22 14:06:48 +0200
commita50888886df92c5c7fed5cc7a74bd65911cd322b (patch)
tree54cfe3401506f270bb8c5f2b78874c1062e09d27
parent3ba80f05620ff05dc3835de45f7d22eba11cca67 (diff)
Fix CVE-2019-11043 env_path_info underflow in fpm_main.c
-rw-r--r--bug77380.patch2
-rw-r--r--bug78599.patch33
-rw-r--r--php54.spec8
3 files changed, 41 insertions, 2 deletions
diff --git a/bug77380.patch b/bug77380.patch
index d3db7db..28c80bd 100644
--- a/bug77380.patch
+++ b/bug77380.patch
@@ -18,7 +18,7 @@ diff --git a/ext/xmlrpc/libxmlrpc/base64.c b/ext/xmlrpc/libxmlrpc/base64.c
index 5ebdf31f7ade..a4fa19327b76 100644
--- a/ext/xmlrpc/libxmlrpc/base64.c
+++ b/ext/xmlrpc/libxmlrpc/base64.c
-@@ -169,7 +169,7 @@ void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length)
+@@ -165,7 +165,7 @@ void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length)
return;
}
diff --git a/bug78599.patch b/bug78599.patch
new file mode 100644
index 0000000..b70a56d
--- /dev/null
+++ b/bug78599.patch
@@ -0,0 +1,33 @@
+Backported for 5.4 from:
+
+
+
+From c69bcb212b37900fd61daaf38762e4974cb4dcc9 Mon Sep 17 00:00:00 2001
+From: Jakub Zelenka <bukka@php.net>
+Date: Sat, 12 Oct 2019 15:56:16 +0100
+Subject: [PATCH 1/2] Fix bug #78599 (env_path_info underflow can lead to RCE)
+ (CVE-2019-11043)
+
+cheery-picked from ab061f95ca966731b1c84cf5b7b20155c0a1c06a
+without the test as tester not available
+---
+ sapi/fpm/fpm/fpm_main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
+index d12ac01859..22b889c167 100644
+--- a/sapi/fpm/fpm/fpm_main.c
++++ b/sapi/fpm/fpm/fpm_main.c
+@@ -1210,8 +1210,8 @@ static void init_request_info(TSRMLS_D)
+ path_info = script_path_translated + ptlen;
+ tflag = (slen != 0 && (!orig_path_info || strcmp(orig_path_info, path_info) != 0));
+ } else {
+- path_info = env_path_info ? env_path_info + pilen - slen : NULL;
+- tflag = (orig_path_info != path_info);
++ path_info = (env_path_info && pilen > slen) ? env_path_info + pilen - slen : NULL;
++ tflag = path_info && (orig_path_info != path_info);
+ }
+
+ if (tflag) {
+
+
diff --git a/php54.spec b/php54.spec
index 1e21033..0d706b5 100644
--- a/php54.spec
+++ b/php54.spec
@@ -99,7 +99,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: php
Version: 5.4.45
-Release: 17%{?dist}
+Release: 18%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -235,6 +235,7 @@ Patch273: bug77020.patch
Patch274: bug77231.patch
Patch275: bug77242.patch
Patch276: bug77380.patch
+Patch277: bug78599.patch
# Fixes for tests
# no_NO issue
@@ -1019,6 +1020,7 @@ rm -f ext/json/utf8_to_utf16.*
%patch274 -p1 -b .bug77231
%patch275 -p1 -b .bug77242
%patch276 -p1 -b .bug77380
+%patch277 -p1 -b .bug78599
# Fixes for tests
%patch301 -p1 -b .datetests2
@@ -1905,6 +1907,10 @@ fi
%changelog
+* Tue Oct 22 2019 Remi Collet <remi@remirepo.net> - 5.4.45-18
+- FPM:
+ Fix CVE-2019-11043 env_path_info underflow in fpm_main.c
+
* Fri Jan 11 2019 Remi Collet <remi@remirepo.net> - 5.4.45-17
- Fix #77242 heap out of bounds read in xmlrpc_decode
- Fix #77380 Global out of bounds read in xmlrpc base64 code