Commit a38ab8c8ad3 for php
commit a38ab8c8ad334262ed0094b2e55c3c281534ddca
Merge: ae961499489 ab05b44386f
Author: Jakub Zelenka <bukka@php.net>
Date: Thu Nov 19 16:11:03 2026 +0100
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fix GHSA-x8r7-mg3g-74hg: Lifetime issue in Dom\XMLDocument serialiser
Revert "ext/session: Truncate session file after successful write"
Skip header_over_4gib.phpt when available memory is insufficient
PHP-8.3 is now for PHP 8.3.38-dev
Fix GHSA-g3vh-838c-65v7: Zero PS(session_started_filename) early
PHP-8.2 is now for PHP 8.2.37-dev
Add NEWS entries
Fix GHSA-jm4m-qfqx-967m: FPM worker stdio pipe fd closed twice
Fix GHSA-mmf9-xm3v-hg2x: quadratic folded header concatenation
Fix GHSA-f6gg-rchx-xw8j: mixed case HTTPS and FTPS
Fix GHSA-658j-r8rw-q6mx: session.upload_progress.enabled is off by default
Fix GHSA-fm2m-fjf5-v3cp: RCE via corrupted session file
Fix GHSA-gr4f-wgx5-jpfv: DATEG(tzcache) use-after-free
Fix GHSA-4646-p932-gw34: keep SOAP DTD alive during cleanup
Fix GHSA-qc49-hpvq-g2w6: Drain unread request bodies
Fix GHSA-3mg3-cr28-46gc: FPM XSS within status endpoint via user and script
Fix GHSA-5j3f-64r7-f564: PATH_INFO underflow in CGI init_request_info()
Fix GHSA-68fq-fh7h-f8gr: refuse keyless phar signature when .pubkey exists
Fix GHSA-q23r-hr55-xmpg: out-of-bounds read on empty SOAP-ENC:arraySize
# Conflicts:
# NEWS
diff --cc NEWS
index 8f03a2a6893,d5aa3407361..15520093cd7
--- a/NEWS
+++ b/NEWS
@@@ -210,9 -220,13 +210,18 @@@ PH
(Jorg Sowa)
. Fixed bug GH-25061 ($x = $x - 1 on null is optimized to PRE_DEC).
(Lazizbek Ergashev)
- . Fixed bug GH-24480 (Finally block running a second time when a VM interrupt
- throws as the finally block returns to a "return" in its try block).
- (C. Scott Ananian)
+ . Fixed first-class callables to static methods in trait constant
+ expressions resolving to the method of the first using class and
+ bypassing visibility checks. (Jorg Sowa)
++ . Fixed GHSA-8mjj-2r7p-4hg2 (Use-after-free in magic method backtraces can
++ lead to remote code execution). (CVE-2026-129474) (Arnaud Le Blanc)
++ . Fixed GHSA-2fjv-p558-g82m (Use-after-free via repopulation of
++ last_fatal_error_backtrace global after shutdown). (CVE-2026-129182)
++ (Arnaud Le Blanc, Jakub Zelenka)
+
+ - CGI:
+ . Fixed GHSA-5j3f-64r7-f564 (PHP-CGI out-of-bounds read and write during
+ PATH_INFO correction). (CVE-2026-129538) (Jakub Zelenka)
- CLI:
. Fixed bug GH-24697 (PHP_HTTP_PARSER_STRICT build option doesn't work).
@@@ -241,9 -259,22 +252,11 @@@
- DOM:
. Fixed a use-after-free when reflected attribute setters replace an
attribute whose child still has a live wrapper. (Jakub Zelenka)
- . Fixed bug GH-23352 (UAF reading an attribute value node retained across
- DOMDocument::adoptNode()). (David Carlier)
- . Fixed bug GH-24260 (querySelectorAll() returns duplicate elements for
- selector lists). (fivefilters)
- . Fixed bug GH-23334 (Use-after-free in php_dom_free_templated_content()).
- (David Carlier, ndossche)
- . Fixed bug GH-22077 (UAF in custom XPath function). (Joe Afflerbach)
- . Fixed bug GH-22554 (use-after-free with XPath callback returning a node
- from a foreign document). (David Carlier)
- . Fixed DOMXPath crash wrapping a foreign node after a nodeset callback.
- (Ilia Alshanetsky)
. Fix error paths in dom_xml_serializing_a_document_node(). (ndossche)
- . Fixed use-after-free on namespace axis results with a foreign-document
- XPath callback node. (David Carlier)
+ . Fixed bug GH-25118 (Dom\HTMLDocument::createFromString() crash on OOM).
+ (devnexen)
+ . Fixed GHSA-x8r7-mg3g-74hg (Double free during DOM XML serialization).
+ (CVE-2026-129501) (ndossche)
- FFI:
. Fixed bug GH-24582 (Memory leaks in ext/ffi parser when finalize_type()
@@@ -268,7 -294,15 +280,11 @@@
values. (Marcel Hernandez)
. Fixed null pointer dereference in fpm_get_status() when the scoreboard
copy fails. (Marcel Hernandez)
+ . Fixed GHSA-qc49-hpvq-g2w6 (PHP-FPM request smuggling through an unread HTTP
+ request body). (CVE-2026-129289) (Jakub Zelenka)
+ . Fixed GHSA-3mg3-cr28-46gc (PHP-FPM status endpoint XSS via unescaped user
+ and script fields). (CVE-2026-129292) (Jakub Zelenka)
-- Fileinfo:
- . Fixed bug GH-24289 (finfo::file() reports the wrong argument number for
- an invalid $filename). (Lazizbek Ergashev)
-
- FTP:
. Fix double free in ext/ftp data_accept() on accept failure. (alepacheco)
@@@ -460,12 -479,28 +478,22 @@@
. Fixed infinite loop in sapi_header_op() for headers of 4 GiB or more.
(Martin Mirchev)
+ - SOAP:
- . Fixed use of uninitialized func in do_request() on OOM bailout.
- (David Carlier)
+ . Fixed GHSA-q23r-hr55-xmpg (SOAP information disclosure through malformed
+ array dimensions). (CVE-2026-15353) (Alexandre Daubois)
+ . Fixed GHSA-4646-p932-gw34 (SOAP use-after-free when processing DTD entity
+ references). (CVE-2026-129506) (Jakub Zelenka)
+
- Session:
. Validate whole session ID instead of stopping at the first NUL byte.
(Sjoerd Langkemper)
- . Fixed session data loss in the files save handler when writing the session
- file fails after it was already truncated. (Ilia Alshanetsky)
+ . Fixed GHSA-fm2m-fjf5-v3cp (Partially overwritten session files can lead to
+ remote code execution). (CVE-2026-126714) (Ilija Tovilo)
+ . Fixed GHSA-658j-r8rw-q6mx (Session serializer mismatch can lead to remote
+ code execution). (CVE-2026-115560) (Arnaud Le Blanc)
+ . Fixed GHSA-g3vh-838c-65v7 (Use-after-free after interrupted session
+ shutdown). (CVE-2026-129481) (Arnaud Le Blanc, Jakub Zelenka)
-- SimpleXML:
- . Fixed bug GH-24488 (GC double-frees the SimpleXMLElement properties
- table). (evankford)
-
- SPL:
. Fixed bug GH-24264 (Unwind/GracefulExit discarded in spl_iterators.c).
(Lazizbek Ergashev)
@@@ -510,16 -551,11 +542,18 @@@
. Fixed tidy_repair_string(), tidy_repair_file(), tidy::repairString() and
tidy::repairFile() rejecting null for $encoding. (lacatoire)
+- URI:
+ . Fixed bug GH-25019 (Uri\Rfc3986\Uri rejects a port with leading zeros as
+ out of range). (lazerg)
+ . Upgrade to uriparser 1.0.3. (CVE-2026-48841) (Sebastian Pipping, timwolla)
++ . Fixed GHSA-mg3p-mxj9-g2mm (Incorrect RFC 3986 URI serialization for
++ oversized input). (CVE-2026-129438) (Tim Düsterhus, Alexandre Daubois)
+
- Windows:
- . Fixed sapi_windows_cp_set() and sapi_windows_cp_conv() accepting a negative
- codepage on 32bit platforms. (Marc Bennewitz)
. Fixed bug GH-25009 (GetConsoleTitleW() buffer size passed in bytes).
(Lazizbek Ergashev)
+ . Fixed sapi_windows_cp_set() and sapi_windows_cp_conv() accepting a negative
+ codepage on 32bit platforms. (Marc Bennewitz)
- Zip:
. Reject broken libzip versions 1.3.1, 1.7.0 and 1.12.0 during Windows
diff --cc ext/session/session.c
index eb5593c1b7e,ba59607dbc1..ed61613d871
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@@ -122,30 -125,12 +128,32 @@@ static inline void php_rinit_session_gl
PS(module_number) = my_module_number;
PS(in_rfc1867_update) = false;
ZVAL_UNDEF(&PS(http_session_vars));
+ PS(session_started_filename) = NULL;
+ PS(session_started_lineno) = 0;
}
-/* }}} */
-static inline void php_session_cleanup_filename(void) /* {{{ */
+static inline void php_session_headers_already_sent_error(int severity, const char *message) {
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
+ if (output_start_filename != NULL) {
+ php_error_docref(NULL, severity, "%s (sent from %s on line %d)", message, output_start_filename, output_start_lineno);
+ } else {
+ php_error_docref(NULL, severity, "%s", message);
+ }
+}
+
+static inline void php_session_session_already_started_error(int severity, const char *message) {
+ if (PS(session_started_filename) != NULL) {
+ php_error_docref(NULL, severity, "%s (started from %s on line %"PRIu32")", message, ZSTR_VAL(PS(session_started_filename)), PS(session_started_lineno));
+ } else if (PS(auto_start)) {
+ /* This option can't be changed at runtime, so we can assume it's because of this */
+ php_error_docref(NULL, severity, "%s (session started automatically)", message);
+ } else {
+ php_error_docref(NULL, severity, "%s", message);
+ }
+}
+
+static inline void php_session_cleanup_filename(void)
{
if (PS(session_started_filename)) {
zend_string_release(PS(session_started_filename));
@@@ -673,9 -676,11 +683,10 @@@ static PHP_INI_MH(OnUpdateSerializer
return SUCCESS;
}
-/* }}} */
-static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
+static PHP_INI_MH(OnUpdateSaveDir)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
@@@ -703,12 -708,14 +714,13 @@@
}
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
+ return OnUpdateStr(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
-/* }}} */
-static PHP_INI_MH(OnUpdateName) /* {{{ */
+static PHP_INI_MH(OnUpdateName)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
@@@ -734,12 -741,14 +746,13 @@@
return FAILURE;
}
- return OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
+ return OnUpdateStrNotEmpty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
-/* }}} */
-static PHP_INI_MH(OnUpdateCookieLifetime) /* {{{ */
+static PHP_INI_MH(OnUpdateCookieLifetime)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
@@@ -757,25 -766,32 +770,28 @@@
}
return OnUpdateLongGEZero(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
-/* }}} */
-static PHP_INI_MH(OnUpdateSessionLong) /* {{{ */
+static PHP_INI_MH(OnUpdateSessionLong)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
return OnUpdateLong(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
-/* }}} */
-
-static PHP_INI_MH(OnUpdateSessionString) /* {{{ */
+static PHP_INI_MH(OnUpdateSessionStr)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
+ return OnUpdateStr(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
-/* }}} */
-static PHP_INI_MH(OnUpdateSessionBool) /* {{{ */
+static PHP_INI_MH(OnUpdateSessionBool)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
@@@ -825,9 -845,11 +843,10 @@@ static PHP_INI_MH(OnUpdateSidBits
php_error_docref(NULL, E_WARNING, "session.configuration \"session.sid_bits_per_character\" must be between 4 and 6");
return FAILURE;
}
-/* }}} */
-static PHP_INI_MH(OnUpdateSessionGcProbability) /* {{{ */
+static PHP_INI_MH(OnUpdateSessionGcProbability)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
@@@ -843,9 -865,11 +862,10 @@@
return SUCCESS;
}
-/* }}} */
-static PHP_INI_MH(OnUpdateSessionDivisor) /* {{{ */
+static PHP_INI_MH(OnUpdateSessionDivisor)
{
+ SESSION_CHECK_UPLOAD_PROGRESS_STATE;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
diff --cc ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt
index 00000000000,1b39feeb1d0..ee2591f3716
mode 000000,100644..100644
--- a/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt
+++ b/ext/soap/tests/GHSA-q23r-hr55-xmpg-wsdl.phpt
@@@ -1,0 -1,80 +1,80 @@@
+ --TEST--
+ GHSA-q23r-hr55-xmpg: Unbounded array walk on empty wsdl:arraySize
+ --EXTENSIONS--
+ soap
+ --INI--
+ soap.wsdl_cache_enabled=0
+ --FILE--
+ <?php
+
+ const WSDL = __DIR__ . '/GHSA-q23r-hr55-xmpg-wsdl.wsdl';
+
+ function itemType() { return ['A', 'B', 'C']; }
+ function sizeOnly() { return ['A', 'B', 'C']; }
+
+ function request(string $operation): string {
+ 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 function __construct(public string $arrayType) {
+ parent::__construct(WSDL);
+ }
+
- public function __doRequest($request, $location, $action, $version, $oneWay = 0): ?string {
++ public function __doRequest($request, $location, $action, $version, $oneWay = false, ?string $uriParserClass = null): ?string {
+ 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(['itemType', 'sizeOnly']);
+
+ foreach (['itemType', 'sizeOnly'] as $operation) {
+ ob_start();
+ $server->handle(request($operation));
+ $response = ob_get_clean();
+
+ preg_match('/arraySize="[^"]*"/', $response, $matches);
+ echo 'encode ', $operation, ' => ', $matches[0] ?? 'none', "\n";
+ }
+
+ foreach (['ItemType', 'SizeOnly'] as $arrayType) {
+ $client = new ReplayClient($arrayType);
+ echo 'decode ', $arrayType, ' => ', json_encode($client->{lcfirst($arrayType)}()), "\n";
+ }
+
+ ?>
+ --EXPECT--
+ encode itemType => arraySize="3"
+ encode sizeOnly => arraySize="3"
+ decode ItemType => ["A","B","C"]
+ decode SizeOnly => ["A","B","C"]