From 88edb703ae6141870d45d0dee0e131aa55f807c4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 12 May 2026 09:21:23 +0200 Subject: Fix XSS within status endpoint CVE-2026-6735 Fix Stale SOAP_GLOBAL(ref_map) pointer with Apache Map CVE-2026-6722 Fix Use-after-free after header parsing failure with SOAP_PERSISTENCE_SESSION CVE-2026-7261 Fix Broken Apache map value NULL check CVE-2026-7262 Fix Signed integer overflow of char array offset CVE-2026-7568 Fix Consistently pass unsigned char to ctype.h functions CVE-2026-7258 --- failed.txt | 29 +- php-cve-2026-6722.patch | 109 +++ php-cve-2026-6735.patch | 140 ++++ php-cve-2026-7258.patch | 1698 +++++++++++++++++++++++++++++++++++++++++++++++ php-cve-2026-7261.patch | 113 ++++ php-cve-2026-7262.patch | 79 +++ php-cve-2026-7568.patch | 105 +++ php.spec | 32 +- 8 files changed, 2289 insertions(+), 16 deletions(-) create mode 100644 php-cve-2026-6722.patch create mode 100644 php-cve-2026-6735.patch create mode 100644 php-cve-2026-7258.patch create mode 100644 php-cve-2026-7261.patch create mode 100644 php-cve-2026-7262.patch create mode 100644 php-cve-2026-7568.patch diff --git a/failed.txt b/failed.txt index 8a1ea36..6e48b95 100644 --- a/failed.txt +++ b/failed.txt @@ -1,19 +1,19 @@ -===== 7.4.33-25 (2025-12-18) +===== 7.4.33-26 (2026-05-12) $ grep -ar 'Tests failed' /var/lib/mock/*/build.log -/var/lib/mock/scl74el8a/build.log:Tests failed : 0 -/var/lib/mock/scl74el8x/build.log:Tests failed : 0 -/var/lib/mock/scl74el9a/build.log:Tests failed : 1 -/var/lib/mock/scl74el9x/build.log:Tests failed : 1 -/var/lib/mock/scl74el10a/build.log:Tests failed : 1 -/var/lib/mock/scl74el10x/build.log:Tests failed : 1 -/var/lib/mock/scl80fc41a/build.log:Tests failed : 0 -/var/lib/mock/scl80fc41x/build.log:Tests failed : 0 -/var/lib/mock/scl74fc42a/build.log:Tests failed : 0 -/var/lib/mock/scl74fc42x/build.log:Tests failed : 0 -/var/lib/mock/scl80fc43a/build.log:Tests failed : 4 -/var/lib/mock/scl80fc43x/build.log:Tests failed : 4 +/var/lib/mock/scl74el8a/build.log:Tests failed : 2 +/var/lib/mock/scl74el8x/build.log:Tests failed : 2 +/var/lib/mock/scl74el9a/build.log:Tests failed : 3 +/var/lib/mock/scl74el9x/build.log:Tests failed : 3 +/var/lib/mock/scl74el10a/build.log:Tests failed : 3 +/var/lib/mock/scl74el10x/build.log:Tests failed : 3 +/var/lib/mock/scl74fc42a/build.log:Tests failed : 2 +/var/lib/mock/scl74fc42x/build.log:Tests failed : 2 +/var/lib/mock/scl80fc43a/build.log:Tests failed : 6 +/var/lib/mock/scl80fc43x/build.log:Tests failed : 6 +/var/lib/mock/scl80fc44a/build.log:Tests failed : 6 +/var/lib/mock/scl80fc44x/build.log:Tests failed : 6 el9, el10, fc43: @@ -22,6 +22,9 @@ fc43: 3 X (PCRE_EXTRA) modifier is ignored (no error, no change) [ext/pcre/tests/pcre_extra.phpt] 3 preg_split() [ext/pcre/tests/split.phpt] 3 preg_grep() 2nd test [ext/pcre/tests/grep2.phpt] +all + 3 sni_server [ext/openssl/tests/sni_server.phpt] + 3 sni_server with separate pk and cert [ext/openssl/tests/sni_server_key_cert.phpt] (1) proc_open give erratic test results :( diff --git a/php-cve-2026-6722.patch b/php-cve-2026-6722.patch new file mode 100644 index 0000000..99118e1 --- /dev/null +++ b/php-cve-2026-6722.patch @@ -0,0 +1,109 @@ +From 6c4b67ca091afea4f436202d7f9db38a129106dc Mon Sep 17 00:00:00 2001 +From: Ilija Tovilo +Date: Sun, 3 May 2026 19:56:53 +0200 +Subject: [PATCH 1/9] GHSA-85c2-q967-79q5: [soap] Fix stale + SOAP_GLOBAL(ref_map) pointer with Apache Map + +Fixes GHSA-85c2-q967-79q5 +Fixes CVE-2026-6722 + +(cherry picked from commit aee3b3ac9b816b0def1c462695b483b49a83148e) +(cherry picked from commit 15064460d6682766f91c1a841d27cdfbc38907e8) +(cherry picked from commit bbc1be3fc763b81707ccaa91a4cd1d439b753b12) +--- + ext/soap/php_encoding.c | 3 +- + ext/soap/tests/GHSA-85c2-q967-79q5.phpt | 61 +++++++++++++++++++++++++ + 2 files changed, 63 insertions(+), 1 deletion(-) + create mode 100644 ext/soap/tests/GHSA-85c2-q967-79q5.phpt + +diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c +index 0a6edbf5a41..088d0086472 100644 +--- a/ext/soap/php_encoding.c ++++ b/ext/soap/php_encoding.c +@@ -367,6 +367,7 @@ static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node) + static void soap_add_xml_ref(zval *data, xmlNodePtr node) + { + if (SOAP_GLOBAL(ref_map)) { ++ Z_TRY_ADDREF_P(data); + zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)node, data); + } + } +@@ -3433,7 +3434,7 @@ void encode_reset_ns() + } else { + SOAP_GLOBAL(ref_map) = emalloc(sizeof(HashTable)); + } +- zend_hash_init(SOAP_GLOBAL(ref_map), 0, NULL, NULL, 0); ++ zend_hash_init(SOAP_GLOBAL(ref_map), 0, NULL, ZVAL_PTR_DTOR, 0); + } + + void encode_finish() +diff --git a/ext/soap/tests/GHSA-85c2-q967-79q5.phpt b/ext/soap/tests/GHSA-85c2-q967-79q5.phpt +new file mode 100644 +index 00000000000..8bcac26ad18 +--- /dev/null ++++ b/ext/soap/tests/GHSA-85c2-q967-79q5.phpt +@@ -0,0 +1,61 @@ ++--TEST-- ++GHSA-85c2-q967-79q5: Stale SOAP_GLOBAL(ref_map) pointer with Apache Map ++--CREDITS-- ++brettgervasoni ++--EXTENSIONS-- ++soap ++--FILE-- ++ ++ ++ ++ ++ ++ ++ ++ foo ++ bar ++ ++ ++ foo ++ baz ++ ++ ++ ++ ++ ++ ++XML; ++ ++$s = new SoapServer(null, ['uri' => 'urn:a']); ++$s->setClass(Handler::class); ++$s->handle($envelope); ++var_dump($result); ++ ++?> ++--EXPECTF-- ++ ++ ++array(2) { ++ [0]=> ++ array(1) { ++ ["foo"]=> ++ string(3) "baz" ++ } ++ [1]=> ++ object(stdClass)#%d (1) { ++ ["object"]=> ++ string(3) "bar" ++ } ++} +-- +2.54.0 + diff --git a/php-cve-2026-6735.patch b/php-cve-2026-6735.patch new file mode 100644 index 0000000..06f3dc6 --- /dev/null +++ b/php-cve-2026-6735.patch @@ -0,0 +1,140 @@ +From aeaf48ca0bceba42b9595dff30d9e96029c54613 Mon Sep 17 00:00:00 2001 +From: Jakub Zelenka +Date: Sun, 3 May 2026 20:01:41 +0200 +Subject: [PATCH 4/9] GHSA-7qg2-v9fj-4mwv: [fpm] XSS within status endpoint + +Fixes GHSA-7qg2-v9fj-4mwv +Fixes CVE-2026-6735 + +(cherry picked from commit 99a5ad7441de9914246c7863adb6997396008b9d) +(cherry picked from commit cc2960e782eb5cc262d7bd572a7d18979a811954) +(cherry picked from commit 62daef7b73108ceda2545862cde0673f252ba2d2) +--- + sapi/fpm/fpm/fpm_status.c | 28 +++++++++-- + .../tests/ghsa-7qg2-v9fj-4mwv-status-xss.phpt | 48 +++++++++++++++++++ + 2 files changed, 72 insertions(+), 4 deletions(-) + create mode 100644 sapi/fpm/tests/ghsa-7qg2-v9fj-4mwv-status-xss.phpt + +diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c +index de8db9d61a2..9926ebd6b27 100644 +--- a/sapi/fpm/fpm/fpm_status.c ++++ b/sapi/fpm/fpm/fpm_status.c +@@ -483,8 +483,8 @@ int fpm_status_handle_request(void) /* {{{ */ + if (full_syntax) { + unsigned int i; + int first; +- zend_string *tmp_query_string; +- char *query_string; ++ zend_string *tmp_query_string, *tmp_request_uri_string; ++ char *query_string, *request_uri_string; + struct timeval duration, now; + #ifdef HAVE_FPM_LQ + float cpu; +@@ -511,13 +511,30 @@ int fpm_status_handle_request(void) /* {{{ */ + } + } + ++ request_uri_string = NULL; ++ tmp_request_uri_string = NULL; ++ if (proc.request_uri[0] != '\0') { ++ if (encode) { ++ tmp_request_uri_string = php_escape_html_entities_ex( ++ (unsigned char*)proc.request_uri, ++ strlen(proc.request_uri), 1, ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT, ++ NULL, /* double_encode */ 1); ++ request_uri_string = ZSTR_VAL(tmp_request_uri_string); ++ } else { ++ request_uri_string = proc.request_uri; ++ } ++ } ++ + query_string = NULL; + tmp_query_string = NULL; + if (proc.query_string[0] != '\0') { + if (!encode) { + query_string = proc.query_string; + } else { +- tmp_query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1); ++ tmp_query_string = php_escape_html_entities_ex( ++ (unsigned char*)proc.query_string, ++ strlen(proc.query_string), 1, ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT, ++ NULL, /* double_encode */ 1); + query_string = ZSTR_VAL(tmp_query_string); + } + } +@@ -545,7 +562,7 @@ int fpm_status_handle_request(void) /* {{{ */ + proc.requests, + duration.tv_sec * 1000000UL + duration.tv_usec, + proc.request_method[0] != '\0' ? proc.request_method : "-", +- proc.request_uri[0] != '\0' ? proc.request_uri : "-", ++ request_uri_string ? request_uri_string : "-", + query_string ? "?" : "", + query_string ? query_string : "", + proc.content_length, +@@ -558,6 +575,9 @@ int fpm_status_handle_request(void) /* {{{ */ + PUTS(buffer); + efree(buffer); + ++ if (tmp_request_uri_string) { ++ zend_string_free(tmp_request_uri_string); ++ } + if (tmp_query_string) { + zend_string_free(tmp_query_string); + } +diff --git a/sapi/fpm/tests/ghsa-7qg2-v9fj-4mwv-status-xss.phpt b/sapi/fpm/tests/ghsa-7qg2-v9fj-4mwv-status-xss.phpt +new file mode 100644 +index 00000000000..475bc130a42 +--- /dev/null ++++ b/sapi/fpm/tests/ghsa-7qg2-v9fj-4mwv-status-xss.phpt +@@ -0,0 +1,48 @@ ++--TEST-- ++FPM: GHSA-7qg2-v9fj-4mwv - status xss ++--SKIPIF-- ++ ++--FILE-- ++start(); ++$tester->expectLogStartNotices(); ++$responses = $tester ++ ->multiRequest([ ++ ['uri' => '/', 'query' => ''], ++ ['uri' => '/status', 'query' => 'full&html', 'delay' => 100000], ++ ]); ++var_dump(strpos($responses[1]->getBody(), '