From 06bbe9dcb0399dcb5ed91760b3c655530dfd964d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 06 2019 09:12:23 +0000 Subject: import rh-php70-php-7.0.27-2.el7 --- diff --git a/SOURCES/php-7.0.27-CVE-2019-11043.patch b/SOURCES/php-7.0.27-CVE-2019-11043.patch new file mode 100644 index 0000000..d8844d8 --- /dev/null +++ b/SOURCES/php-7.0.27-CVE-2019-11043.patch @@ -0,0 +1,28 @@ +From 6e705460ff4f02358b9fb037169c53f4103a21b7 Mon Sep 17 00:00:00 2001 +From: Jakub Zelenka +Date: Sat, 12 Oct 2019 15:56:16 +0100 +Subject: [PATCH] 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 695839cd9a..88c7c9f118 100644 +--- a/sapi/fpm/fpm/fpm_main.c ++++ b/sapi/fpm/fpm/fpm_main.c +@@ -1208,8 +1208,8 @@ static void init_request_info(void) + 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/SPECS/php.spec b/SPECS/php.spec index b4348d6..14e6085 100644 --- a/SPECS/php.spec +++ b/SPECS/php.spec @@ -86,7 +86,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: %{?scl_prefix}php Version: 7.0.27 -Release: 1%{?dist} +Release: 2%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -133,6 +133,7 @@ Patch47: php-5.6.3-phpinfo.patch # Upstream fixes (100+) # Security fixes (200+) +Patch200: php-7.0.27-CVE-2019-11043.patch # Fixes for tests (300+) # Factory is droped from system tzdata @@ -687,6 +688,7 @@ support for JavaScript Object Notation (JSON) to PHP. # upstream patches # security patches +%patch200 -p1 -b .cve11043 # Fixes for tests %patch300 -p1 -b .datetests @@ -1591,6 +1593,9 @@ fi %changelog +* Tue Oct 29 2019 Remi Collet - 7.0.27-2 +- fix underflow in env_path_info in fpm_main.c CVE-2019-11043 + * Thu Jan 4 2018 Remi Collet - 7.0.27-1 - rebase to 7.0.27 #1518843 - improve check for valid tz file (tzdata patch v14)