[packages/php/PHP_5_4] Rel 56. Backport the 2026-11-19 PHP security fixes
arekm
arekm at pld-linux.org
Thu Nov 19 18:54:11 CET 2026
commit 74b134ca86256031c6b54b523fc85d6eabc7a4dd
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Nov 19 18:35:41 2026 +0100
Rel 56. Backport the 2026-11-19 PHP security fixes
session.upload_progress.enabled now defaults to off, as upstream.
Free the HTTP response header lines the 5.4 port of the folded header
parser leaked.
Fixes CVE-2026-129538, CVE-2026-129506, CVE-2026-129496,
CVE-2026-129481, CVE-2026-129292, CVE-2026-129291, CVE-2026-129289,
CVE-2026-128090, CVE-2026-128064, CVE-2026-127960, CVE-2026-126714,
CVE-2026-115560, CVE-2026-15353.
php-cve-2026-115560.patch | 318 ++++++++++++++++++++++++++++++++++++
php-cve-2026-126714.patch | 28 ++++
php-cve-2026-127960.patch | 203 +++++++++++++++++++++++
php-cve-2026-128064.patch | 138 ++++++++++++++++
php-cve-2026-128090.patch | 163 ++++++++++++++++++
php-cve-2026-129289.patch | 64 ++++++++
php-cve-2026-129291.patch | 39 +++++
php-cve-2026-129292.patch | 207 +++++++++++++++++++++++
php-cve-2026-129481.patch | 22 +++
php-cve-2026-129496.patch | 27 +++
php-cve-2026-129506.patch | 99 +++++++++++
php-cve-2026-129538.patch | 89 ++++++++++
php-cve-2026-15353.patch | 256 +++++++++++++++++++++++++++++
php-http-response-header-leak.patch | 23 +++
php.spec | 30 +++-
15 files changed, 1705 insertions(+), 1 deletion(-)
---
diff --git a/php.spec b/php.spec
index ef71619..cb6d1bc 100644
--- a/php.spec
+++ b/php.spec
@@ -138,7 +138,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
%undefine with_filter
%endif
-%define rel 55
+%define rel 56
%define orgname php
%define ver_suffix 54
%define php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -524,6 +524,20 @@ Patch543: php-bug70979.patch
Patch544: php-cve-2026-109618-session.patch
Patch545: php-cve-2026-109618-post_max_size.patch
Patch546: php-cve-2026-109618-delayed-oom.patch
+Patch547: php-cve-2026-129538.patch
+Patch548: php-cve-2026-129496.patch
+Patch549: php-cve-2026-129289.patch
+Patch550: php-cve-2026-129292.patch
+Patch551: php-cve-2026-129291.patch
+Patch552: php-cve-2026-128090.patch
+Patch553: php-cve-2026-15353.patch
+Patch554: php-cve-2026-129506.patch
+Patch555: php-cve-2026-126714.patch
+Patch556: php-cve-2026-115560.patch
+Patch557: php-cve-2026-128064.patch
+Patch558: php-cve-2026-127960.patch
+Patch559: php-http-response-header-leak.patch
+Patch560: php-cve-2026-129481.patch
URL: https://www.php.net/
%{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}}
%{?with_pspell:BuildRequires: aspell-devel >= 2:0.50.0}
@@ -2654,6 +2668,20 @@ cp -p php.ini-production php.ini
%patch -P544 -p1
%patch -P545 -p1
%patch -P546 -p1
+%patch -P547 -p1
+%patch -P548 -p1
+%patch -P549 -p1
+%patch -P550 -p1
+%patch -P551 -p1
+%patch -P552 -p1
+%patch -P553 -p1
+%patch -P554 -p1
+%patch -P555 -p1
+%patch -P556 -p1
+%patch -P557 -p1
+%patch -P558 -p1
+%patch -P559 -p1
+%patch -P560 -p1
# backports patch only the .re sources; date has no make rule and the
# unserializer one is skipped silently when configure finds no re2c
diff --git a/php-cve-2026-115560.patch b/php-cve-2026-115560.patch
new file mode 100644
index 0000000..19752b3
--- /dev/null
+++ b/php-cve-2026-115560.patch
@@ -0,0 +1,318 @@
+From: Arnaud Le Blanc <arnaud.lb at gmail.com>
+Date: Mon Nov 9 12:02:32 2026 +0100
+Subject: [PATCH] Fix GHSA-658j-r8rw-q6mx (CVE-2026-115560): session.upload_progress.enabled is off by default
+
+Also prevent changes to session INI settings at runtime when
+session.upload_progress.enabled is On.
+
+Upstream: https://github.com/php/php-src/commit/3f70f66611583bca4ec18385f7f407e2808fa61f
+PLD: 5.4 has no Error exceptions, so a refused change raises a warning and fails like the existing active-session check; every PHP_INI_ALL session setting is guarded, the 5.4 entries using the generic handlers get session wrappers like 8.x
+PLD: the test is written in PHP 5.4 syntax with 5.4 settings (php_binary, hash_function, hash_bits_per_character)
+---
+diff --git a/ext/session/session.c b/ext/session/session.c
+--- a/ext/session/session.c
++++ b/ext/session/session.c
+@@ -83,6 +83,12 @@ zend_class_entry *php_session_iface_entry;
+ return FAILURE; \
+ }
+
++#define SESSION_CHECK_UPLOAD_PROGRESS_STATE \
++ if (PS(rfc1867_enabled) && stage == ZEND_INI_STAGE_RUNTIME) { \
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On"); \
++ return FAILURE; \
++ }
++
+ /* Dispatched by RINIT and by php_session_destroy */
+ static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */
+ {
+@@ -521,6 +527,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
+ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
+ {
+ ps_module *tmp;
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
+ SESSION_CHECK_ACTIVE_STATE;
+
+ tmp = _php_find_ps_module(new_value TSRMLS_CC);
+@@ -551,6 +558,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
+ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
+ {
+ const ps_serializer *tmp;
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
+ SESSION_CHECK_ACTIVE_STATE;
+
+ tmp = _php_find_ps_serializer(new_value TSRMLS_CC);
+@@ -578,6 +586,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
+
+ static PHP_INI_MH(OnUpdateTransSid) /* {{{ */
+ {
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
+ SESSION_CHECK_ACTIVE_STATE;
+
+ if (!strncasecmp(new_value, "on", sizeof("on"))) {
+@@ -592,6 +601,8 @@ static PHP_INI_MH(OnUpdateTransSid) /* {{{ */
+
+ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
+ {
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++
+ /* Only do the safemode/open_basedir check at runtime */
+ if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
+ char *p;
+@@ -623,6 +634,8 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
+
+ static PHP_INI_MH(OnUpdateName) /* {{{ */
+ {
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++
+ /* Numeric session.name won't work at all */
+ if ((!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) {
+ int err_type;
+@@ -650,6 +663,8 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
+ long val;
+ char *endptr = NULL;
+
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++
+ #if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
+ PS(hash_ops) = NULL;
+ #endif
+@@ -693,6 +708,27 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
+ }
+ /* }}} */
+
++static PHP_INI_MH(OnUpdateSessionLong) /* {{{ */
++{
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++ return OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
++}
++/* }}} */
++
++static PHP_INI_MH(OnUpdateSessionString) /* {{{ */
++{
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
++}
++/* }}} */
++
++static PHP_INI_MH(OnUpdateSessionBool) /* {{{ */
++{
++ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
++ return OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
++}
++/* }}} */
++
+ static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
+ {
+ int tmp;
+@@ -739,37 +775,37 @@ PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateName, session_name, php_ps_globals, ps_globals)
+ PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler)
+ STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_PERDIR, OnUpdateBool, auto_start, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateLong, gc_probability, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateLong, gc_divisor, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateLong, gc_maxlifetime, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateSessionLong, gc_probability, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateSessionLong, gc_divisor, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateSessionLong, gc_maxlifetime, php_ps_globals, ps_globals)
+ PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateSerializer)
+- STD_PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, OnUpdateLong, cookie_lifetime, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.cookie_path", "/", PHP_INI_ALL, OnUpdateString, cookie_path, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.cookie_domain", "", PHP_INI_ALL, OnUpdateString, cookie_domain, php_ps_globals, ps_globals)
+- STD_PHP_INI_BOOLEAN("session.cookie_secure", "", PHP_INI_ALL, OnUpdateBool, cookie_secure, php_ps_globals, ps_globals)
+- STD_PHP_INI_BOOLEAN("session.cookie_httponly", "", PHP_INI_ALL, OnUpdateBool, cookie_httponly, php_ps_globals, ps_globals)
+- STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_cookies, php_ps_globals, ps_globals)
+- STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_only_cookies, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateString, extern_referer_chk, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, OnUpdateSessionLong, cookie_lifetime, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.cookie_path", "/", PHP_INI_ALL, OnUpdateSessionString, cookie_path, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.cookie_domain", "", PHP_INI_ALL, OnUpdateSessionString, cookie_domain, php_ps_globals, ps_globals)
++ STD_PHP_INI_BOOLEAN("session.cookie_secure", "", PHP_INI_ALL, OnUpdateSessionBool, cookie_secure, php_ps_globals, ps_globals)
++ STD_PHP_INI_BOOLEAN("session.cookie_httponly", "", PHP_INI_ALL, OnUpdateSessionBool, cookie_httponly, php_ps_globals, ps_globals)
++ STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateSessionBool, use_cookies, php_ps_globals, ps_globals)
++ STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateSessionBool, use_only_cookies, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateSessionString, extern_referer_chk, php_ps_globals, ps_globals)
+ #if HAVE_DEV_URANDOM
+- STD_PHP_INI_ENTRY("session.entropy_file", "/dev/urandom", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.entropy_length", "32", PHP_INI_ALL, OnUpdateLong, entropy_length, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_file", "/dev/urandom", PHP_INI_ALL, OnUpdateSessionString, entropy_file, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_length", "32", PHP_INI_ALL, OnUpdateSessionLong, entropy_length, php_ps_globals, ps_globals)
+ #elif HAVE_DEV_ARANDOM
+- STD_PHP_INI_ENTRY("session.entropy_file", "/dev/arandom", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.entropy_length", "32", PHP_INI_ALL, OnUpdateLong, entropy_length, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_file", "/dev/arandom", PHP_INI_ALL, OnUpdateSessionString, entropy_file, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_length", "32", PHP_INI_ALL, OnUpdateSessionLong, entropy_length, php_ps_globals, ps_globals)
+ #else
+- STD_PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, OnUpdateLong, entropy_length, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, OnUpdateSessionString, entropy_file, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, OnUpdateSessionLong, entropy_length, php_ps_globals, ps_globals)
+ #endif
+- STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateString, cache_limiter, php_ps_globals, ps_globals)
+- STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateLong, cache_expire, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateSessionString, cache_limiter, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateSessionLong, cache_expire, php_ps_globals, ps_globals)
+ PHP_INI_ENTRY("session.use_trans_sid", "0", PHP_INI_ALL, OnUpdateTransSid)
+ PHP_INI_ENTRY("session.hash_function", "0", PHP_INI_ALL, OnUpdateHashFunc)
+- STD_PHP_INI_ENTRY("session.hash_bits_per_character", "4", PHP_INI_ALL, OnUpdateLong, hash_bits_per_character, php_ps_globals, ps_globals)
++ STD_PHP_INI_ENTRY("session.hash_bits_per_character", "4", PHP_INI_ALL, OnUpdateSessionLong, hash_bits_per_character, php_ps_globals, ps_globals)
+
+ /* Upload progress */
+ STD_PHP_INI_BOOLEAN("session.upload_progress.enabled",
+- "1", ZEND_INI_PERDIR, OnUpdateBool, rfc1867_enabled, php_ps_globals, ps_globals)
++ "0", ZEND_INI_PERDIR, OnUpdateBool, rfc1867_enabled, php_ps_globals, ps_globals)
+ STD_PHP_INI_BOOLEAN("session.upload_progress.cleanup",
+ "1", ZEND_INI_PERDIR, OnUpdateBool, rfc1867_cleanup, php_ps_globals, ps_globals)
+ STD_PHP_INI_ENTRY("session.upload_progress.prefix",
+@@ -2261,6 +2297,7 @@ static PHP_GINIT_FUNCTION(ps) /* {{{ */
+ ps_globals->mod = NULL;
+ ps_globals->serializer = NULL;
+ ps_globals->mod_data = NULL;
++ ps_globals->rfc1867_enabled = 0;
+ ps_globals->session_status = php_session_none;
+ ps_globals->default_mod = NULL;
+ ps_globals->mod_user_implemented = 0;
+diff --git a/ext/session/tests/session_ini_set_upload_progress_enabled.phpt b/ext/session/tests/session_ini_set_upload_progress_enabled.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/session/tests/session_ini_set_upload_progress_enabled.phpt
+@@ -0,0 +1,140 @@
++--TEST--
++ini_set() for session.* is not allowed when session.upload_progress.enabled is On
++--SKIPIF--
++<?php include('skipif.inc'); ?>
++--INI--
++session.upload_progress.enabled=1
++session.save_path=
++session.name=NOTPHPSESSID
++session.save_handler=files
++session.serialize_handler=php_binary
++session.cookie_lifetime=42
++session.gc_probability=2
++session.cookie_path=/startup
++session.cookie_secure=1
++session.hash_function=1
++session.hash_bits_per_character=5
++--FILE--
++<?php
++/* The INI section above is applied at the startup stage, so these values must
++ * have been applied even though session.upload_progress.enabled is On. */
++$names = array(
++ "session.name",
++ "session.serialize_handler",
++ "session.cookie_lifetime",
++ "session.gc_probability",
++ "session.cookie_path",
++ "session.cookie_secure",
++ "session.hash_function",
++ "session.hash_bits_per_character",
++);
++echo "*** Settings applied at startup ***\n";
++foreach ($names as $name) {
++ printf("%s=%s\n", $name, var_export(ini_get($name), true));
++}
++
++echo "\n*** ini_set() is rejected at runtime ***\n";
++
++/* One entry per ini modify handler guarded by the check. */
++var_dump(ini_set("session.save_path", "/tmp"));
++var_dump(ini_set("session.name", "PHPSESSID"));
++var_dump(ini_set("session.save_handler", "user"));
++var_dump(ini_set("session.serialize_handler", "php"));
++var_dump(ini_set("session.cookie_lifetime", "1"));
++var_dump(ini_set("session.gc_probability", "1"));
++var_dump(ini_set("session.cookie_path", "/runtime"));
++var_dump(ini_set("session.cookie_secure", "0"));
++var_dump(ini_set("session.use_trans_sid", "1"));
++var_dump(ini_set("session.hash_function", "0"));
++var_dump(ini_set("session.hash_bits_per_character", "4"));
++
++echo "\n*** session functions are rejected at runtime ***\n";
++var_dump(session_name("PHPSESSID"));
++var_dump(session_name());
++
++echo "\n*** ini_restore() is rejected at runtime ***\n";
++ini_restore("session.name");
++var_dump(ini_get("session.name"));
++
++echo "\n*** Values are unchanged ***\n";
++foreach ($names as $name) {
++ printf("%s=%s\n", $name, var_export(ini_get($name), true));
++}
++
++echo "\n*** Non-session ini settings are unaffected ***\n";
++var_dump(ini_set("precision", "10"));
++var_dump(ini_get("precision"));
++
++echo "Done\n";
++?>
++--EXPECTF--
++*** Settings applied at startup ***
++session.name='NOTPHPSESSID'
++session.serialize_handler='php_binary'
++session.cookie_lifetime='42'
++session.gc_probability='2'
++session.cookie_path='/startup'
++session.cookie_secure='1'
++session.hash_function='1'
++session.hash_bits_per_character='5'
++
++*** ini_set() is rejected at runtime ***
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++Warning: ini_set(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++bool(false)
++
++*** session functions are rejected at runtime ***
++
++Warning: session_name(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++string(12) "NOTPHPSESSID"
++string(12) "NOTPHPSESSID"
++
++*** ini_restore() is rejected at runtime ***
++
++Warning: ini_restore(): Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On in %s on line %d
++string(12) "NOTPHPSESSID"
++
++*** Values are unchanged ***
++session.name='NOTPHPSESSID'
++session.serialize_handler='php_binary'
++session.cookie_lifetime='42'
++session.gc_probability='2'
++session.cookie_path='/startup'
++session.cookie_secure='1'
++session.hash_function='1'
++session.hash_bits_per_character='5'
++
++*** Non-session ini settings are unaffected ***
++string(2) "14"
++string(2) "10"
++Done
diff --git a/php-cve-2026-126714.patch b/php-cve-2026-126714.patch
new file mode 100644
index 0000000..918368c
--- /dev/null
+++ b/php-cve-2026-126714.patch
@@ -0,0 +1,28 @@
+From: Ilija Tovilo <ilija.tovilo at me.com>
+Date: Wed Nov 11 16:53:47 2026 +0100
+Subject: [PATCH] Fix GHSA-fm2m-fjf5-v3cp (CVE-2026-126714): RCE via corrupted session file
+
+If the session write is interrupted, and the previous session file wasn't
+truncated, we can end up with two partial sessions concatenated together. The
+approximate location of failure may be attacker-controllable in threaded
+environments if another thread causes the process to _exit().
+
+Upstream: https://github.com/php/php-src/commit/41c0941ae27d1033129e0e09ce3af034ffee86ba
+---
+diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
+--- a/ext/session/mod_files.c
++++ b/ext/session/mod_files.c
+@@ -400,10 +400,9 @@ PS_WRITE_FUNC(files)
+ return FAILURE;
+ }
+
+- /* Truncate file if the amount of new data is smaller than the existing data set. */
+-
+- if (vallen < (int)data->st_size) {
+- php_ignore_value(ftruncate(data->fd, 0));
++ if (ftruncate(data->fd, 0) != 0) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftruncate() failed: %s (%d)", strerror(errno), errno);
++ return FAILURE;
+ }
+
+ #if defined(HAVE_PWRITE)
diff --git a/php-cve-2026-127960.patch b/php-cve-2026-127960.patch
new file mode 100644
index 0000000..ef06a7a
--- /dev/null
+++ b/php-cve-2026-127960.patch
@@ -0,0 +1,203 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Tue Oct 6 15:29:19 2026 +0200
+Subject: [PATCH] Fix GHSA-mmf9-xm3v-hg2x (CVE-2026-127960): quadratic folded header concatenation
+
+Each folded response header line was concatenated with the whole
+accumulated header value into a newly allocated string. That made
+parsing of a header split into many continuation lines quadratic, so a
+malicious server could stall the client for a long time with a few MB
+of headers.
+
+Accumulate the last header line in a smart_str instead so folding is
+linear in the total header size.
+
+Upstream: https://github.com/php/php-src/commit/a303f697268d42f6671c9d4c479ff90bbf301db1
+PLD: applies to the 5.4 port of the GHSA-v8xr-gpvj-cx9g (CVE-2025-1217) folding fix; zend_string_concat3() stays, it is exported
+---
+diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
+--- a/ext/standard/http_fopen_wrapper.c
++++ b/ext/standard/http_fopen_wrapper.c
+@@ -215,25 +215,21 @@ static zend_bool php_stream_http_response_header_trim(char *http_header_line,
+ }
+
+ /* Process folding headers of the current line and if there are none, parse last full response
+- * header line. It returns NULL if the last header is finished, otherwise it returns updated
+- * last header line. */
+-static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
++ * header line. It returns true if the current line was folded into the last header line,
++ * otherwise false. */
++static zend_bool php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ php_stream *stream, php_stream_context *context, int options,
+- char *last_header_line_str, char *header_line, size_t *header_line_length,
++ smart_str *last_header, char *header_line, size_t *header_line_length,
+ int response_code, zval *response_header,
+- php_stream_http_response_header_info *header_info,
+- size_t *last_header_line_len)
++ php_stream_http_response_header_info *header_info)
+ {
++ char *last_header_line_str;
+ size_t last_header_line_length;
+ char *last_header_line_end;
+ char *last_header_value;
+ zend_bool store_header = 1;
+ zval **tmpzval = NULL;
+ TSRMLS_FETCH();
+- if(!last_header_line_len)
+- return NULL;
+- last_header_line_length = *last_header_line_len;
+- last_header_line_end = last_header_line_str + last_header_line_length - 1;
+
+ /* Process non empty header line. */
+ if (header_line && (*header_line != '\n' && *header_line != '\r')) {
+@@ -241,14 +237,13 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ if (php_stream_http_response_header_trim(header_line, header_line_length) &&
+ *header_line_length == 0) {
+ /* Only spaces so treat as an empty folding header. */
+- return last_header_line_str;
++ return 1;
+ }
+
+ /* Process folding headers if starting with a space or a tab. */
+ if (header_line && (*header_line == ' ' || *header_line == '\t')) {
+ char *http_folded_header_line = header_line;
+ size_t http_folded_header_line_length = *header_line_length;
+- char *extended_header_str;
+ /* Remove the leading white spaces. */
+ while (*http_folded_header_line == ' ' || *http_folded_header_line == '\t') {
+ http_folded_header_line++;
+@@ -256,21 +251,21 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ }
+ /* It has to have some characters because it would get returned after the call
+ * php_stream_http_response_header_trim above. */
+- if(http_folded_header_line_length == 0 || http_folded_header_line_length > *header_line_length)
+- return NULL;
+- /* Concatenate last header line, space and current header line. */
+- extended_header_str = zend_string_concat3(
+- last_header_line_str, last_header_line_length,
+- " ", 1,
+- http_folded_header_line, http_folded_header_line_length,
+- last_header_line_len);
+- efree(last_header_line_str);
+- last_header_line_str = extended_header_str;
+- /* Return new header line. */
+- return last_header_line_str;
++ /* Append space and current header line to the last header line. */
++ smart_str_appendc(last_header, ' ');
++ smart_str_appendl(last_header, http_folded_header_line, http_folded_header_line_length);
++ return 1;
+ }
+ }
+
++ smart_str_0(last_header);
++ last_header_line_str = last_header->c;
++ last_header_line_length = last_header->len;
++ last_header->c = NULL;
++ last_header->len = 0;
++ last_header->a = 0;
++ last_header_line_end = last_header_line_str + last_header_line_length - 1;
++
+ /* Find header separator position. */
+ last_header_value = memchr(last_header_line_str, ':', last_header_line_length);
+ if (last_header_value) {
+@@ -282,7 +277,7 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ "HTTP invalid response format (space in header name)!");
+ efree(last_header_line_str);
+- return NULL;
++ return 0;
+ }
+ ++last_header_name;
+ }
+@@ -300,7 +295,7 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ "HTTP invalid response format (no colon in header line)!");
+ efree(last_header_line_str);
+- return NULL;
++ return 0;
+ }
+
+
+@@ -324,7 +319,7 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ "HTTP Location header size is over the limit of %d bytes",
+ HTTP_HEADER_MAX_LOCATION_SIZE);
+ efree(last_header_line_str);
+- return NULL;
++ return 0;
+ }
+ if (header_info->location_len == 0) {
+ header_info->location = emalloc(last_header_value_len + 1);
+@@ -385,7 +380,7 @@ static char *php_stream_http_response_headers_parse(php_stream_wrapper *wrapper,
+ efree(last_header_line_str);
+ }
+
+- return NULL;
++ return 0;
+ }
+
+ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
+@@ -402,8 +397,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
+ zval *response_header = NULL;
+ int reqok = 0;
+ char *http_header_line = NULL;
+- char *last_header_line_str = NULL;
+- size_t last_header_line_length = 0;
++ smart_str last_header = {0};
+ php_stream_http_response_header_info header_info;
+ char tmp_line[128];
+ size_t chunk_size = 0;
+@@ -1024,13 +1018,12 @@ finish:
+ last_line = 0;
+ }
+
+- if (last_header_line_str != NULL) {
++ if (last_header.c != NULL) {
+ /* Parse last header line. */
+- last_header_line_str = php_stream_http_response_headers_parse(wrapper, stream,
+- context, options, last_header_line_str, http_header_line,
+- &http_header_line_length, response_code, response_header, &header_info,
+- &last_header_line_length);
+- if (EXPECTED(last_header_line_str == NULL)) {
++ zend_bool folded = php_stream_http_response_headers_parse(wrapper, stream,
++ context, options, &last_header, http_header_line,
++ &http_header_line_length, response_code, response_header, &header_info);
++ if (EXPECTED(!folded)) {
+ if (UNEXPECTED(header_info.error)) {
+ php_stream_close(stream);
+ stream = NULL;
+@@ -1055,23 +1048,21 @@ finish:
+
+ if (last_line) {
+ /* For the last line the last header line must be NULL. */
+- if (last_header_line_str != NULL)
++ if (last_header.c != NULL)
+ return NULL;
+ break;
+ }
+ /* Save current line as the last line so it gets parsed in the next round. */
+- last_header_line_str = estrndup(http_header_line, http_header_line_length);
+- last_header_line_length = http_header_line_length;
++ smart_str_appendl(&last_header, http_header_line, http_header_line_length);
+ } else {
+ break;
+ }
+ }
+
+ /* If the stream was closed early, we still want to process the last line to keep BC. */
+- if (last_header_line_str != NULL) {
++ if (last_header.c != NULL) {
+ php_stream_http_response_headers_parse(wrapper, stream, context, options,
+- last_header_line_str, NULL, NULL, response_code, response_header, &header_info,
+- &last_header_line_length);
++ &last_header, NULL, NULL, response_code, response_header, &header_info);
+ }
+
+ if (!reqok || (header_info.location != NULL && header_info.follow_location)) {
+@@ -1192,6 +1183,8 @@ finish:
+ }
+ }
+ out:
++ smart_str_free(&last_header);
++
+ if (protocol_version) {
+ efree(protocol_version);
+ }
diff --git a/php-cve-2026-128064.patch b/php-cve-2026-128064.patch
new file mode 100644
index 0000000..9a38efd
--- /dev/null
+++ b/php-cve-2026-128064.patch
@@ -0,0 +1,138 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Fri Nov 6 21:46:18 2026 +0100
+Subject: [PATCH] Fix GHSA-f6gg-rchx-xw8j (CVE-2026-128064): mixed case HTTPS and FTPS
+
+Determine TLS use from a case-insensitive comparison of the complete
+URL scheme, preventing mixed-case HTTPS and FTPS URLs from downgrading
+to plaintext. Add regression tests for both wrappers.
+
+Upstream: https://github.com/php/php-src/commit/cb68a63e8177f9dc25aba23c0d79c7da82ea69db
+PLD: the tests use the PHP 5.4 ServerClientTestCase2.inc and PHP 5.4 syntax
+---
+diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
+--- a/ext/standard/ftp_fopen_wrapper.c
++++ b/ext/standard/ftp_fopen_wrapper.c
+@@ -149,7 +149,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
+ return NULL;
+ }
+
+- use_ssl = resource->scheme && (strlen(resource->scheme) > 3) && resource->scheme[3] == 's';
++ use_ssl = resource->scheme && !strcasecmp(resource->scheme, "ftps");
+
+ /* use port 21 if one wasn't specified */
+ if (resource->port == 0)
+diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
+--- a/ext/standard/http_fopen_wrapper.c
++++ b/ext/standard/http_fopen_wrapper.c
+@@ -465,7 +465,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
+ zval_dtor(&ztmp);
+ }
+
+- use_ssl = resource->scheme && (strlen(resource->scheme) > 4) && resource->scheme[4] == 's';
++ use_ssl = resource->scheme && !strcasecmp(resource->scheme, "https");
+ /* choose default ports */
+ if (use_ssl && resource->port == 0)
+ resource->port = 443;
+diff --git a/ext/standard/tests/http/ghsa-f6gg-rchx-xw8j.phpt b/ext/standard/tests/http/ghsa-f6gg-rchx-xw8j.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/standard/tests/http/ghsa-f6gg-rchx-xw8j.phpt
+@@ -0,0 +1,60 @@
++--TEST--
++GHSA-f6gg-rchx-xw8j: mixed-case HTTPS URLs must use TLS
++--SKIPIF--
++<?php
++if (!extension_loaded('openssl')) die('skip openssl extension required');
++if (!function_exists('proc_open')) die('skip proc_open() not available');
++?>
++--FILE--
++<?php
++$serverCode = <<<'CODE'
++ $server = stream_socket_server('tcp://127.0.0.1:0', $errno, $errstr);
++ phpt_notify_server_start($server);
++
++ $conn = stream_socket_accept($server);
++ $request = fread($conn, 1);
++
++ if ($request === "\x16") {
++ $result = 'TLS';
++ } else {
++ while (($line = stream_get_line($conn, 8192, "\r\n")) !== false) {
++ $request .= $line . "\r\n";
++ if ($line === '') {
++ break;
++ }
++ }
++ $request .= stream_get_contents($conn, strlen('opensec-sensitive-body'));
++ $result = strpos($request, 'Authorization: Basic ') !== false
++ && strpos($request, 'X-Opensec-Request: validation') !== false
++ && strpos($request, 'opensec-sensitive-body') !== false
++ ? 'plaintext credentials and body'
++ : 'unexpected plaintext request';
++ }
++
++ fclose($conn);
++ fclose($server);
++ phpt_notify(WORKER_DEFAULT_NAME, $result);
++CODE;
++
++$clientCode = <<<'CODE'
++ $context = stream_context_create(array(
++ 'http' => array(
++ 'method' => 'POST',
++ 'content' => 'opensec-sensitive-body',
++ 'header' => "X-Opensec-Request: validation\r\n",
++ ),
++ 'ssl' => array(
++ 'verify_peer' => false,
++ 'verify_peer_name' => false,
++ ),
++ ));
++ var_dump(@file_get_contents('HTTPS://alice:secret@{{ ADDR }}/secret', false, $context));
++ echo phpt_wait();
++CODE;
++
++include sprintf('%s/../../../openssl/tests/ServerClientTestCase2.inc', __DIR__);
++ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
++?>
++--EXPECT--
++bool(false)
++TLS
+diff --git a/ext/standard/tests/streams/ghsa-f6gg-rchx-xw8j.phpt b/ext/standard/tests/streams/ghsa-f6gg-rchx-xw8j.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/standard/tests/streams/ghsa-f6gg-rchx-xw8j.phpt
+@@ -0,0 +1,33 @@
++--TEST--
++GHSA-f6gg-rchx-xw8j: mixed-case FTPS URLs must enable TLS
++--SKIPIF--
++<?php
++if (!extension_loaded('openssl')) die('skip openssl extension required');
++if (!function_exists('proc_open')) die('skip proc_open() not available');
++?>
++--FILE--
++<?php
++$serverCode = <<<'CODE'
++ $server = stream_socket_server('tcp://127.0.0.1:0', $errno, $errstr);
++ phpt_notify_server_start($server);
++
++ $conn = stream_socket_accept($server);
++ fwrite($conn, "220 Ready\r\n");
++ $command = stream_get_line($conn, 8192, "\r\n");
++
++ fclose($conn);
++ fclose($server);
++ phpt_notify(WORKER_DEFAULT_NAME, $command);
++CODE;
++
++$clientCode = <<<'CODE'
++ var_dump(@fopen('FTPS://{{ ADDR }}/secret', 'r'));
++ echo phpt_wait();
++CODE;
++
++include sprintf('%s/../../../openssl/tests/ServerClientTestCase2.inc', __DIR__);
++ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
++?>
++--EXPECT--
++bool(false)
++AUTH TLS
diff --git a/php-cve-2026-128090.patch b/php-cve-2026-128090.patch
new file mode 100644
index 0000000..0548e58
--- /dev/null
+++ b/php-cve-2026-128090.patch
@@ -0,0 +1,163 @@
+From: Alexandre Daubois <alex.daubois at gmail.com>
+Date: Fri Nov 13 08:33:23 2026 +0100
+Subject: [PATCH] Fix GHSA-68fq-fh7h-f8gr (CVE-2026-128090): refuse keyless phar signature when .pubkey exists
+
+The signature type is not covered by the signature, so an OpenSSL signed
+phar could be downgraded to a keyless hash algorithm.
+
+Upstream: https://github.com/php/php-src/commit/7050cf338092a93e7d4caa4b7dc0bb8771f52a01
+PLD: 5.4 knows only the SHA-1 OpenSSL signature type (PHAR_SIG_OPENSSL); the test is written in PHP 5.4 syntax and downgrades to SHA-1, because sha256/sha512 phar signatures are compiled out when ext/hash is shared, as in PLD
+---
+diff --git a/ext/phar/tests/ghsa-68fq-fh7h-f8gr.phpt b/ext/phar/tests/ghsa-68fq-fh7h-f8gr.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/phar/tests/ghsa-68fq-fh7h-f8gr.phpt
+@@ -0,0 +1,121 @@
++--TEST--
++GHSA-68fq-fh7h-f8gr (OpenSSL signature bypass by downgrading the algorithm to a keyless one)
++--SKIPIF--
++<?php
++if (!extension_loaded("phar")) die("skip phar extension required");
++if (!extension_loaded("openssl")) die("skip openssl extension required");
++if (!in_array("OpenSSL", Phar::getSupportedSignatures())) die("skip openssl support required");
++?>
++--INI--
++phar.readonly=0
++phar.require_hash=1
++--FILE--
++<?php
++$base = __DIR__ . '/' . basename(__FILE__, '.php');
++$private = openssl_pkey_get_private(file_get_contents(__DIR__ . '/files/private.pem'));
++$pkey = '';
++openssl_pkey_export($private, $pkey, null, array('config' => __DIR__ . '/files/openssl.cnf'));
++$pubkey = openssl_pkey_get_details($private)['key'];
++
++function build($file, $pkey)
++{
++ $phar = new Phar($file);
++ $phar['main.php'] = '<?php echo "GENUINE\n";';
++ $phar->setStub('<?php __HALT_COMPILER();');
++ $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
++
++ return file_get_contents($file);
++}
++
++// a phar built in this process comes back from the cache, so each case is read under its own name
++function open($file, $archive, $pubkey)
++{
++ file_put_contents($file, $archive);
++ if ($pubkey !== null) {
++ file_put_contents($file . '.pubkey', $pubkey);
++ }
++
++ try {
++ echo (new Phar($file))->getSignature()['hash_type'], "\n";
++ } catch (UnexpectedValueException $e) {
++ echo $e->getMessage(), "\n";
++ }
++}
++
++function downgrade_phar($archive)
++{
++ // the last 12 bytes are [length][algorithm]["GBMB"], the signature sits just before them
++ $siglen = unpack('V', substr($archive, -12, 4))[1];
++ $message = substr($archive, 0, strlen($archive) - 12 - $siglen);
++
++ return $message . hash('sha1', $message, true) . pack('V', 0x0002) . 'GBMB'; // 0x0002 is PHAR_SIG_SHA1
++}
++
++function downgrade_tar($archive)
++{
++ for ($offset = 0; $offset + 512 <= strlen($archive); ) {
++ $size = (int) octdec(trim(substr($archive, $offset + 124, 12), " \0")); // octal size field of a 512 byte header
++
++ if (rtrim(substr($archive, $offset, 100), "\0") === '.phar/signature.bin') {
++ // the signed message stops at this header, so rewriting the entry content leaves it alone
++ $blob = pack('VV', 0x0002, 20) . hash('sha1', substr($archive, 0, $offset), true); // [algorithm][digest length][digest]
++
++ return substr_replace($archive, str_pad($blob, $size, "\0"), $offset + 512, $size);
++ }
++
++ $offset += 512 + (($size + 511) & ~511);
++ }
++
++ throw new RuntimeException('no signature entry');
++}
++
++function downgrade_zip($archive)
++{
++ $eocd = strrpos($archive, "PK\x05\x06");
++ $cdir = unpack('V', substr($archive, $eocd + 16, 4))[1]; // the eocd holds the directory offset at +16 and the archive comment length at +20
++ $comment = substr($archive, $eocd + 22, unpack('v', substr($archive, $eocd + 20, 2))[1]);
++
++ for ($record = $cdir; substr($archive, $record, 4) === "PK\x01\x02"; ) {
++ $namelen = unpack('v', substr($archive, $record + 28, 2))[1];
++
++ if (substr($archive, $record + 46, $namelen) === '.phar/signature.bin') {
++ $size = unpack('V', substr($archive, $record + 24, 4))[1];
++ $local = unpack('V', substr($archive, $record + 42, 4))[1];
++ $content = $local + 30 + unpack('v', substr($archive, $local + 26, 2))[1] + unpack('v', substr($archive, $local + 28, 2))[1];
++ // the signed message is everything before the local entry plus the directory up to this record
++ $message = substr($archive, 0, $local) . substr($archive, $cdir, $record - $cdir) . $comment;
++ $blob = pack('VV', 0x0002, 20) . hash('sha1', $message, true);
++
++ return substr_replace($archive, str_pad($blob, $size, "\0"), $content, $size);
++ }
++
++ $record += 46 + $namelen + unpack('v', substr($archive, $record + 30, 2))[1] + unpack('v', substr($archive, $record + 32, 2))[1];
++ }
++
++ throw new RuntimeException('no signature entry');
++}
++
++foreach (array('phar' => 'downgrade_phar', 'phar.tar' => 'downgrade_tar', 'phar.zip' => 'downgrade_zip') as $suffix => $downgrade) {
++ $archive = build($base . '.source.' . $suffix, $pkey);
++ open($base . '.signed.' . $suffix, $archive, $pubkey);
++ open($base . '.tampered.' . $suffix, $downgrade($archive), $pubkey);
++ open($base . '.nokey.' . $suffix, $downgrade($archive), null);
++}
++?>
++--CLEAN--
++<?php
++$base = __DIR__ . '/' . basename(__FILE__, '.clean.php');
++foreach (glob($base . '.*.phar*') as $file) {
++ unlink($file);
++}
++?>
++--EXPECTF--
++OpenSSL
++phar "%stampered.phar" SHA1 signature could not be verified: openssl public key found, but the signature does not use openssl
++SHA-1
++OpenSSL
++phar error: tar-based phar "%stampered.phar.tar" signature cannot be verified: openssl public key found, but the signature does not use openssl
++SHA-1
++OpenSSL
++phar error: signature cannot be verified: openssl public key found, but the signature does not use openssl in zip-based phar "%stampered.phar.zip"
++SHA-1
+diff --git a/ext/phar/util.c b/ext/phar/util.c
+--- a/ext/phar/util.c
++++ b/ext/phar/util.c
+@@ -1837,6 +1837,23 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
+
+ php_stream_rewind(fp);
+
++ if (sig_type != PHAR_SIG_OPENSSL) {
++ php_stream_statbuf ssb;
++ char *pfile;
++ zend_bool has_pubkey;
++
++ spprintf(&pfile, 0, "%s.pubkey", fname);
++ has_pubkey = php_stream_stat_path_ex(pfile, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) == 0;
++ efree(pfile);
++
++ if (has_pubkey) {
++ if (error) {
++ spprintf(error, 0, "openssl public key found, but the signature does not use openssl");
++ }
++ return FAILURE;
++ }
++ }
++
+ switch (sig_type) {
+ case PHAR_SIG_OPENSSL: {
+ #ifdef PHAR_HAVE_OPENSSL
diff --git a/php-cve-2026-129289.patch b/php-cve-2026-129289.patch
new file mode 100644
index 0000000..c7de5c7
--- /dev/null
+++ b/php-cve-2026-129289.patch
@@ -0,0 +1,64 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Thu Oct 29 11:19:04 2026 +0100
+Subject: [PATCH] Fix GHSA-qc49-hpvq-g2w6 (CVE-2026-129289): Drain unread request bodies
+
+Opening php://input can create a request body stream without
+consuming the input from the SAPI. Request shutdown treated the
+stream as proof that the body was read and skipped the drain.
+
+Drain whenever post_read is false, independently of whether the
+stream exists. This keeps unread FastCGI STDIN bytes from being
+parsed as another request when FCGI_KEEP_CONN is set.
+
+As a final safeguard, reject a new FastCGI request if the
+previous STDIN record was only partially consumed.
+
+Upstream: https://github.com/php/php-src/commit/28014fd092c7acdafb9c074e735f099893a5ef66
+PLD: only the FastCGI part, applied to both copies of fastcgi.c (sapi/cgi, sapi/fpm): 5.4 has no lazy php://input, sapi_deactivate() drains the body whenever post_data is unset, and post_data is only set after reading the whole Content-Length; the FPM tests need the 7.x tester and are not included
+---
+diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
+--- a/sapi/cgi/fastcgi.c
++++ b/sapi/cgi/fastcgi.c
+@@ -885,6 +885,10 @@ static int fcgi_read_request(fcgi_request *req)
+ int len, padding;
+ unsigned char buf[FCGI_MAX_LENGTH+8];
+
++ if (UNEXPECTED(req->in_len != 0)) {
++ return 0;
++ }
++
+ req->keep = 0;
+ req->closed = 0;
+ req->in_len = 0;
+@@ -1138,6 +1142,8 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
+ req->nodelay = 0;
+ #endif
+ req->fd = -1;
++ /* a partially read STDIN record does not outlive its connection */
++ req->in_len = 0;
+ }
+ }
+
+diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
+--- a/sapi/fpm/fpm/fastcgi.c
++++ b/sapi/fpm/fpm/fastcgi.c
+@@ -503,6 +503,10 @@ static int fcgi_read_request(fcgi_request *req)
+ int len, padding;
+ unsigned char buf[FCGI_MAX_LENGTH+8];
+
++ if (UNEXPECTED(req->in_len != 0)) {
++ return 0;
++ }
++
+ req->keep = 0;
+ req->closed = 0;
+ req->in_len = 0;
+@@ -755,6 +759,8 @@ void fcgi_close(fcgi_request *req, int force, int destroy)
+ close(req->fd);
+ #endif
+ req->fd = -1;
++ /* a partially read STDIN record does not outlive its connection */
++ req->in_len = 0;
+ fpm_request_finished();
+ }
+ }
diff --git a/php-cve-2026-129291.patch b/php-cve-2026-129291.patch
new file mode 100644
index 0000000..56855df
--- /dev/null
+++ b/php-cve-2026-129291.patch
@@ -0,0 +1,39 @@
+From: Ian P. Christian <ian.christian at zoopla.co.uk>
+Date: Tue Oct 27 17:59:48 2026 +0100
+Subject: [PATCH] Fix GHSA-jm4m-qfqx-967m (CVE-2026-129291): FPM worker stdio pipe fd closed twice
+
+Backport of the GH-24046 fix (cd161267c0d2ca293b6959114d7c68867273bbda).
+
+Co-authored-by: ndossche <7771979+ndossche at users.noreply.github.com>
+
+Upstream: https://github.com/php/php-src/commit/8c38b791449708540fd356ddc6927f463faeca91
+PLD: 5.4 has no delayed child cleanup, but it closes the pipe without removing its event and frees the child right away; workers forked later inherit the read end, so the epoll registration outlives the close and fires on the freed child
+PLD: the FPM test needs the 7.x tester and is not included
+---
+diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c
+--- a/sapi/fpm/fpm/fpm_children.c
++++ b/sapi/fpm/fpm/fpm_children.c
+@@ -69,7 +69,11 @@ static void fpm_child_close(struct fpm_child_s *child, int in_event_loop) /* {{{
+ fpm_event_fire(&child->ev_stdout);
+ }
+ if (child->fd_stdout != -1) {
++ if (in_event_loop) {
++ fpm_event_del(&child->ev_stdout);
++ }
+ close(child->fd_stdout);
++ child->fd_stdout = -1;
+ }
+ }
+
+@@ -78,7 +82,11 @@ static void fpm_child_close(struct fpm_child_s *child, int in_event_loop) /* {{{
+ fpm_event_fire(&child->ev_stderr);
+ }
+ if (child->fd_stderr != -1) {
++ if (in_event_loop) {
++ fpm_event_del(&child->ev_stderr);
++ }
+ close(child->fd_stderr);
++ child->fd_stderr = -1;
+ }
+ }
+
diff --git a/php-cve-2026-129292.patch b/php-cve-2026-129292.patch
new file mode 100644
index 0000000..d3feddd
--- /dev/null
+++ b/php-cve-2026-129292.patch
@@ -0,0 +1,207 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Mon Oct 26 20:10:08 2026 +0100
+Subject: [PATCH] Fix GHSA-3mg3-cr28-46gc (CVE-2026-129292): FPM XSS within status endpoint via user and script
+
+The fix for GHSA-7qg2-v9fj-4mwv escaped only the request URI and query
+string. The request method, auth user and script filename were still
+printed raw in the full status output. Escape all of them using a common
+helper.
+
+Upstream: https://github.com/php/php-src/commit/1ecb92f2cdeb235bb10d6c220c9be4a13f527243
+PLD: ext/json is a shared module here, so the JSON output gets a local escaper producing what json_encode() with PHP_JSON_INVALID_UTF8_IGNORE does; the 5.4 port of GHSA-7qg2-v9fj-4mwv escaped the request URI and query string for HTML and XML only, the JSON output had no escaping at all
+PLD: the FPM test needs the 7.x tester and is not included
+---
+diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
+--- a/sapi/fpm/fpm/fpm_status.c
++++ b/sapi/fpm/fpm/fpm_status.c
+@@ -16,11 +16,77 @@
+ #include "fpm_conf.h"
+ #include "fpm_php.h"
+ #include <ext/standard/html.h>
++#include <ext/standard/php_smart_str.h>
+
+ static char *fpm_status_uri = NULL;
+ static char *fpm_status_ping_uri = NULL;
+ static char *fpm_status_ping_response = NULL;
+
++/* what json_encode() with PHP_JSON_INVALID_UTF8_IGNORE produces, without
++ * the quotes; ext/json may be a shared module that FPM cannot call */
++static char *fpm_status_json_escape(const char *str) /* {{{ */
++{
++ const unsigned char *s = (const unsigned char *) str;
++ size_t len = strlen(str), pos = 0;
++ smart_str buf = {0};
++ char hex[16];
++
++ while (pos < len) {
++ int status;
++ unsigned int c = php_next_utf8_char(s, len, &pos, &status);
++
++ if (status != SUCCESS) {
++ continue;
++ }
++ switch (c) {
++ case '"': smart_str_appendl(&buf, "\\\"", 2); break;
++ case '\\': smart_str_appendl(&buf, "\\\\", 2); break;
++ case '/': smart_str_appendl(&buf, "\\/", 2); break;
++ case '\b': smart_str_appendl(&buf, "\\b", 2); break;
++ case '\f': smart_str_appendl(&buf, "\\f", 2); break;
++ case '\n': smart_str_appendl(&buf, "\\n", 2); break;
++ case '\r': smart_str_appendl(&buf, "\\r", 2); break;
++ case '\t': smart_str_appendl(&buf, "\\t", 2); break;
++ default:
++ if (c >= 0x20 && c < 0x80) {
++ smart_str_appendc(&buf, (char) c);
++ } else if (c < 0x10000) {
++ smart_str_appendl(&buf, hex, snprintf(hex, sizeof(hex), "\\u%04x", c));
++ } else {
++ c -= 0x10000;
++ smart_str_appendl(&buf, hex, snprintf(hex, sizeof(hex), "\\u%04x\\u%04x",
++ 0xd800 | (c >> 10), 0xdc00 | (c & 0x3ff)));
++ }
++ }
++ }
++ smart_str_0(&buf);
++
++ return buf.c ? buf.c : estrdup("");
++}
++/* }}} */
++
++/* returns NULL for an empty string; *tmp is set when the result has to be freed */
++static char *fpm_status_escape(const char *str, int encode_html, int encode_json, char **tmp TSRMLS_DC) /* {{{ */
++{
++ size_t len;
++
++ *tmp = NULL;
++ if (str[0] == '\0') {
++ return NULL;
++ }
++ if (encode_html) {
++ *tmp = php_escape_html_entities_ex((unsigned char *) str, strlen(str), &len, 1,
++ ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT, NULL, /* double_encode */ 1 TSRMLS_CC);
++ return *tmp;
++ }
++ if (encode_json) {
++ *tmp = fpm_status_json_escape(str);
++ return *tmp;
++ }
++ return (char *) str;
++}
++/* }}} */
++
+
+ int fpm_status_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
+ {
+@@ -52,7 +118,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ struct fpm_scoreboard_proc_s proc;
+ char *buffer, *time_format, time_buffer[64];
+ time_t now_epoch;
+- int full, encode;
++ int full, encode, encode_json;
+ char *short_syntax, *short_post;
+ char *full_pre, *full_syntax, *full_post, *full_separator;
+
+@@ -130,6 +196,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ short_syntax = short_post = NULL;
+ full_separator = full_pre = full_syntax = full_post = NULL;
+ encode = 0;
++ encode_json = 0;
+
+ /* HTML */
+ if (fpm_php_get_string_from_table("_GET", "html" TSRMLS_CC)) {
+@@ -262,6 +329,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ } else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) {
+ sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC);
+ time_format = "%s";
++ encode_json = 1;
+
+ short_syntax =
+ "{"
+@@ -384,10 +452,10 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ /* no need to test the var 'full' */
+ if (full_syntax) {
+ int i, first;
+- size_t len;
+- char *query_string;
+- char *request_uri_str;
+- size_t uri_len;
++ char *tmp_request_method_str, *tmp_request_uri_str, *tmp_query_string;
++ char *tmp_auth_user_str, *tmp_script_filename_str;
++ char *request_method_str, *request_uri_str, *query_string;
++ char *auth_user_str, *script_filename_str;
+ struct timeval duration, now;
+ #ifdef HAVE_FPM_LQ
+ float cpu;
+@@ -414,25 +482,11 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ }
+ }
+
+- request_uri_str = NULL;
+- uri_len = 0;
+- if (proc.request_uri[0] != '\0') {
+- if (!encode) {
+- request_uri_str = proc.request_uri;
+- } else {
+- request_uri_str = php_escape_html_entities_ex((unsigned char *)proc.request_uri, strlen(proc.request_uri), &uri_len, 1, ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT, NULL, 1 TSRMLS_CC);
+- }
+- }
+-
+- query_string = NULL;
+- len = 0;
+- if (proc.query_string[0] != '\0') {
+- if (!encode) {
+- query_string = proc.query_string;
+- } else {
+- query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), &len, 1, ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT, NULL, 1 TSRMLS_CC);
+- }
+- }
++ request_method_str = fpm_status_escape(proc.request_method, encode, encode_json, &tmp_request_method_str TSRMLS_CC);
++ request_uri_str = fpm_status_escape(proc.request_uri, encode, encode_json, &tmp_request_uri_str TSRMLS_CC);
++ query_string = fpm_status_escape(proc.query_string, encode, encode_json, &tmp_query_string TSRMLS_CC);
++ auth_user_str = fpm_status_escape(proc.auth_user, encode, encode_json, &tmp_auth_user_str TSRMLS_CC);
++ script_filename_str = fpm_status_escape(proc.script_filename, encode, encode_json, &tmp_script_filename_str TSRMLS_CC);
+
+ #ifdef HAVE_FPM_LQ
+ /* prevent NaN */
+@@ -456,13 +510,13 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ now_epoch - proc.start_epoch,
+ proc.requests,
+ duration.tv_sec * 1000000UL + duration.tv_usec,
+- proc.request_method[0] != '\0' ? proc.request_method : "-",
++ request_method_str ? request_method_str : "-",
+ request_uri_str ? request_uri_str : "-",
+ query_string ? "?" : "",
+ query_string ? query_string : "",
+ proc.content_length,
+- proc.auth_user[0] != '\0' ? proc.auth_user : "-",
+- proc.script_filename[0] != '\0' ? proc.script_filename : "-",
++ auth_user_str ? auth_user_str : "-",
++ script_filename_str ? script_filename_str : "-",
+ #ifdef HAVE_FPM_LQ
+ proc.request_stage == FPM_REQUEST_ACCEPTING ? cpu : 0.,
+ #endif
+@@ -470,11 +524,20 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+ PUTS(buffer);
+ efree(buffer);
+
+- if (len > 0 && query_string) {
+- efree(query_string);
++ if (tmp_request_method_str) {
++ efree(tmp_request_method_str);
++ }
++ if (tmp_request_uri_str) {
++ efree(tmp_request_uri_str);
++ }
++ if (tmp_query_string) {
++ efree(tmp_query_string);
++ }
++ if (tmp_auth_user_str) {
++ efree(tmp_auth_user_str);
+ }
+- if (uri_len > 0 && request_uri_str) {
+- efree(request_uri_str);
++ if (tmp_script_filename_str) {
++ efree(tmp_script_filename_str);
+ }
+ }
+
diff --git a/php-cve-2026-129481.patch b/php-cve-2026-129481.patch
new file mode 100644
index 0000000..5a98cfa
--- /dev/null
+++ b/php-cve-2026-129481.patch
@@ -0,0 +1,22 @@
+From: Arnaud Le Blanc <arnaud.lb at gmail.com>
+Date: Tue Nov 10 17:33:58 2026 +0100
+Subject: [PATCH] Fix GHSA-g3vh-838c-65v7 (CVE-2026-129481): do not continue after an interrupted RSHUTDOWN()
+
+Co-authored-by: Jakub Zelenka <bukka at php.net>
+
+Upstream: https://github.com/php/php-src/commit/ad9b44ae611962c8b770ffc962ddff0c30d7d77c
+PLD: only the Zend part: 5.4 has no PS(session_started_filename), but a bailout in session RSHUTDOWN (e.g. a stream closed while $_SESSION is destroyed) skips the release of PS(mod_user_names), which the next request then releases again; 5.4 runs all RSHUTDOWN handlers in one zend_try, so the catch goes there; the FPM test needs the 7.x tester and is not included
+---
+diff --git a/Zend/zend_API.c b/Zend/zend_API.c
+--- a/Zend/zend_API.c
++++ b/Zend/zend_API.c
+@@ -2380,6 +2380,9 @@ void zend_deactivate_modules(TSRMLS_D) /* {{{ */
+ p++;
+ }
+ }
++ } zend_catch {
++ /* module shutdown is incomplete */
++ _exit(1);
+ } zend_end_try();
+ }
+ /* }}} */
diff --git a/php-cve-2026-129496.patch b/php-cve-2026-129496.patch
new file mode 100644
index 0000000..20ce320
--- /dev/null
+++ b/php-cve-2026-129496.patch
@@ -0,0 +1,27 @@
+From: Ilija Tovilo <ilija.tovilo at me.com>
+Date: Sun Nov 15 15:25:20 2026 +0100
+Subject: [PATCH] Fix GHSA-gr4f-wgx5-jpfv (CVE-2026-129496): DATEG(tzcache) use-after-free
+
+Upstream: https://github.com/php/php-src/commit/f986c5ca37c0fdc50595d8291a9920a1df23bf38
+PLD: 5.4 has no zend_test startup warning, so the upstream test is not included
+---
+diff --git a/main/main.c b/main/main.c
+--- a/main/main.c
++++ b/main/main.c
+@@ -645,15 +645,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
+ char *error_time_str;
+
+ time(&error_time);
+-#ifdef ZTS
+- if (!php_during_module_startup()) {
+- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+- } else {
+- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+- }
+-#else
+- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+-#endif
++ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, PG(modules_activated) && EG(active) TSRMLS_CC);
+ len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
+ #ifdef PHP_WIN32
+ php_flock(fd, 2);
diff --git a/php-cve-2026-129506.patch b/php-cve-2026-129506.patch
new file mode 100644
index 0000000..9fea9ed
--- /dev/null
+++ b/php-cve-2026-129506.patch
@@ -0,0 +1,99 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Sun Nov 1 15:18:09 2026 +0100
+Subject: [PATCH] Fix GHSA-4646-p932-gw34 (CVE-2026-129506): keep SOAP DTD alive during cleanup
+
+Upstream: https://github.com/php/php-src/commit/66db5cda7df3d7a0e1fc7b171bd9ca318fca49fb
+PLD: the upstream test passes the request to SoapServer::handle(), 5.4 does not read a --POST-- body without always_populate_raw_post_data; that path never reaches cleanup_xml_node(), so a WSDL test is added, which shows the use-after-free under valgrind
+---
+diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
+--- a/ext/soap/php_xml.c
++++ b/ext/soap/php_xml.c
+@@ -53,6 +53,9 @@ static void cleanup_xml_node(xmlNodePtr node)
+ xmlUnlinkNode(trav);
+ xmlFreeNode(trav);
+ }
++ } else if (trav->type == XML_DTD_NODE) {
++ /* Attribute-value entity references can share content with the DTD.
++ * Keep it alive until the document itself is freed. */
+ } else if ((trav->type != XML_ELEMENT_NODE) &&
+ (trav->type != XML_CDATA_SECTION_NODE)) {
+ xmlUnlinkNode(trav);
+diff --git a/ext/soap/tests/GHSA-4646-p932-gw34-wsdl.phpt b/ext/soap/tests/GHSA-4646-p932-gw34-wsdl.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-4646-p932-gw34-wsdl.phpt
+@@ -0,0 +1,13 @@
++--TEST--
++GHSA-4646-p932-gw34: WSDL attribute entity references must not outlive the DTD
++--SKIPIF--
++<?php if (!extension_loaded("soap")) die("skip soap extension required"); ?>
++--INI--
++soap.wsdl_cache_enabled=0
++--FILE--
++<?php
++$client = new SoapClient(__DIR__ . '/GHSA-4646-p932-gw34.wsdl');
++var_dump(count($client->__getFunctions()));
++?>
++--EXPECT--
++int(1)
+diff --git a/ext/soap/tests/GHSA-4646-p932-gw34.phpt b/ext/soap/tests/GHSA-4646-p932-gw34.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-4646-p932-gw34.phpt
+@@ -0,0 +1,37 @@
++--TEST--
++GHSA-4646-p932-gw34: DTD entity references must not outlive their declarations
++--SKIPIF--
++<?php if (!extension_loaded("soap")) die("skip soap extension required"); ?>
++--FILE--
++<?php
++function echo_($x) {
++ return $x;
++}
++
++$request = <<<XML
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE Envelope [<!ENTITY e "boom">]>
++<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
++ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
++ xmlns:ns1="urn:t">
++ <SOAP-ENV:Header>
++ <h SOAP-ENV:actor="&e;" SOAP-ENV:mustUnderstand="1"/>
++ </SOAP-ENV:Header>
++ <SOAP-ENV:Body>
++ <ns1:echo_><param0 xsi:type="xsd:string">x</param0></ns1:echo_>
++ </SOAP-ENV:Body>
++</SOAP-ENV:Envelope>
++XML;
++
++$server = new SoapServer(null, array(
++ 'uri' => 'urn:t',
++ 'style' => SOAP_RPC,
++ 'use' => SOAP_ENCODED,
++));
++$server->addFunction('echo_');
++$server->handle($request);
++?>
++--EXPECT--
++<?xml version="1.0" encoding="UTF-8"?>
++<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>DTD are not supported by SOAP</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+diff --git a/ext/soap/tests/GHSA-4646-p932-gw34.wsdl b/ext/soap/tests/GHSA-4646-p932-gw34.wsdl
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-4646-p932-gw34.wsdl
+@@ -0,0 +1,14 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE definitions [<!ENTITY e "urn:entity-namespace-value-that-is-long-enough">]>
++<definitions name="t" targetNamespace="&e;" xmlns:tns="urn:t" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
++ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
++ <message name="echoRequest"><part name="x" type="xsd:string"/></message>
++ <message name="echoResponse"><part name="r" type="xsd:string"/></message>
++ <portType name="P"><operation name="echo"><input message="tns:echoRequest"/><output message="tns:echoResponse"/></operation></portType>
++ <binding name="B" type="tns:P"><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
++ <operation name="echo"><soap:operation soapAction="urn:t#echo"/>
++ <input><soap:body use="encoded" namespace="urn:t" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
++ <output><soap:body use="encoded" namespace="urn:t" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
++ </operation></binding>
++ <service name="S"><port name="Pt" binding="tns:B"><soap:address location="http://127.0.0.1:1/"/></port></service>
++</definitions>
diff --git a/php-cve-2026-129538.patch b/php-cve-2026-129538.patch
new file mode 100644
index 0000000..8b50f3b
--- /dev/null
+++ b/php-cve-2026-129538.patch
@@ -0,0 +1,89 @@
+From: Jakub Zelenka <bukka at php.net>
+Date: Mon Oct 26 18:54:31 2026 +0100
+Subject: [PATCH] Fix GHSA-5j3f-64r7-f564 (CVE-2026-129538): PATH_INFO underflow in CGI init_request_info()
+
+When the suffix stripped from SCRIPT_FILENAME (or PATH_TRANSLATED) is
+longer than PATH_INFO, the re-derived PATH_INFO pointed before the value
+and was then read, written and copied from. Only rewrite PATH_INFO when
+it is longer than the stripped suffix, as FPM has done since the
+CVE-2019-11043 fix.
+
+Upstream: https://github.com/php/php-src/commit/964cdcfa5adfa577cde97df89fc8fda04815694d
+PLD: tests use a proc_open() command string and pass the environment explicitly
+---
+diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
+--- a/sapi/cgi/cgi_main.c
++++ b/sapi/cgi/cgi_main.c
+@@ -1257,9 +1257,9 @@ static void init_request_info(fcgi_request *request TSRMLS_DC)
+ */
+ int slen = len - strlen(pt);
+ int pilen = env_path_info ? strlen(env_path_info) : 0;
+- char *path_info = env_path_info ? env_path_info + pilen - slen : NULL;
++ char *path_info = (env_path_info && pilen > slen) ? env_path_info + pilen - slen : NULL;
+
+- if (orig_path_info != path_info) {
++ if (path_info && orig_path_info != path_info) {
+ if (orig_path_info) {
+ char old;
+
+diff --git a/sapi/cgi/tests/ghsa-5j3f-64r7-f564.phpt b/sapi/cgi/tests/ghsa-5j3f-64r7-f564.phpt
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/tests/ghsa-5j3f-64r7-f564.phpt
+@@ -0,0 +1,56 @@
++--TEST--
++GHSA-5j3f-64r7-f564 (PATH_INFO underflow when the stripped suffix is longer than PATH_INFO)
++--SKIPIF--
++<?php include "skipif.inc"; ?>
++--FILE--
++<?php
++include "include.inc";
++
++$php = get_cgi_path();
++$script = __DIR__ . "/ghsa-5j3f-64r7-f564.target.php";
++file_put_contents($script, '<?php var_dump(isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : null, isset($_SERVER["ORIG_PATH_INFO"]) ? $_SERVER["ORIG_PATH_INFO"] : null);');
++
++function run_cgi($php, array $env) {
++ $env += array("REDIRECT_STATUS" => "1", "REQUEST_METHOD" => "GET", "PATH" => getenv("PATH"));
++ $p = proc_open(
++ escapeshellarg($php) . " -n -d cgi.fix_pathinfo=1",
++ array(0 => array("pipe", "r"), 1 => array("pipe", "w")),
++ $pipes,
++ null,
++ $env
++ );
++ fclose($pipes[0]);
++ $out = stream_get_contents($pipes[1]);
++ fclose($pipes[1]);
++ proc_close($p);
++ echo substr($out, strpos($out, "\r\n\r\n") + 4);
++}
++
++echo "Suffix shorter than PATH_INFO\n";
++run_cgi($php, array("SCRIPT_FILENAME" => "$script/b", "PATH_INFO" => "/a/b"));
++
++echo "Suffix longer than PATH_INFO\n";
++run_cgi($php, array("SCRIPT_FILENAME" => "$script/xxxxxxxxxxxxxxxx", "PATH_INFO" => "/x"));
++
++echo "Suffix taken from PATH_TRANSLATED\n";
++run_cgi($php, array(
++ "SCRIPT_FILENAME" => $php,
++ "PATH_TRANSLATED" => "$script/xxxxxxxxxxxxxxxx",
++ "REDIRECT_URL" => "/redirected",
++ "PATH_INFO" => "/x",
++));
++?>
++--CLEAN--
++<?php
++ at unlink(__DIR__ . "/ghsa-5j3f-64r7-f564.target.php");
++?>
++--EXPECT--
++Suffix shorter than PATH_INFO
++string(2) "/b"
++string(4) "/a/b"
++Suffix longer than PATH_INFO
++string(2) "/x"
++NULL
++Suffix taken from PATH_TRANSLATED
++string(2) "/x"
++NULL
diff --git a/php-cve-2026-15353.patch b/php-cve-2026-15353.patch
new file mode 100644
index 0000000..0e5300e
--- /dev/null
+++ b/php-cve-2026-15353.patch
@@ -0,0 +1,256 @@
+From: Alexandre Daubois <alex.daubois at gmail.com>
+Date: Mon Sep 21 15:49:40 2026 +0200
+Subject: [PATCH] Fix GHSA-q23r-hr55-xmpg (CVE-2026-15353): out-of-bounds read on empty SOAP-ENC:arraySize
+
+Upstream: https://github.com/php/php-src/commit/59e46404a744b7ef469f51acd3ee225d518dbaf8
+PLD: the tests are written in PHP 5.4 syntax
+---
+diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
+--- a/ext/soap/php_encoding.c
++++ b/ext/soap/php_encoding.c
+@@ -2141,7 +2141,7 @@ static int calc_dimension_12(const char* str)
+ }
+ str++;
+ }
+- return i;
++ return i != 0 ? i : 1;
+ }
+
+ static int* get_position_12(int dimension, const char* str)
+diff --git a/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt b/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt
+@@ -0,0 +1,87 @@
++--TEST--
++GHSA-q23r-hr55-xmpg: Unbounded array walk on empty wsdl:arraySize
++--SKIPIF--
++<?php
++if (!extension_loaded("soap")) die("skip soap extension required");
++if (!extension_loaded("json")) die("skip json extension required");
++?>
++--INI--
++soap.wsdl_cache_enabled=0
++--FILE--
++<?php
++
++define('WSDL', __DIR__ . '/GHSA-q23r-hr55-xmpg-wsdl.wsdl');
++
++function itemType() { return array('A', 'B', 'C'); }
++function sizeOnly() { return array('A', 'B', 'C'); }
++
++function request($operation) {
++ return <<<XML
++<?xml version="1.0"?>
++<env:Envelope
++ xmlns:env="http://www.w3.org/2003/05/soap-envelope"
++ xmlns:m="urn:arraysize">
++
++ <env:Body>
++ <m:{$operation}/>
++ </env:Body>
++</env:Envelope>
++XML;
++}
++
++class ReplayClient extends SoapClient
++{
++ public $arrayType;
++
++ public function __construct($arrayType) {
++ $this->arrayType = $arrayType;
++ parent::__construct(WSDL);
++ }
++
++ public function __doRequest($request, $location, $action, $version, $one_way = 0) {
++ return <<<XML
++<?xml version="1.0"?>
++<env:Envelope
++ xmlns:env="http://www.w3.org/2003/05/soap-envelope"
++ xmlns:ns1="urn:arraysize"
++ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++
++ <env:Body>
++ <ns1:{$this->arrayType}Response>
++ <result xsi:type="ns1:{$this->arrayType}Array">
++ <item xsi:type="xsd:string">A</item>
++ <item xsi:type="xsd:string">B</item>
++ <item xsi:type="xsd:string">C</item>
++ </result>
++ </ns1:{$this->arrayType}Response>
++ </env:Body>
++</env:Envelope>
++XML;
++ }
++}
++
++$server = new SoapServer(WSDL);
++$server->addFunction(array('itemType', 'sizeOnly'));
++
++foreach (array('itemType', 'sizeOnly') as $operation) {
++ ob_start();
++ $server->handle(request($operation));
++ $response = ob_get_clean();
++
++ preg_match('/arraySize="[^"]*"/', $response, $matches);
++ echo 'encode ', $operation, ' => ', isset($matches[0]) ? $matches[0] : 'none', "\n";
++}
++
++foreach (array('ItemType', 'SizeOnly') as $arrayType) {
++ $client = new ReplayClient($arrayType);
++ $method = lcfirst($arrayType);
++ echo 'decode ', $arrayType, ' => ', json_encode($client->$method()), "\n";
++}
++
++?>
++--EXPECT--
++encode itemType => arraySize="3"
++encode sizeOnly => arraySize="3"
++decode ItemType => ["A","B","C"]
++decode SizeOnly => ["A","B","C"]
+diff --git a/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.wsdl b/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.wsdl
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.wsdl
+@@ -0,0 +1,67 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
++ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
++ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
++ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
++ xmlns:enc12="http://www.w3.org/2003/05/soap-encoding"
++ xmlns:tns="urn:arraysize"
++ targetNamespace="urn:arraysize">
++
++ <types>
++ <xsd:schema targetNamespace="urn:arraysize">
++ <xsd:import namespace="http://www.w3.org/2003/05/soap-encoding"/>
++
++ <xsd:complexType name="ItemTypeArray">
++ <xsd:complexContent>
++ <xsd:restriction base="enc12:Array">
++ <xsd:attribute ref="enc12:itemType" wsdl:itemType="xsd:string"/>
++ <xsd:attribute ref="enc12:arraySize" wsdl:arraySize=""/>
++ </xsd:restriction>
++ </xsd:complexContent>
++ </xsd:complexType>
++
++ <xsd:complexType name="SizeOnlyArray">
++ <xsd:complexContent>
++ <xsd:restriction base="enc12:Array">
++ <xsd:attribute ref="enc12:arraySize" wsdl:arraySize=""/>
++ </xsd:restriction>
++ </xsd:complexContent>
++ </xsd:complexType>
++ </xsd:schema>
++ </types>
++
++ <message name="emptyRequest"/>
++ <message name="itemTypeResponse"><part name="result" type="tns:ItemTypeArray"/></message>
++ <message name="sizeOnlyResponse"><part name="result" type="tns:SizeOnlyArray"/></message>
++
++ <portType name="ArrayPortType">
++ <operation name="itemType">
++ <input message="tns:emptyRequest"/>
++ <output message="tns:itemTypeResponse"/>
++ </operation>
++ <operation name="sizeOnly">
++ <input message="tns:emptyRequest"/>
++ <output message="tns:sizeOnlyResponse"/>
++ </operation>
++ </portType>
++
++ <binding name="ArrayBinding" type="tns:ArrayPortType">
++ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
++ <operation name="itemType">
++ <soap:operation soapAction="itemType"/>
++ <input><soap:body use="encoded" namespace="urn:arraysize" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></input>
++ <output><soap:body use="encoded" namespace="urn:arraysize" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></output>
++ </operation>
++ <operation name="sizeOnly">
++ <soap:operation soapAction="sizeOnly"/>
++ <input><soap:body use="encoded" namespace="urn:arraysize" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></input>
++ <output><soap:body use="encoded" namespace="urn:arraysize" encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></output>
++ </operation>
++ </binding>
++
++ <service name="ArrayService">
++ <port name="ArrayPort" binding="tns:ArrayBinding">
++ <soap:address location="test://"/>
++ </port>
++ </service>
++</definitions>
+diff --git a/ext/soap/tests/GHSA-q23r-hr55-xmpg.phpt b/ext/soap/tests/GHSA-q23r-hr55-xmpg.phpt
+new file mode 100644
+--- /dev/null
++++ b/ext/soap/tests/GHSA-q23r-hr55-xmpg.phpt
+@@ -0,0 +1,68 @@
++--TEST--
++GHSA-q23r-hr55-xmpg: Out-of-bounds read on empty SOAP-ENC:arraySize
++--SKIPIF--
++<?php
++if (!extension_loaded("soap")) die("skip soap extension required");
++if (!extension_loaded("json")) die("skip json extension required");
++?>
++--FILE--
++<?php
++
++function echo_back($data) { $GLOBALS['decoded'][] = $data; return null; }
++
++function request($arraySize, $itemType = '') {
++ $itemTypeAttribute = $itemType === '' ? '' : "SOAP-ENC:itemType=\"{$itemType}\"";
++
++ return <<<XML
++<?xml version="1.0"?>
++<SOAP-ENV:Envelope
++ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
++ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
++ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++
++ <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
++ <echo_back>
++ <data xsi:type="SOAP-ENC:Array" {$itemTypeAttribute} SOAP-ENC:arraySize="{$arraySize}">
++ <item xsi:type="xsd:string">A</item>
++ <item xsi:type="xsd:string">B</item>
++ <item xsi:type="xsd:string">C</item>
++ </data>
++ </echo_back>
++ </SOAP-ENV:Body>
++</SOAP-ENV:Envelope>
++XML;
++}
++
++function decode(SoapServer $server, $request) {
++ ob_start();
++ $server->handle($request);
++ $response = ob_get_clean();
++
++ if (strpos($response, '<SOAP-ENV:Fault>') !== false) {
++ return 'fault: ' . strip_tags($response);
++ }
++
++ return json_encode(array_pop($GLOBALS['decoded']));
++}
++
++$server = new SoapServer(null, array('uri' => 'http://test'));
++$server->addFunction('echo_back');
++
++$GLOBALS['decoded'] = array();
++
++foreach (array('', ' ', 'abc', '*', '3', '2 2') as $arraySize) {
++ echo var_export($arraySize, true), ' => ', decode($server, request($arraySize)), "\n";
++}
++
++echo "itemType => ", decode($server, request('', 'xsd:string')), "\n";
++
++?>
++--EXPECT--
++'' => ["A","B","C"]
++' ' => ["A","B","C"]
++'abc' => ["A","B","C"]
++'*' => ["A","B","C"]
++'3' => ["A","B","C"]
++'2 2' => [["A","B"],["C"]]
++itemType => ["A","B","C"]
diff --git a/php-http-response-header-leak.patch b/php-http-response-header-leak.patch
new file mode 100644
index 0000000..831c93f
--- /dev/null
+++ b/php-http-response-header-leak.patch
@@ -0,0 +1,23 @@
+From: Arkadiusz Miśkiewicz <arekm at maven.pl>
+Date: Thu Nov 19 15:33:37 2026 +0100
+Subject: [PATCH] Do not leak stored HTTP response header lines
+
+The 5.4 port of the folded header parser copies every stored response
+header into $http_response_header and never frees its own buffer, so
+each header leaks until the end of the request; a long running script
+fetching URLs grows without bound. Hand the buffer over to the zval,
+as 8.x does with ZVAL_NEW_STR().
+PLD: PLD fix for the 5.4 port of the GHSA-v8xr-gpvj-cx9g folding fix
+---
+diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
+--- a/ext/standard/http_fopen_wrapper.c
++++ b/ext/standard/http_fopen_wrapper.c
+@@ -374,7 +374,7 @@ static zend_bool php_stream_http_response_headers_parse(php_stream_wrapper *wrap
+ zval *http_response;
+
+ MAKE_STD_ZVAL(http_response);
+- ZVAL_STRINGL(http_response, last_header_line_str, last_header_line_length, 1);
++ ZVAL_STRINGL(http_response, last_header_line_str, last_header_line_length, 0);
+ zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_response, sizeof(zval *), NULL);
+ } else {
+ efree(last_header_line_str);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/74b134ca86256031c6b54b523fc85d6eabc7a4dd
More information about the pld-cvs-commit
mailing list