Repository navigation
Zip getnameindex stat - #23511
Closed
devnexen wants to merge 2 commits into
Closed
Zip getnameindex stat#23511devnexen wants to merge 2 commits into
devnexen wants to merge 2 commits into
Conversation
The index was cast to int before being handed to zip_get_name(), whose parameter is a zip_uint64_t, so any value with a non-zero upper half wrapped and selected the wrong entry: getNameIndex(1 << 32) returned the name of entry 0 instead of false. Cast to zip_uint64_t instead, letting libzip reject out of range indices.
When zip_open() failed the whole stat block was skipped, yet the function still returned 0. fstat() on a zip:// stream therefore succeeded with the zeroed statbuf it was given, reporting a zero size and no file type bits, instead of failing. Return -1 on that path.
LamentXU123
approved these changes
Aug 30, 2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 20, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-separate-live-range.patch: CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch Origin: php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 20, 2026
Interim backports carried until the upstream branch has its own fix: - backport-zip-01-add-file-fd-leak.patch: php_zip_add_file() leaked the file it had opened for ZIP_FL_OPEN_FILE_NOW when zip_source_filep() failed (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 4c54dce (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-date-period.patch: DatePeriod::__construct() called again on the same object frees the start, current, end and interval of the first call instead of leaking them (phpGH-22643), and refuses a DateInterval, or a start or end date, that was not initialized by its constructor (a subclass that overrides it without calling the parent) instead of reading through a NULL pointer; unlike the 7.4 version it restores the error handling mode on that path, so that later warnings do not turn into exceptions. Origin: php-src commit bbb0272 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (07.07.2026, Ilija Tovilo), adapted to the PHP 5.6 object layout; the check of the start and end dates is added here (5.6 copies the start time with memcpy()); the test DatePeriod_uninitialized_interval.phpt of php-src commit 575c10c (25.10.2026, Jamal Tantaoui, the same fix in 7.4), with date.timezone for 5.6 - backport-disabled-class-properties.patch: a class in disable_classes: new on it gave an object without the table of its declared properties, and reading one of them crashed the process ($o = new CURLFile; $o->name; bug #77494); the table is made, empty, now. Only where php.ini of 5.6 has disable_classes Origin: php-src commit 73f222d (Dmitry Stogov, 24.01.2019, PHP 7.2.15), as Gentoo carries it for 5.6 (proj/php-patches, branch php5.6, 00100_bug77494.patch), with its test - backport-dns-empty-record.patch: CVE-2019-9022 (bug #77369): dns_get_record() took a DNS record with no data (its length 0) and read on with a negative length, a memcpy() past the buffer of the answer; such a record is skipped now. It needs a hostile DNS server or a forged answer Origin: php-src commit 8d3dfab (Stanislav Malyshev, 29.12.2018, PHP 7.1.26; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u12 of jessie LTS and its ELTS, debian/patches/CVE-2019-9022.patch) - backport-dns-res-ndestroy.patch: dns_get_record(), checkdnsrr() and getmxrr() leaked, on every call, the memory res_ninit() of the libc of FreeBSD allocates for the state of the resolver: php_dns.h of 5.6 ends that state with res_nclose(), which leaves it, and only res_ndestroy() frees it. Memory of the libc, outside memory_limit: a php-fpm worker or an Apache child grew until it was recycled. res_ndestroy() where the libc has it (a configure check), as PHP 7 does Origin: ext/standard/php_dns.h and config.m4 of PHP 7 (HAVE_RES_NDESTROY; Remi Collet's 7.4 branch, which our 7.4 to 8.4 have), the leak as pkgsrc fixes it for lang/php56 (patches/patch-ext_standard_php__dns.h: res_ndestroy() but on glibc) - backport-fileinfo-libmagic.patch: the libmagic 5.17 bundled in ext/fileinfo (finfo_file(), finfo_buffer(), mime_content_type() on uploaded files): the number of elements of a CDF vector (Office documents) without a limit (CVE-2019-18218: no overflow in the copy of PHP, but memory without a bound), and the fixes of file 5.30 and 5.31 for crafted files found by OSS-Fuzz: a read past the buffer when comparing with compacted whitespace (softmagic.c), PR/599, a read past the end of a CDF string vector, is_tar() rewritten without signed counters and a strcmp() of an unterminated field, the property info of a bad CDF freed and its pointer cleared on the error (a double free of its callers), a field that could not be read set to 0, the sectors of a CDF limited further Origin: Debian php5 5.6.40+dfsg-0+deb8u12 (jessie LTS and its ELTS), debian/patches/not-cve-but-bug-CVE-2019-18218.patch (the limit of file 5.38, Christos Zoulas, PHP 7.2.24); file commits FILE5_30-12-g77a7041f, FILE5_30-18-g4e4e7609, FILE5_30-19-g7605984c, FILE5_30-30-gc703aa9f, FILE5_30-38-gfd42e119, FILE5_30-39-geb973428 (Christos Zoulas, March and April 2017), as Debian carries them on file 5.30 (1:5.30-1+deb9u3, stretch LTS and its ELTS), the paths src/ as ext/fileinfo/libmagic/ and the free of the error path of cdf_read_property_info() on the code of 5.17, which frees there already - backport-gd-gif-lzw.patch: CVE-2026-9672: the GIF LZW decoder of the bundled libgd (imagecreatefromgif()) clears every entry of its code table on a clear code (it cleared table[1][0] over and over and left the other entries stale), stops at the end code instead of decoding on with a stale code, and starts from a zeroed state, so that a crafted GIF cannot make it read uninitialized memory. Origin: php-src commit e9413a5 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (28.07.2026, libgd fix fcd691b by Pierre Joye), applies to 5.6 as it is - backport-getimagesize.patch: GHSA-3237-qqm7-mfv7 (CVE-2025-14177): getimagesize() reads an APPn segment of a JPEG from a stream in chunks until it has the whole segment, instead of handing back in $imageinfo a buffer that a short read left partly uninitialized (a leak of process memory). Origin: php-src commit 6cf0fb3 (phpGH-20584, 25.11.2025, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; on Remi's 5.6 branch f98c3c2 (17.11.2026), which already refuses a short read (!= length): the chunked read of upstream replaces that check - backport-http-redirects.patch: phpGH-11274: 307 and 308 redirects of the http:// stream wrapper keep the method (POST, PATCH) and the body, as RFC 7231 and RFC 7538 require, on the GHSA-fpwc-w8rq-cr92 fix of Remi's branch (its HTTP_WRAPPER_STRIP_AUTH and same-origin check, which this patch carried before; f98c3c2 of 17.11.2026, which follows a 307 with GET). The fixes of 7.4 for an empty and a 1-character Location (phpGH-23467, phpGH-23521) do not apply: 5.6 does not follow an empty Location and reads it from a fixed-size buffer. Origin: php-src commit c812ca1 (phpGH-11274, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; the GHSA-fpwc-w8rq-cr92 part of dc1f36a is in Remi's 5.6 branch - backport-http-response-headers.patch: GHSA-v8xr-gpvj-cx9g (CVE-2025-1217), GHSA-pcmh-g36c-qc44 (CVE-2025-1734) and GHSA-52jp-hrpf-2jff (CVE-2025-1861) for PHP 5.6: the http:// stream wrapper reads the response headers as PHP 7.4 and later do: a folded header (a line that starts with a space or a tab) is joined to the header before it, a header line without a colon, with a space in the header name, starting with a CR or folded before the first header fails the request, a Location header is followed with up to 8182 bytes (5.6 cut it at 1024 bytes) and fails the request when longer; with the bounds fixes of phpGH-23467 (CVE-2026-93682) and phpGH-23521 for a relative Location, merged with Remi's own (an empty path becomes /). An empty Location header is not followed, as before in 5.6 (7.4 and later go to /). GHSA-hgf5-96fm-v528 (CVE-2025-1736), the user's Authorization or Proxy-Authorization header seen only at the start of a header line, is in Remi's branch (c0bc944, 14.02.2025): its check_has_header() gets the bound of ours, no read before the start of the header bag Origin: port of php-src commits bf4a8df (31.12.2024), 0b965cf (19.01.2025), 134f821 (14.02.2025) and 5418040 (04.03.2025, all Jakub Zelenka), f489702 (24.08.2026, Ilia Alshanetsky) and bd7e19b (31.08.2026, Jordi Kroon) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with their tests and bug47021.phpt and bug75535.phpt of that branch (5.6 had neither), and ext/standard/tests/http/ServerClientTestCase.inc of that branch without the type declarations PHP 5 does not have; the ghsa-hgf5 tests read the request up to its empty line, as 5.6 sends it in several writes; http_empty_location_no_redirect.phpt is ours; on Remi's 5.6 branch f98c3c2 (17.11.2026) - backport-mysqlnd-free-result.patch: mysqlnd: $stmt->free_result() of a prepared statement after the connection was closed set the state of the closed connection back to ready, and the $stmt->close() after it crashed the process (bug #69899); the state is kept when the connection is closed now Origin: php-src commit bd75f9e (Richard Fussenegger, 30.09.2016, PHP 7.0.13; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u22, debian/patches/0118-Fix-bug-69899.patch), with its test - backport-mysqlnd-overread.patch: GHSA-r6x9-5r99-36j7 (the 2026 partial fix) for PHP 5.6, on top of the GHSA-h35g-vwh6-m678 (CVE-2024-8929) fix that Remi's 5.6 branch now has: a hostile or man-in-the-middle MySQL server could still make the mysqlnd client read past the end of a received packet and leak heap bytes into PHP-visible values. php_mysqlnd_net_field_length() takes the bytes left in the packet and returns MYSQLND_INVALID_NET_FIELD_LENGTH when a length-encoded integer would read past them, php_mysqlnd_net_field_length_ll() returns an optional value that the callers check, and every packet reader checks the bytes left before a read (BAIL_IF_NOT_ENOUGH_DATA_EX) instead of after it (BAIL_IF_NO_MORE_DATA): greeting (server version and plugin name found with memchr, both scramble parts bounded), auth response and change-user (the auth switch plugin name found with memchr), OK, EOF, result-set header, column definition (name lengths and the fixed block), prepare response and sha256 public key; the "shorter than expected" warnings no longer print a byte count computed past the packet. The EOF of a text row needs its 4 status bytes, the prepared-statement value decoders give the length decoder the bytes left in the row and reject a length it cannot read, the BIT value of a text row is bounded by the space reserved from the column length, and the prepared-statement EOF reset releases the connection reference and the command buffer before its memset. Every check of the branch stays (the h35g fix with its auth_protocol and binary row follow-ups, the minimum lengths of temporal fields, the OK message past the packet body); only its OK length-prefix check is done by the bounded length decoder now. 31 tests for the fake MySQL server of the branch: ext/mysqli/tests/fake_server.inc gains the packets they need and starts the server with exec, so that proc_terminate() stops the server and not only the shell. Origin: azsupport, port of php-src commit 2af14de (Partial Fix GHSA-r6x9-5r99-36j7, Jakub Zelenka and Nora Dossche, 12.07.2026) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), rebuilt on Remi's 5.6 branch f98c3c2 (17.11.2026), which has the GHSA-h35g-vwh6-m678 fix (dae0e5c, a cherry-pick of php-src 2f5aa9f, with ec0107a) and Ondřej Surý's 5.6 follow-ups c3279aa, 7a82a61 and f10baba; of our earlier port of 2f5aa9f, only what the branch lacks is kept - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0199-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), without its whitespace changes; its test with the SKIPIF of 5.6 (an online test, skipped with SKIP_ONLINE_TESTS) - backport-unsigned-char-ctype.patch: GHSA-m8rr-4c36-8gq4 (CVE-2026-7258): every char handed to a ctype.h function (isalpha(), isdigit(), isspace(), tolower(), toupper() and the others) is cast to unsigned char: a byte of 0x80 and above made a negative argument, which the C standard leaves undefined and some C libraries use as an index before their table (FreeBSD and glibc check or allow it). The places of 7.4 that 5.6 does not have are left out. Origin: port of php-src commits b44c4c8 (03.05.2026, Ilija Tovilo) and 2c4b0c4 (25.10.2026: the -d value check of the CLI, CGI, FPM and phpdbg SAPIs) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports); in 5.6 also in ext/gd/libgd/xbm.c (gd_xbm.c in 7.4) and in the files that re2c made from the changed .re files - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php56 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 5.6) - backport-xml-toffset-test.patch: GHSA-wg4p-4hqh-c3g9 (a recurrence of bug #72714 in xml_parse_into_struct() with XML_OPTION_SKIP_TAGSTART): the test only; 5.6 is not affected, as it passes the tag name to _xml_add_to_info() through SKIP_TAGSTART(), which bounds the offset. Origin: the test of php-src commit c5e836c (18.12.2024, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); brought onto 5.6 by hand: the deprecated zip_set_file_comment() calls of PHP_ZIP_SET_FILE_COMMENT replaced by php_zip_set_file_comment() on zip_file_get_comment() and zip_file_set_comment(); its tests not taken (PHP 7 and later) Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); brought onto 5.6 by hand (its safe_emalloc() buffer, n zip_int64_t); its tests not taken (PHP 7 and later) Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); brought onto 5.6 by hand, with the HashPosition iteration of PHP 5; its tests not taken (PHP 7 and later) Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); brought onto 5.6 by hand (its strncpy() copy before the open_basedir check); its tests not taken (PHP 7 and later) Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zip-empty-file.patch: ZipArchive::open() of an existing empty file (one of tempnam(), say) without ZipArchive::OVERWRITE failed with "Not a zip archive" with libzip 1.6.0 and later, which no longer take an empty file for an empty archive (bug #79296): the modules of 5.6 are built with the libzip of az (1.12); such a file is opened as with ZipArchive::OVERWRITE now, as PHP 7.3 and later do. Nothing changes with the libzip bundled in PHP (0.11) Origin: php-src commit 8aab43c (Remi Collet, 19.03.2020, PHP 7.3.17), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0146-Fix-Bug-79296-ZipArchive-open-fails-on-empty-file.patch); the version of libzip checked when building (that of az, linked dynamically) - backport-zz-GHSA-658j-r8rw-q6mx.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): session.upload_progress.enabled is off by default; for 5.6: the default off, rfc1867_enabled reset in GINIT, the guard (a warning and FAILURE, as the other checks of 5.6) in the INI handlers of 5.6 that set the save handler, the serializer, the save path, the name and the hash function, and in OnUpdateSessionLong, OnUpdateSessionString and OnUpdateSessionBool, wrappers of the standard handlers that the long, string and boolean settings of the session take here as in PHP 7.2 and later (gc_*, cookie_*, use_cookies, use_only_cookies, use_strict_mode, referer_check, entropy_*, cache_*, hash_bits_per_character), as the fix guards those; session.auto_start (PHP_INI_PERDIR), use_trans_sid and upload_progress.* not, as there; its tests not taken The default off and the reset of rfc1867_enabled in GINIT are in Remi's branch (f98c3c2, 17.11.2026); this patch adds the guard. Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36) - backport-zz-GHSA-mmf9-xm3v-hg2x.patch: GHSA-mmf9-xm3v-hg2x (CVE-2026-127960, the PHP security release of 19.11.2026): quadratic folded header concatenation; for 5.6: the folded line appended in place to the last header line, in a buffer that grows by doubling (the folding code of 5.6 is ours, on char * without smart_str) Origin: php-src commit a303f69 (Jakub Zelenka, 06.10.2026, PHP 8.2.36) - backport-zz-phar-openssl-sign.patch: phar of 5.6 with openssl a shared module: Phar::setSignatureAlgorithm(Phar::OPENSSL) of a zip-based phar now and then left the archive signed as before (SHA-1), with no error. phar_call_openssl_signverify() read the result of openssl_sign() after efree() of its zval, so whatever the allocator wrote over it decided whether the signature failed; and phar_zip_flush() dropped the error of phar_zip_applysignature(), so the failed flush kept the file of the flush before and reported nothing. The result is read before the zval is freed (in PHP 7.0 and later it is on the stack), and the zip flush gives the error of the signature to its caller, as PHP 8 does (php-src master, ext/phar/zip.c; PHP 7.4 still drops it) Origin: ours, from the GHSA-68fq-fh7h-f8gr check of a zip-based phar in the tests of the packages of azsupport/ports (run 44798851154, 20.11.2026: the archive signed with OpenSSL came out signed with SHA-1)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 7.4 (php7.4 7.4.33-31, debian/patches/0051-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), with its test (the SKIPIF of 7.4; an online test, skipped with SKIP_ONLINE_TESTS) - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 7.4) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); 0 for false (7.4 has no stdbool); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto php_zip_get_from() of 7.4 by hand; its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); zend_bool and 1 (7.4 has no stdbool); its test with locateName() for the lastId of PHP 8; its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); the switch of extractTo() of 7.4, php_zip_extract_file() has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix of this branch (00922d4) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only; for 7.4 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 7.4 can be a module of its own, which FPM cannot call; 20.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch) Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-gd-font-uninitialized.patch: gd: imagefontwidth(), imagefontheight(), imagestring(), imagestringup(), imagechar() and imagecharup() with a font of imageloadfont() (a GdFont object) left the integer of the font uninitialised, which the font of the object was looked up with too: undefined behaviour, a wrong font with clang 14 and later at -Os (phpGH-13082); both initialised now Origin: php-src commits 1e464e5 and df85c25 (Niels Dossche, 09.01.2024 and 13.01.2024, PHP 8.2.15), as MacPorts carries them for php81 (lang/php/files/patch-php81-ext-gd.diff); their test needs a binary font file, which a patch cannot carry: left out - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 8.1) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); brought onto getStream() and php_stream_zip_open() of 8.1, which has no getStreamIndex() and getStreamName(); its test with getStream() only; its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern(), the callback registration and the stream opener of 8.1 by hand (8.1 has no clearError()); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() has no index argument here; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); the guard of getStream() of 8.1; its test without getStreamIndex() and getStreamName(); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch), with its test Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-separate-live-range.patch: CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch Origin: php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-zip-01-add-file-fd-leak.patch: php_zip_add_file() leaked the file it had opened for ZIP_FL_OPEN_FILE_NOW when zip_source_filep() failed (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 4c54dce (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-date-period.patch: DatePeriod::__construct() called again on the same object frees the start, current, end and interval of the first call instead of leaking them (phpGH-22643), and refuses a DateInterval, or a start or end date, that was not initialized by its constructor (a subclass that overrides it without calling the parent) instead of reading through a NULL pointer; unlike the 7.4 version it restores the error handling mode on that path, so that later warnings do not turn into exceptions. Origin: php-src commit bbb0272 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (07.07.2026, Ilija Tovilo), adapted to the PHP 5.6 object layout; the check of the start and end dates is added here (5.6 copies the start time with memcpy()); the test DatePeriod_uninitialized_interval.phpt of php-src commit 575c10c (25.10.2026, Jamal Tantaoui, the same fix in 7.4), with date.timezone for 5.6 - backport-disabled-class-properties.patch: a class in disable_classes: new on it gave an object without the table of its declared properties, and reading one of them crashed the process ($o = new CURLFile; $o->name; bug #77494); the table is made, empty, now. Only where php.ini of 5.6 has disable_classes Origin: php-src commit 73f222d (Dmitry Stogov, 24.01.2019, PHP 7.2.15), as Gentoo carries it for 5.6 (proj/php-patches, branch php5.6, 00100_bug77494.patch), with its test - backport-dns-empty-record.patch: CVE-2019-9022 (bug #77369): dns_get_record() took a DNS record with no data (its length 0) and read on with a negative length, a memcpy() past the buffer of the answer; such a record is skipped now. It needs a hostile DNS server or a forged answer Origin: php-src commit 8d3dfab (Stanislav Malyshev, 29.12.2018, PHP 7.1.26; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u12 of jessie LTS and its ELTS, debian/patches/CVE-2019-9022.patch) - backport-dns-res-ndestroy.patch: dns_get_record(), checkdnsrr() and getmxrr() leaked, on every call, the memory res_ninit() of the libc of FreeBSD allocates for the state of the resolver: php_dns.h of 5.6 ends that state with res_nclose(), which leaves it, and only res_ndestroy() frees it. Memory of the libc, outside memory_limit: a php-fpm worker or an Apache child grew until it was recycled. res_ndestroy() where the libc has it (a configure check), as PHP 7 does Origin: ext/standard/php_dns.h and config.m4 of PHP 7 (HAVE_RES_NDESTROY; Remi Collet's 7.4 branch, which our 7.4 to 8.4 have), the leak as pkgsrc fixes it for lang/php56 (patches/patch-ext_standard_php__dns.h: res_ndestroy() but on glibc) - backport-fileinfo-libmagic.patch: the libmagic 5.17 bundled in ext/fileinfo (finfo_file(), finfo_buffer(), mime_content_type() on uploaded files): the number of elements of a CDF vector (Office documents) without a limit (CVE-2019-18218: no overflow in the copy of PHP, but memory without a bound), and the fixes of file 5.30 and 5.31 for crafted files found by OSS-Fuzz: a read past the buffer when comparing with compacted whitespace (softmagic.c), PR/599, a read past the end of a CDF string vector, is_tar() rewritten without signed counters and a strcmp() of an unterminated field, the property info of a bad CDF freed and its pointer cleared on the error (a double free of its callers), a field that could not be read set to 0, the sectors of a CDF limited further Origin: Debian php5 5.6.40+dfsg-0+deb8u12 (jessie LTS and its ELTS), debian/patches/not-cve-but-bug-CVE-2019-18218.patch (the limit of file 5.38, Christos Zoulas, PHP 7.2.24); file commits FILE5_30-12-g77a7041f, FILE5_30-18-g4e4e7609, FILE5_30-19-g7605984c, FILE5_30-30-gc703aa9f, FILE5_30-38-gfd42e119, FILE5_30-39-geb973428 (Christos Zoulas, March and April 2017), as Debian carries them on file 5.30 (1:5.30-1+deb9u3, stretch LTS and its ELTS), the paths src/ as ext/fileinfo/libmagic/ and the free of the error path of cdf_read_property_info() on the code of 5.17, which frees there already - backport-gd-gif-lzw.patch: CVE-2026-9672: the GIF LZW decoder of the bundled libgd (imagecreatefromgif()) clears every entry of its code table on a clear code (it cleared table[1][0] over and over and left the other entries stale), stops at the end code instead of decoding on with a stale code, and starts from a zeroed state, so that a crafted GIF cannot make it read uninitialized memory. Origin: php-src commit e9413a5 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (28.07.2026, libgd fix fcd691b by Pierre Joye), applies to 5.6 as it is - backport-getimagesize.patch: GHSA-3237-qqm7-mfv7 (CVE-2025-14177): getimagesize() reads an APPn segment of a JPEG from a stream in chunks until it has the whole segment, instead of handing back in $imageinfo a buffer that a short read left partly uninitialized (a leak of process memory). Origin: php-src commit 6cf0fb3 (phpGH-20584, 25.11.2025, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; on Remi's 5.6 branch f98c3c2 (17.11.2026), which already refuses a short read (!= length): the chunked read of upstream replaces that check - backport-http-redirects.patch: phpGH-11274: 307 and 308 redirects of the http:// stream wrapper keep the method (POST, PATCH) and the body, as RFC 7231 and RFC 7538 require, on the GHSA-fpwc-w8rq-cr92 fix of Remi's branch (its HTTP_WRAPPER_STRIP_AUTH and same-origin check, which this patch carried before; f98c3c2 of 17.11.2026, which follows a 307 with GET). The fixes of 7.4 for an empty and a 1-character Location (phpGH-23467, phpGH-23521) do not apply: 5.6 does not follow an empty Location and reads it from a fixed-size buffer. Origin: php-src commit c812ca1 (phpGH-11274, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; the GHSA-fpwc-w8rq-cr92 part of dc1f36a is in Remi's 5.6 branch - backport-http-response-headers.patch: GHSA-v8xr-gpvj-cx9g (CVE-2025-1217), GHSA-pcmh-g36c-qc44 (CVE-2025-1734) and GHSA-52jp-hrpf-2jff (CVE-2025-1861) for PHP 5.6: the http:// stream wrapper reads the response headers as PHP 7.4 and later do: a folded header (a line that starts with a space or a tab) is joined to the header before it, a header line without a colon, with a space in the header name, starting with a CR or folded before the first header fails the request, a Location header is followed with up to 8182 bytes (5.6 cut it at 1024 bytes) and fails the request when longer; with the bounds fixes of phpGH-23467 (CVE-2026-93682) and phpGH-23521 for a relative Location, merged with Remi's own (an empty path becomes /). An empty Location header is not followed, as before in 5.6 (7.4 and later go to /). GHSA-hgf5-96fm-v528 (CVE-2025-1736), the user's Authorization or Proxy-Authorization header seen only at the start of a header line, is in Remi's branch (c0bc944, 14.02.2025): its check_has_header() gets the bound of ours, no read before the start of the header bag Origin: port of php-src commits bf4a8df (31.12.2024), 0b965cf (19.01.2025), 134f821 (14.02.2025) and 5418040 (04.03.2025, all Jakub Zelenka), f489702 (24.08.2026, Ilia Alshanetsky) and bd7e19b (31.08.2026, Jordi Kroon) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with their tests and bug47021.phpt and bug75535.phpt of that branch (5.6 had neither), and ext/standard/tests/http/ServerClientTestCase.inc of that branch without the type declarations PHP 5 does not have; the ghsa-hgf5 tests read the request up to its empty line, as 5.6 sends it in several writes; http_empty_location_no_redirect.phpt is ours; on Remi's 5.6 branch f98c3c2 (17.11.2026) - backport-mysqlnd-free-result.patch: mysqlnd: $stmt->free_result() of a prepared statement after the connection was closed set the state of the closed connection back to ready, and the $stmt->close() after it crashed the process (bug #69899); the state is kept when the connection is closed now Origin: php-src commit bd75f9e (Richard Fussenegger, 30.09.2016, PHP 7.0.13; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u22, debian/patches/0118-Fix-bug-69899.patch), with its test - backport-mysqlnd-overread.patch: GHSA-r6x9-5r99-36j7 (the 2026 partial fix) for PHP 5.6, on top of the GHSA-h35g-vwh6-m678 (CVE-2024-8929) fix that Remi's 5.6 branch now has: a hostile or man-in-the-middle MySQL server could still make the mysqlnd client read past the end of a received packet and leak heap bytes into PHP-visible values. php_mysqlnd_net_field_length() takes the bytes left in the packet and returns MYSQLND_INVALID_NET_FIELD_LENGTH when a length-encoded integer would read past them, php_mysqlnd_net_field_length_ll() returns an optional value that the callers check, and every packet reader checks the bytes left before a read (BAIL_IF_NOT_ENOUGH_DATA_EX) instead of after it (BAIL_IF_NO_MORE_DATA): greeting (server version and plugin name found with memchr, both scramble parts bounded), auth response and change-user (the auth switch plugin name found with memchr), OK, EOF, result-set header, column definition (name lengths and the fixed block), prepare response and sha256 public key; the "shorter than expected" warnings no longer print a byte count computed past the packet. The EOF of a text row needs its 4 status bytes, the prepared-statement value decoders give the length decoder the bytes left in the row and reject a length it cannot read, the BIT value of a text row is bounded by the space reserved from the column length, and the prepared-statement EOF reset releases the connection reference and the command buffer before its memset. Every check of the branch stays (the h35g fix with its auth_protocol and binary row follow-ups, the minimum lengths of temporal fields, the OK message past the packet body); only its OK length-prefix check is done by the bounded length decoder now. 31 tests for the fake MySQL server of the branch: ext/mysqli/tests/fake_server.inc gains the packets they need and starts the server with exec, so that proc_terminate() stops the server and not only the shell. Origin: azsupport, port of php-src commit 2af14de (Partial Fix GHSA-r6x9-5r99-36j7, Jakub Zelenka and Nora Dossche, 12.07.2026) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), rebuilt on Remi's 5.6 branch f98c3c2 (17.11.2026), which has the GHSA-h35g-vwh6-m678 fix (dae0e5c, a cherry-pick of php-src 2f5aa9f, with ec0107a) and Ondřej Surý's 5.6 follow-ups c3279aa, 7a82a61 and f10baba; of our earlier port of 2f5aa9f, only what the branch lacks is kept - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0199-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), without its whitespace changes; its test with the SKIPIF of 5.6 (an online test, skipped with SKIP_ONLINE_TESTS) - backport-unsigned-char-ctype.patch: GHSA-m8rr-4c36-8gq4 (CVE-2026-7258): every char handed to a ctype.h function (isalpha(), isdigit(), isspace(), tolower(), toupper() and the others) is cast to unsigned char: a byte of 0x80 and above made a negative argument, which the C standard leaves undefined and some C libraries use as an index before their table (FreeBSD and glibc check or allow it). The places of 7.4 that 5.6 does not have are left out. Origin: port of php-src commits b44c4c8 (03.05.2026, Ilija Tovilo) and 2c4b0c4 (25.10.2026: the -d value check of the CLI, CGI, FPM and phpdbg SAPIs) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports); in 5.6 also in ext/gd/libgd/xbm.c (gd_xbm.c in 7.4) and in the files that re2c made from the changed .re files - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php56 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 5.6) - backport-xml-toffset-test.patch: GHSA-wg4p-4hqh-c3g9 (a recurrence of bug #72714 in xml_parse_into_struct() with XML_OPTION_SKIP_TAGSTART): the test only; 5.6 is not affected, as it passes the tag name to _xml_add_to_info() through SKIP_TAGSTART(), which bounds the offset. Origin: the test of php-src commit c5e836c (18.12.2024, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); brought onto 5.6 by hand: the deprecated zip_set_file_comment() calls of PHP_ZIP_SET_FILE_COMMENT replaced by php_zip_set_file_comment() on zip_file_get_comment() and zip_file_set_comment(); its tests not taken (PHP 7 and later) Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); brought onto 5.6 by hand (its safe_emalloc() buffer, n zip_int64_t); its tests not taken (PHP 7 and later) Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); brought onto 5.6 by hand, with the HashPosition iteration of PHP 5; its tests not taken (PHP 7 and later) Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); brought onto 5.6 by hand (its strncpy() copy before the open_basedir check); its tests not taken (PHP 7 and later) Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zip-18-bug70322-test.patch: bug70322.phpt (ZipArchive::close() returns false and warns when a file it was to add is gone): the warning is "<the message of libzip>: No such file or directory", which libzip 1.6 and later word otherwise than "Read error" (the test failed with libzip 1.7.3, with and without the zip backports; az has libzip 1.12.1); the expectation of PHP 7.4, %s for the message of libzip Origin: ext/zip/tests/bug70322.phpt of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-empty-file.patch: ZipArchive::open() of an existing empty file (one of tempnam(), say) without ZipArchive::OVERWRITE failed with "Not a zip archive" with libzip 1.6.0 and later, which no longer take an empty file for an empty archive (bug #79296): the modules of 5.6 are built with the libzip of az (1.12); such a file is opened as with ZipArchive::OVERWRITE now, as PHP 7.3 and later do. Nothing changes with the libzip bundled in PHP (0.11) Origin: php-src commit 8aab43c (Remi Collet, 19.03.2020, PHP 7.3.17), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0146-Fix-Bug-79296-ZipArchive-open-fails-on-empty-file.patch); the version of libzip checked when building (that of az, linked dynamically) - backport-zz-GHSA-658j-r8rw-q6mx.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): session.upload_progress.enabled is off by default; for 5.6: the default off, rfc1867_enabled reset in GINIT, the guard (a warning and FAILURE, as the other checks of 5.6) in the INI handlers of 5.6 that set the save handler, the serializer, the save path, the name and the hash function, and in OnUpdateSessionLong, OnUpdateSessionString and OnUpdateSessionBool, wrappers of the standard handlers that the long, string and boolean settings of the session take here as in PHP 7.2 and later (gc_*, cookie_*, use_cookies, use_only_cookies, use_strict_mode, referer_check, entropy_*, cache_*, hash_bits_per_character), as the fix guards those; session.auto_start (PHP_INI_PERDIR), use_trans_sid and upload_progress.* not, as there; its tests not taken The default off and the reset of rfc1867_enabled in GINIT are in Remi's branch (f98c3c2, 17.11.2026); this patch adds the guard. Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36) - backport-zz-GHSA-mmf9-xm3v-hg2x.patch: GHSA-mmf9-xm3v-hg2x (CVE-2026-127960, the PHP security release of 19.11.2026): quadratic folded header concatenation; for 5.6: the folded line appended in place to the last header line, in a buffer that grows by doubling (the folding code of 5.6 is ours, on char * without smart_str) Origin: php-src commit a303f69 (Jakub Zelenka, 06.10.2026, PHP 8.2.36) - backport-zz-phar-openssl-sign.patch: phar of 5.6 with openssl a shared module: Phar::setSignatureAlgorithm(Phar::OPENSSL) of a zip-based phar now and then left the archive signed as before (SHA-1), with no error. phar_call_openssl_signverify() read the result of openssl_sign() after efree() of its zval, so whatever the allocator wrote over it decided whether the signature failed; and phar_zip_flush() dropped the error of phar_zip_applysignature(), so the failed flush kept the file of the flush before and reported nothing. The result is read before the zval is freed (in PHP 7.0 and later it is on the stack), and the zip flush gives the error of the signature to its caller, as PHP 8 does (php-src master, ext/phar/zip.c; PHP 7.4 still drops it) Origin: ours, from the GHSA-68fq-fh7h-f8gr check of a zip-based phar in the tests of the packages of azsupport/ports (run 44798851154, 20.11.2026: the archive signed with OpenSSL came out signed with SHA-1)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 21, 2026
Interim backports carried until the upstream branch has its own fix: - backport-date-period.patch: DatePeriod::__construct() called again on the same object frees the start, current, end and interval of the first call instead of leaking them (phpGH-22643), and refuses a DateInterval, or a start or end date, that was not initialized by its constructor (a subclass that overrides it without calling the parent) instead of reading through a NULL pointer; unlike the 7.4 version it restores the error handling mode on that path, so that later warnings do not turn into exceptions. Origin: php-src commit bbb0272 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (07.07.2026, Ilija Tovilo), adapted to the PHP 5.6 object layout; the check of the start and end dates is added here (5.6 copies the start time with memcpy()); the test DatePeriod_uninitialized_interval.phpt of php-src commit 575c10c (25.10.2026, Jamal Tantaoui, the same fix in 7.4), with date.timezone for 5.6 - backport-disabled-class-properties.patch: a class in disable_classes: new on it gave an object without the table of its declared properties, and reading one of them crashed the process ($o = new CURLFile; $o->name; bug #77494); the table is made, empty, now. Only where php.ini of 5.6 has disable_classes Origin: php-src commit 73f222d (Dmitry Stogov, 24.01.2019, PHP 7.2.15), as Gentoo carries it for 5.6 (proj/php-patches, branch php5.6, 00100_bug77494.patch), with its test - backport-dns-empty-record.patch: CVE-2019-9022 (bug #77369): dns_get_record() took a DNS record with no data (its length 0) and read on with a negative length, a memcpy() past the buffer of the answer; such a record is skipped now. It needs a hostile DNS server or a forged answer Origin: php-src commit 8d3dfab (Stanislav Malyshev, 29.12.2018, PHP 7.1.26; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u12 of jessie LTS and its ELTS, debian/patches/CVE-2019-9022.patch) - backport-dns-res-ndestroy.patch: dns_get_record(), checkdnsrr() and getmxrr() leaked, on every call, the memory res_ninit() of the libc of FreeBSD allocates for the state of the resolver: php_dns.h of 5.6 ends that state with res_nclose(), which leaves it, and only res_ndestroy() frees it. Memory of the libc, outside memory_limit: a php-fpm worker or an Apache child grew until it was recycled. res_ndestroy() where the libc has it (a configure check), as PHP 7 does Origin: ext/standard/php_dns.h and config.m4 of PHP 7 (HAVE_RES_NDESTROY; Remi Collet's 7.4 branch, which our 7.4 to 8.4 have), the leak as pkgsrc fixes it for lang/php56 (patches/patch-ext_standard_php__dns.h: res_ndestroy() but on glibc) - backport-fileinfo-libmagic.patch: the libmagic 5.17 bundled in ext/fileinfo (finfo_file(), finfo_buffer(), mime_content_type() on uploaded files): the number of elements of a CDF vector (Office documents) without a limit (CVE-2019-18218: no overflow in the copy of PHP, but memory without a bound), and the fixes of file 5.30 and 5.31 for crafted files found by OSS-Fuzz: a read past the buffer when comparing with compacted whitespace (softmagic.c), PR/599, a read past the end of a CDF string vector, is_tar() rewritten without signed counters and a strcmp() of an unterminated field, the property info of a bad CDF freed and its pointer cleared on the error (a double free of its callers), a field that could not be read set to 0, the sectors of a CDF limited further Origin: Debian php5 5.6.40+dfsg-0+deb8u12 (jessie LTS and its ELTS), debian/patches/not-cve-but-bug-CVE-2019-18218.patch (the limit of file 5.38, Christos Zoulas, PHP 7.2.24); file commits FILE5_30-12-g77a7041f, FILE5_30-18-g4e4e7609, FILE5_30-19-g7605984c, FILE5_30-30-gc703aa9f, FILE5_30-38-gfd42e119, FILE5_30-39-geb973428 (Christos Zoulas, March and April 2017), as Debian carries them on file 5.30 (1:5.30-1+deb9u3, stretch LTS and its ELTS), the paths src/ as ext/fileinfo/libmagic/ and the free of the error path of cdf_read_property_info() on the code of 5.17, which frees there already - backport-gd-gif-lzw.patch: CVE-2026-9672: the GIF LZW decoder of the bundled libgd (imagecreatefromgif()) clears every entry of its code table on a clear code (it cleared table[1][0] over and over and left the other entries stale), stops at the end code instead of decoding on with a stale code, and starts from a zeroed state, so that a crafted GIF cannot make it read uninitialized memory. Origin: php-src commit e9413a5 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (28.07.2026, libgd fix fcd691b by Pierre Joye), applies to 5.6 as it is - backport-getimagesize.patch: GHSA-3237-qqm7-mfv7 (CVE-2025-14177): getimagesize() reads an APPn segment of a JPEG from a stream in chunks until it has the whole segment, instead of handing back in $imageinfo a buffer that a short read left partly uninitialized (a leak of process memory). Origin: php-src commit 6cf0fb3 (phpGH-20584, 25.11.2025, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; on Remi's 5.6 branch f98c3c2 (17.11.2026), which already refuses a short read (!= length): the chunked read of upstream replaces that check - backport-http-redirects.patch: phpGH-11274: 307 and 308 redirects of the http:// stream wrapper keep the method (POST, PATCH) and the body, as RFC 7231 and RFC 7538 require, on the GHSA-fpwc-w8rq-cr92 fix of Remi's branch (its HTTP_WRAPPER_STRIP_AUTH and same-origin check, which this patch carried before; f98c3c2 of 17.11.2026, which follows a 307 with GET). The fixes of 7.4 for an empty and a 1-character Location (phpGH-23467, phpGH-23521) do not apply: 5.6 does not follow an empty Location and reads it from a fixed-size buffer. Origin: php-src commit c812ca1 (phpGH-11274, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; the GHSA-fpwc-w8rq-cr92 part of dc1f36a is in Remi's 5.6 branch - backport-http-response-headers.patch: GHSA-v8xr-gpvj-cx9g (CVE-2025-1217), GHSA-pcmh-g36c-qc44 (CVE-2025-1734) and GHSA-52jp-hrpf-2jff (CVE-2025-1861) for PHP 5.6: the http:// stream wrapper reads the response headers as PHP 7.4 and later do: a folded header (a line that starts with a space or a tab) is joined to the header before it, a header line without a colon, with a space in the header name, starting with a CR or folded before the first header fails the request, a Location header is followed with up to 8182 bytes (5.6 cut it at 1024 bytes) and fails the request when longer; with the bounds fixes of phpGH-23467 (CVE-2026-93682) and phpGH-23521 for a relative Location, merged with Remi's own (an empty path becomes /). An empty Location header is not followed, as before in 5.6 (7.4 and later go to /). GHSA-hgf5-96fm-v528 (CVE-2025-1736), the user's Authorization or Proxy-Authorization header seen only at the start of a header line, is in Remi's branch (c0bc944, 14.02.2025): its check_has_header() gets the bound of ours, no read before the start of the header bag Origin: port of php-src commits bf4a8df (31.12.2024), 0b965cf (19.01.2025), 134f821 (14.02.2025) and 5418040 (04.03.2025, all Jakub Zelenka), f489702 (24.08.2026, Ilia Alshanetsky) and bd7e19b (31.08.2026, Jordi Kroon) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with their tests and bug47021.phpt and bug75535.phpt of that branch (5.6 had neither), and ext/standard/tests/http/ServerClientTestCase.inc of that branch without the type declarations PHP 5 does not have; the ghsa-hgf5 tests read the request up to its empty line, as 5.6 sends it in several writes; http_empty_location_no_redirect.phpt is ours; on Remi's 5.6 branch f98c3c2 (17.11.2026) - backport-mysqlnd-free-result.patch: mysqlnd: $stmt->free_result() of a prepared statement after the connection was closed set the state of the closed connection back to ready, and the $stmt->close() after it crashed the process (bug #69899); the state is kept when the connection is closed now Origin: php-src commit bd75f9e (Richard Fussenegger, 30.09.2016, PHP 7.0.13; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u22, debian/patches/0118-Fix-bug-69899.patch), with its test - backport-mysqlnd-overread.patch: GHSA-r6x9-5r99-36j7 (the 2026 partial fix) for PHP 5.6, on top of the GHSA-h35g-vwh6-m678 (CVE-2024-8929) fix that Remi's 5.6 branch now has: a hostile or man-in-the-middle MySQL server could still make the mysqlnd client read past the end of a received packet and leak heap bytes into PHP-visible values. php_mysqlnd_net_field_length() takes the bytes left in the packet and returns MYSQLND_INVALID_NET_FIELD_LENGTH when a length-encoded integer would read past them, php_mysqlnd_net_field_length_ll() returns an optional value that the callers check, and every packet reader checks the bytes left before a read (BAIL_IF_NOT_ENOUGH_DATA_EX) instead of after it (BAIL_IF_NO_MORE_DATA): greeting (server version and plugin name found with memchr, both scramble parts bounded), auth response and change-user (the auth switch plugin name found with memchr), OK, EOF, result-set header, column definition (name lengths and the fixed block), prepare response and sha256 public key; the "shorter than expected" warnings no longer print a byte count computed past the packet. The EOF of a text row needs its 4 status bytes, the prepared-statement value decoders give the length decoder the bytes left in the row and reject a length it cannot read, the BIT value of a text row is bounded by the space reserved from the column length, and the prepared-statement EOF reset releases the connection reference and the command buffer before its memset. Every check of the branch stays (the h35g fix with its auth_protocol and binary row follow-ups, the minimum lengths of temporal fields, the OK message past the packet body); only its OK length-prefix check is done by the bounded length decoder now. 31 tests for the fake MySQL server of the branch: ext/mysqli/tests/fake_server.inc gains the packets they need and starts the server with exec, so that proc_terminate() stops the server and not only the shell. Origin: azsupport, port of php-src commit 2af14de (Partial Fix GHSA-r6x9-5r99-36j7, Jakub Zelenka and Nora Dossche, 12.07.2026) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), rebuilt on Remi's 5.6 branch f98c3c2 (17.11.2026), which has the GHSA-h35g-vwh6-m678 fix (dae0e5c, a cherry-pick of php-src 2f5aa9f, with ec0107a) and Ondřej Surý's 5.6 follow-ups c3279aa, 7a82a61 and f10baba; of our earlier port of 2f5aa9f, only what the branch lacks is kept - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0199-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), without its whitespace changes; its test with the SKIPIF of 5.6 (an online test, skipped with SKIP_ONLINE_TESTS) - backport-unsigned-char-ctype.patch: GHSA-m8rr-4c36-8gq4 (CVE-2026-7258): every char handed to a ctype.h function (isalpha(), isdigit(), isspace(), tolower(), toupper() and the others) is cast to unsigned char: a byte of 0x80 and above made a negative argument, which the C standard leaves undefined and some C libraries use as an index before their table (FreeBSD and glibc check or allow it). The places of 7.4 that 5.6 does not have are left out. Origin: port of php-src commits b44c4c8 (03.05.2026, Ilija Tovilo) and 2c4b0c4 (25.10.2026: the -d value check of the CLI, CGI, FPM and phpdbg SAPIs) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports); in 5.6 also in ext/gd/libgd/xbm.c (gd_xbm.c in 7.4) and in the files that re2c made from the changed .re files - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php56 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 5.6) - backport-xml-toffset-test.patch: GHSA-wg4p-4hqh-c3g9 (a recurrence of bug #72714 in xml_parse_into_struct() with XML_OPTION_SKIP_TAGSTART): the test only; 5.6 is not affected, as it passes the tag name to _xml_add_to_info() through SKIP_TAGSTART(), which bounds the offset. Origin: the test of php-src commit c5e836c (18.12.2024, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); brought onto 5.6 by hand: the deprecated zip_set_file_comment() calls of PHP_ZIP_SET_FILE_COMMENT replaced by php_zip_set_file_comment() on zip_file_get_comment() and zip_file_set_comment(); its tests not taken (PHP 7 and later) Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); brought onto 5.6 by hand (its safe_emalloc() buffer, n zip_int64_t); its tests not taken (PHP 7 and later) Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); brought onto 5.6 by hand, with the HashPosition iteration of PHP 5; its tests not taken (PHP 7 and later) Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); brought onto 5.6 by hand (its strncpy() copy before the open_basedir check); its tests not taken (PHP 7 and later) Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zip-18-bug70322-test.patch: bug70322.phpt (ZipArchive::close() returns false and warns when a file it was to add is gone): the warning is "<the message of libzip>: No such file or directory", which libzip 1.6 and later word otherwise than "Read error" (the test failed with libzip 1.7.3, with and without the zip backports; az has libzip 1.12.1); the expectation of PHP 7.4, %s for the message of libzip Origin: ext/zip/tests/bug70322.phpt of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-empty-file.patch: ZipArchive::open() of an existing empty file (one of tempnam(), say) without ZipArchive::OVERWRITE failed with "Not a zip archive" with libzip 1.6.0 and later, which no longer take an empty file for an empty archive (bug #79296): the modules of 5.6 are built with the libzip of az (1.12); such a file is opened as with ZipArchive::OVERWRITE now, as PHP 7.3 and later do. Nothing changes with the libzip bundled in PHP (0.11) Origin: php-src commit 8aab43c (Remi Collet, 19.03.2020, PHP 7.3.17), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0146-Fix-Bug-79296-ZipArchive-open-fails-on-empty-file.patch); the version of libzip checked when building (that of az, linked dynamically) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix on Remi Collet's branch (f98c3c2) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only, and the JSON page gave them raw (a quote in the user made it invalid JSON); for 5.6 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 5.6 can be a module of its own, which FPM cannot call), as for 7.4; the JSON part of our backport of 20.11.2026, which the move onto f98c3c2 dropped (21.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): session.upload_progress.enabled is off by default; for 5.6: the default off, rfc1867_enabled reset in GINIT, the guard (a warning and FAILURE, as the other checks of 5.6) in the INI handlers of 5.6 that set the save handler, the serializer, the save path, the name and the hash function, and in OnUpdateSessionLong, OnUpdateSessionString and OnUpdateSessionBool, wrappers of the standard handlers that the long, string and boolean settings of the session take here as in PHP 7.2 and later (gc_*, cookie_*, use_cookies, use_only_cookies, use_strict_mode, referer_check, entropy_*, cache_*, hash_bits_per_character), as the fix guards those; session.auto_start (PHP_INI_PERDIR), use_trans_sid and upload_progress.* not, as there; its tests not taken The default off and the reset of rfc1867_enabled in GINIT are in Remi's branch (f98c3c2, 17.11.2026); this patch adds the guard. Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36) - backport-zz-GHSA-mmf9-xm3v-hg2x.patch: GHSA-mmf9-xm3v-hg2x (CVE-2026-127960, the PHP security release of 19.11.2026): quadratic folded header concatenation; for 5.6: the folded line appended in place to the last header line, in a buffer that grows by doubling (the folding code of 5.6 is ours, on char * without smart_str) Origin: php-src commit a303f69 (Jakub Zelenka, 06.10.2026, PHP 8.2.36) - backport-zz-phar-openssl-sign.patch: phar of 5.6 with openssl a shared module: Phar::setSignatureAlgorithm(Phar::OPENSSL) of a zip-based phar now and then left the archive signed as before (SHA-1), with no error. phar_call_openssl_signverify() read the result of openssl_sign() after efree() of its zval, so whatever the allocator wrote over it decided whether the signature failed; and phar_zip_flush() dropped the error of phar_zip_applysignature(), so the failed flush kept the file of the flush before and reported nothing. The result is read before the zval is freed (in PHP 7.0 and later it is on the stack), and the zip flush gives the error of the signature to its caller, as PHP 8 does (php-src master, ext/phar/zip.c; PHP 7.4 still drops it) Origin: ours, from the GHSA-68fq-fh7h-f8gr check of a zip-based phar in the tests of the packages of azsupport/ports (run 44798851154, 20.11.2026: the archive signed with OpenSSL came out signed with SHA-1)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 24, 2026
Interim backports carried until the upstream branch has its own fix: - backport-date-period.patch: DatePeriod::__construct() called again on the same object frees the start, current, end and interval of the first call instead of leaking them (phpGH-22643), and refuses a DateInterval, or a start or end date, that was not initialized by its constructor (a subclass that overrides it without calling the parent) instead of reading through a NULL pointer; unlike the 7.4 version it restores the error handling mode on that path, so that later warnings do not turn into exceptions. Origin: php-src commit bbb0272 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (07.07.2026, Ilija Tovilo), adapted to the PHP 5.6 object layout; the check of the start and end dates is added here (5.6 copies the start time with memcpy()); the test DatePeriod_uninitialized_interval.phpt of php-src commit 575c10c (25.10.2026, Jamal Tantaoui, the same fix in 7.4), with date.timezone for 5.6 - backport-disabled-class-properties.patch: a class in disable_classes: new on it gave an object without the table of its declared properties, and reading one of them crashed the process ($o = new CURLFile; $o->name; bug #77494); the table is made, empty, now. Only where php.ini of 5.6 has disable_classes Origin: php-src commit 73f222d (Dmitry Stogov, 24.01.2019, PHP 7.2.15), as Gentoo carries it for 5.6 (proj/php-patches, branch php5.6, 00100_bug77494.patch), with its test - backport-dns-empty-record.patch: CVE-2019-9022 (bug #77369): dns_get_record() took a DNS record with no data (its length 0) and read on with a negative length, a memcpy() past the buffer of the answer; such a record is skipped now. It needs a hostile DNS server or a forged answer Origin: php-src commit 8d3dfab (Stanislav Malyshev, 29.12.2018, PHP 7.1.26; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u12 of jessie LTS and its ELTS, debian/patches/CVE-2019-9022.patch) - backport-dns-res-ndestroy.patch: dns_get_record(), checkdnsrr() and getmxrr() leaked, on every call, the memory res_ninit() of the libc of FreeBSD allocates for the state of the resolver: php_dns.h of 5.6 ends that state with res_nclose(), which leaves it, and only res_ndestroy() frees it. Memory of the libc, outside memory_limit: a php-fpm worker or an Apache child grew until it was recycled. res_ndestroy() where the libc has it (a configure check), as PHP 7 does Origin: ext/standard/php_dns.h and config.m4 of PHP 7 (HAVE_RES_NDESTROY; Remi Collet's 7.4 branch, which our 7.4 to 8.4 have), the leak as pkgsrc fixes it for lang/php56 (patches/patch-ext_standard_php__dns.h: res_ndestroy() but on glibc) - backport-fileinfo-libmagic.patch: the libmagic 5.17 bundled in ext/fileinfo (finfo_file(), finfo_buffer(), mime_content_type() on uploaded files): the number of elements of a CDF vector (Office documents) without a limit (CVE-2019-18218: no overflow in the copy of PHP, but memory without a bound), and the fixes of file 5.30 and 5.31 for crafted files found by OSS-Fuzz: a read past the buffer when comparing with compacted whitespace (softmagic.c), PR/599, a read past the end of a CDF string vector, is_tar() rewritten without signed counters and a strcmp() of an unterminated field, the property info of a bad CDF freed and its pointer cleared on the error (a double free of its callers), a field that could not be read set to 0, the sectors of a CDF limited further Origin: Debian php5 5.6.40+dfsg-0+deb8u12 (jessie LTS and its ELTS), debian/patches/not-cve-but-bug-CVE-2019-18218.patch (the limit of file 5.38, Christos Zoulas, PHP 7.2.24); file commits FILE5_30-12-g77a7041f, FILE5_30-18-g4e4e7609, FILE5_30-19-g7605984c, FILE5_30-30-gc703aa9f, FILE5_30-38-gfd42e119, FILE5_30-39-geb973428 (Christos Zoulas, March and April 2017), as Debian carries them on file 5.30 (1:5.30-1+deb9u3, stretch LTS and its ELTS), the paths src/ as ext/fileinfo/libmagic/ and the free of the error path of cdf_read_property_info() on the code of 5.17, which frees there already - backport-gd-gif-lzw.patch: CVE-2026-9672: the GIF LZW decoder of the bundled libgd (imagecreatefromgif()) clears every entry of its code table on a clear code (it cleared table[1][0] over and over and left the other entries stale), stops at the end code instead of decoding on with a stale code, and starts from a zeroed state, so that a crafted GIF cannot make it read uninitialized memory. Origin: php-src commit e9413a5 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (28.07.2026, libgd fix fcd691b by Pierre Joye), applies to 5.6 as it is - backport-getimagesize.patch: GHSA-3237-qqm7-mfv7 (CVE-2025-14177): getimagesize() reads an APPn segment of a JPEG from a stream in chunks until it has the whole segment, instead of handing back in $imageinfo a buffer that a short read left partly uninitialized (a leak of process memory). Origin: php-src commit 6cf0fb3 (phpGH-20584, 25.11.2025, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; on Remi's 5.6 branch f98c3c2 (17.11.2026), which already refuses a short read (!= length): the chunked read of upstream replaces that check - backport-http-redirects.patch: phpGH-11274: 307 and 308 redirects of the http:// stream wrapper keep the method (POST, PATCH) and the body, as RFC 7231 and RFC 7538 require, on the GHSA-fpwc-w8rq-cr92 fix of Remi's branch (its HTTP_WRAPPER_STRIP_AUTH and same-origin check, which this patch carried before; f98c3c2 of 17.11.2026, which follows a 307 with GET). The fixes of 7.4 for an empty and a 1-character Location (phpGH-23467, phpGH-23521) do not apply: 5.6 does not follow an empty Location and reads it from a fixed-size buffer. Origin: php-src commit c812ca1 (phpGH-11274, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; the GHSA-fpwc-w8rq-cr92 part of dc1f36a is in Remi's 5.6 branch - backport-http-response-headers.patch: GHSA-v8xr-gpvj-cx9g (CVE-2025-1217), GHSA-pcmh-g36c-qc44 (CVE-2025-1734) and GHSA-52jp-hrpf-2jff (CVE-2025-1861) for PHP 5.6: the http:// stream wrapper reads the response headers as PHP 7.4 and later do: a folded header (a line that starts with a space or a tab) is joined to the header before it, a header line without a colon, with a space in the header name, starting with a CR or folded before the first header fails the request, a Location header is followed with up to 8182 bytes (5.6 cut it at 1024 bytes) and fails the request when longer; with the bounds fixes of phpGH-23467 (CVE-2026-93682) and phpGH-23521 for a relative Location, merged with Remi's own (an empty path becomes /). An empty Location header is not followed, as before in 5.6 (7.4 and later go to /). GHSA-hgf5-96fm-v528 (CVE-2025-1736), the user's Authorization or Proxy-Authorization header seen only at the start of a header line, is in Remi's branch (c0bc944, 14.02.2025): its check_has_header() gets the bound of ours, no read before the start of the header bag Origin: port of php-src commits bf4a8df (31.12.2024), 0b965cf (19.01.2025), 134f821 (14.02.2025) and 5418040 (04.03.2025, all Jakub Zelenka), f489702 (24.08.2026, Ilia Alshanetsky) and bd7e19b (31.08.2026, Jordi Kroon) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with their tests and bug47021.phpt and bug75535.phpt of that branch (5.6 had neither), and ext/standard/tests/http/ServerClientTestCase.inc of that branch without the type declarations PHP 5 does not have; the ghsa-hgf5 tests read the request up to its empty line, as 5.6 sends it in several writes; http_empty_location_no_redirect.phpt is ours; on Remi's 5.6 branch f98c3c2 (17.11.2026) - backport-mysqlnd-free-result.patch: mysqlnd: $stmt->free_result() of a prepared statement after the connection was closed set the state of the closed connection back to ready, and the $stmt->close() after it crashed the process (bug #69899); the state is kept when the connection is closed now Origin: php-src commit bd75f9e (Richard Fussenegger, 30.09.2016, PHP 7.0.13; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u22, debian/patches/0118-Fix-bug-69899.patch), with its test - backport-mysqlnd-overread.patch: GHSA-r6x9-5r99-36j7 (the 2026 partial fix) for PHP 5.6, on top of the GHSA-h35g-vwh6-m678 (CVE-2024-8929) fix that Remi's 5.6 branch now has: a hostile or man-in-the-middle MySQL server could still make the mysqlnd client read past the end of a received packet and leak heap bytes into PHP-visible values. php_mysqlnd_net_field_length() takes the bytes left in the packet and returns MYSQLND_INVALID_NET_FIELD_LENGTH when a length-encoded integer would read past them, php_mysqlnd_net_field_length_ll() returns an optional value that the callers check, and every packet reader checks the bytes left before a read (BAIL_IF_NOT_ENOUGH_DATA_EX) instead of after it (BAIL_IF_NO_MORE_DATA): greeting (server version and plugin name found with memchr, both scramble parts bounded), auth response and change-user (the auth switch plugin name found with memchr), OK, EOF, result-set header, column definition (name lengths and the fixed block), prepare response and sha256 public key; the "shorter than expected" warnings no longer print a byte count computed past the packet. The EOF of a text row needs its 4 status bytes, the prepared-statement value decoders give the length decoder the bytes left in the row and reject a length it cannot read, the BIT value of a text row is bounded by the space reserved from the column length, and the prepared-statement EOF reset releases the connection reference and the command buffer before its memset. Every check of the branch stays (the h35g fix with its auth_protocol and binary row follow-ups, the minimum lengths of temporal fields, the OK message past the packet body); only its OK length-prefix check is done by the bounded length decoder now. 31 tests for the fake MySQL server of the branch: ext/mysqli/tests/fake_server.inc gains the packets they need and starts the server with exec, so that proc_terminate() stops the server and not only the shell. Origin: azsupport, port of php-src commit 2af14de (Partial Fix GHSA-r6x9-5r99-36j7, Jakub Zelenka and Nora Dossche, 12.07.2026) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), rebuilt on Remi's 5.6 branch f98c3c2 (17.11.2026), which has the GHSA-h35g-vwh6-m678 fix (dae0e5c, a cherry-pick of php-src 2f5aa9f, with ec0107a) and Ondřej Surý's 5.6 follow-ups c3279aa, 7a82a61 and f10baba; of our earlier port of 2f5aa9f, only what the branch lacks is kept - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0199-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), without its whitespace changes; its test with the SKIPIF of 5.6 (an online test, skipped with SKIP_ONLINE_TESTS) - backport-unsigned-char-ctype.patch: GHSA-m8rr-4c36-8gq4 (CVE-2026-7258): every char handed to a ctype.h function (isalpha(), isdigit(), isspace(), tolower(), toupper() and the others) is cast to unsigned char: a byte of 0x80 and above made a negative argument, which the C standard leaves undefined and some C libraries use as an index before their table (FreeBSD and glibc check or allow it). The places of 7.4 that 5.6 does not have are left out. Origin: port of php-src commits b44c4c8 (03.05.2026, Ilija Tovilo) and 2c4b0c4 (25.10.2026: the -d value check of the CLI, CGI, FPM and phpdbg SAPIs) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports); in 5.6 also in ext/gd/libgd/xbm.c (gd_xbm.c in 7.4) and in the files that re2c made from the changed .re files - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php56 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 5.6) - backport-xml-toffset-test.patch: GHSA-wg4p-4hqh-c3g9 (a recurrence of bug #72714 in xml_parse_into_struct() with XML_OPTION_SKIP_TAGSTART): the test only; 5.6 is not affected, as it passes the tag name to _xml_add_to_info() through SKIP_TAGSTART(), which bounds the offset. Origin: the test of php-src commit c5e836c (18.12.2024, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); brought onto 5.6 by hand: the deprecated zip_set_file_comment() calls of PHP_ZIP_SET_FILE_COMMENT replaced by php_zip_set_file_comment() on zip_file_get_comment() and zip_file_set_comment(); its tests not taken (PHP 7 and later) Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); brought onto 5.6 by hand (its safe_emalloc() buffer, n zip_int64_t); its tests not taken (PHP 7 and later) Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); brought onto 5.6 by hand, with the HashPosition iteration of PHP 5; its tests not taken (PHP 7 and later) Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); brought onto 5.6 by hand (its strncpy() copy before the open_basedir check); its tests not taken (PHP 7 and later) Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zip-18-bug70322-test.patch: bug70322.phpt (ZipArchive::close() returns false and warns when a file it was to add is gone): the warning is "<the message of libzip>: No such file or directory", which libzip 1.6 and later word otherwise than "Read error" (the test failed with libzip 1.7.3, with and without the zip backports; az has libzip 1.12.1); the expectation of PHP 7.4, %s for the message of libzip Origin: ext/zip/tests/bug70322.phpt of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-empty-file.patch: ZipArchive::open() of an existing empty file (one of tempnam(), say) without ZipArchive::OVERWRITE failed with "Not a zip archive" with libzip 1.6.0 and later, which no longer take an empty file for an empty archive (bug #79296): the modules of 5.6 are built with the libzip of az (1.12); such a file is opened as with ZipArchive::OVERWRITE now, as PHP 7.3 and later do. Nothing changes with the libzip bundled in PHP (0.11) Origin: php-src commit 8aab43c (Remi Collet, 19.03.2020, PHP 7.3.17), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0146-Fix-Bug-79296-ZipArchive-open-fails-on-empty-file.patch); the version of libzip checked when building (that of az, linked dynamically) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix on Remi Collet's branch (f98c3c2) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only, and the JSON page gave them raw (a quote in the user made it invalid JSON); for 5.6 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 5.6 can be a module of its own, which FPM cannot call), as for 7.4; the JSON part of our backport of 20.11.2026, which the move onto f98c3c2 dropped (21.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): session.upload_progress.enabled is off by default; for 5.6: the default off, rfc1867_enabled reset in GINIT, the guard (a warning and FAILURE, as the other checks of 5.6) in the INI handlers of 5.6 that set the save handler, the serializer, the save path, the name and the hash function, and in OnUpdateSessionLong, OnUpdateSessionString and OnUpdateSessionBool, wrappers of the standard handlers that the long, string and boolean settings of the session take here as in PHP 7.2 and later (gc_*, cookie_*, use_cookies, use_only_cookies, use_strict_mode, referer_check, entropy_*, cache_*, hash_bits_per_character), as the fix guards those; session.auto_start (PHP_INI_PERDIR), use_trans_sid and upload_progress.* not, as there; its tests not taken The default off and the reset of rfc1867_enabled in GINIT are in Remi's branch (f98c3c2, 17.11.2026); this patch adds the guard. Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36) - backport-zz-GHSA-mmf9-xm3v-hg2x.patch: GHSA-mmf9-xm3v-hg2x (CVE-2026-127960, the PHP security release of 19.11.2026): quadratic folded header concatenation; for 5.6: the folded line appended in place to the last header line, in a buffer that grows by doubling (the folding code of 5.6 is ours, on char * without smart_str) Origin: php-src commit a303f69 (Jakub Zelenka, 06.10.2026, PHP 8.2.36) - backport-zz-phar-openssl-sign.patch: phar of 5.6 with openssl a shared module: Phar::setSignatureAlgorithm(Phar::OPENSSL) of a zip-based phar now and then left the archive signed as before (SHA-1), with no error. phar_call_openssl_signverify() read the result of openssl_sign() after efree() of its zval, so whatever the allocator wrote over it decided whether the signature failed; and phar_zip_flush() dropped the error of phar_zip_applysignature(), so the failed flush kept the file of the flush before and reported nothing. The result is read before the zval is freed (in PHP 7.0 and later it is on the stack), and the zip flush gives the error of the signature to its caller, as PHP 8 does (php-src master, ext/phar/zip.c; PHP 7.4 still drops it) Origin: ours, from the GHSA-68fq-fh7h-f8gr check of a zip-based phar in the tests of the packages of azsupport/ports (run 44798851154, 20.11.2026: the archive signed with OpenSSL came out signed with SHA-1)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 24, 2026
Interim backports carried until the upstream branch has its own fix: - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 7.4 (php7.4 7.4.33-31, debian/patches/0051-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), with its test (the SKIPIF of 7.4; an online test, skipped with SKIP_ONLINE_TESTS) - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 7.4) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); 0 for false (7.4 has no stdbool); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto php_zip_get_from() of 7.4 by hand; its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); zend_bool and 1 (7.4 has no stdbool); its test with locateName() for the lastId of PHP 8; its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); the switch of extractTo() of 7.4, php_zip_extract_file() has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix of this branch (00922d4) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only; for 7.4 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 7.4 can be a module of its own, which FPM cannot call; 20.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch) Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 24, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-gd-font-uninitialized.patch: gd: imagefontwidth(), imagefontheight(), imagestring(), imagestringup(), imagechar() and imagecharup() with a font of imageloadfont() (a GdFont object) left the integer of the font uninitialised, which the font of the object was looked up with too: undefined behaviour, a wrong font with clang 14 and later at -Os (phpGH-13082); both initialised now Origin: php-src commits 1e464e5 and df85c25 (Niels Dossche, 09.01.2024 and 13.01.2024, PHP 8.2.15), as MacPorts carries them for php81 (lang/php/files/patch-php81-ext-gd.diff); their test needs a binary font file, which a patch cannot carry: left out - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of az is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 8.1) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); brought onto getStream() and php_stream_zip_open() of 8.1, which has no getStreamIndex() and getStreamName(); its test with getStream() only; its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern(), the callback registration and the stream opener of 8.1 by hand (8.1 has no clearError()); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() has no index argument here; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); the guard of getStream() of 8.1; its test without getStreamIndex() and getStreamName(); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch), with its test Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 24, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-separate-live-range.patch: CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch Origin: php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 24, 2026
Interim backports carried until the upstream branch has its own fix: - backport-zip-01-add-file-fd-leak.patch: php_zip_add_file() leaked the file it had opened for ZIP_FL_OPEN_FILE_NOW when zip_source_filep() failed (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 4c54dce (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-date-period.patch: DatePeriod::__construct() called again on the same object frees the start, current, end and interval of the first call instead of leaking them (phpGH-22643), and refuses a DateInterval, or a start or end date, that was not initialized by its constructor (a subclass that overrides it without calling the parent) instead of reading through a NULL pointer; unlike the 7.4 version it restores the error handling mode on that path, so that later warnings do not turn into exceptions. Origin: php-src commit bbb0272 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (07.07.2026, Ilija Tovilo), adapted to the PHP 5.6 object layout; the check of the start and end dates is added here (5.6 copies the start time with memcpy()); the test DatePeriod_uninitialized_interval.phpt of php-src commit 575c10c (25.10.2026, Jamal Tantaoui, the same fix in 7.4), with date.timezone for 5.6 - backport-disabled-class-properties.patch: a class in disable_classes: new on it gave an object without the table of its declared properties, and reading one of them crashed the process ($o = new CURLFile; $o->name; bug #77494); the table is made, empty, now. Only where php.ini of 5.6 has disable_classes Origin: php-src commit 73f222d (Dmitry Stogov, 24.01.2019, PHP 7.2.15), as Gentoo carries it for 5.6 (proj/php-patches, branch php5.6, 00100_bug77494.patch), with its test - backport-dns-empty-record.patch: CVE-2019-9022 (bug #77369): dns_get_record() took a DNS record with no data (its length 0) and read on with a negative length, a memcpy() past the buffer of the answer; such a record is skipped now. It needs a hostile DNS server or a forged answer Origin: php-src commit 8d3dfab (Stanislav Malyshev, 29.12.2018, PHP 7.1.26; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u12 of jessie LTS and its ELTS, debian/patches/CVE-2019-9022.patch) - backport-dns-res-ndestroy.patch: dns_get_record(), checkdnsrr() and getmxrr() leaked, on every call, the memory res_ninit() of the libc of FreeBSD allocates for the state of the resolver: php_dns.h of 5.6 ends that state with res_nclose(), which leaves it, and only res_ndestroy() frees it. Memory of the libc, outside memory_limit: a php-fpm worker or an Apache child grew until it was recycled. res_ndestroy() where the libc has it (a configure check), as PHP 7 does Origin: ext/standard/php_dns.h and config.m4 of PHP 7 (HAVE_RES_NDESTROY; Remi Collet's 7.4 branch, which our 7.4 to 8.4 have), the leak as pkgsrc fixes it for lang/php56 (patches/patch-ext_standard_php__dns.h: res_ndestroy() but on glibc) - backport-fileinfo-libmagic.patch: the libmagic 5.17 bundled in ext/fileinfo (finfo_file(), finfo_buffer(), mime_content_type() on uploaded files): the number of elements of a CDF vector (Office documents) without a limit (CVE-2019-18218: no overflow in the copy of PHP, but memory without a bound), and the fixes of file 5.30 and 5.31 for crafted files found by OSS-Fuzz: a read past the buffer when comparing with compacted whitespace (softmagic.c), PR/599, a read past the end of a CDF string vector, is_tar() rewritten without signed counters and a strcmp() of an unterminated field, the property info of a bad CDF freed and its pointer cleared on the error (a double free of its callers), a field that could not be read set to 0, the sectors of a CDF limited further Origin: Debian php5 5.6.40+dfsg-0+deb8u12 (jessie LTS and its ELTS), debian/patches/not-cve-but-bug-CVE-2019-18218.patch (the limit of file 5.38, Christos Zoulas, PHP 7.2.24); file commits FILE5_30-12-g77a7041f, FILE5_30-18-g4e4e7609, FILE5_30-19-g7605984c, FILE5_30-30-gc703aa9f, FILE5_30-38-gfd42e119, FILE5_30-39-geb973428 (Christos Zoulas, March and April 2017), as Debian carries them on file 5.30 (1:5.30-1+deb9u3, stretch LTS and its ELTS), the paths src/ as ext/fileinfo/libmagic/ and the free of the error path of cdf_read_property_info() on the code of 5.17, which frees there already - backport-gd-gif-lzw.patch: CVE-2026-9672: the GIF LZW decoder of the bundled libgd (imagecreatefromgif()) clears every entry of its code table on a clear code (it cleared table[1][0] over and over and left the other entries stale), stops at the end code instead of decoding on with a stale code, and starts from a zeroed state, so that a crafted GIF cannot make it read uninitialized memory. Origin: php-src commit e9413a5 of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) (28.07.2026, libgd fix fcd691b by Pierre Joye), applies to 5.6 as it is - backport-getimagesize.patch: GHSA-3237-qqm7-mfv7 (CVE-2025-14177): getimagesize() reads an APPn segment of a JPEG from a stream in chunks until it has the whole segment, instead of handing back in $imageinfo a buffer that a short read left partly uninitialized (a leak of process memory). Origin: php-src commit 6cf0fb3 (phpGH-20584, 25.11.2025, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; on Remi's 5.6 branch f98c3c2 (17.11.2026), which already refuses a short read (!= length): the chunked read of upstream replaces that check - backport-http-redirects.patch: phpGH-11274: 307 and 308 redirects of the http:// stream wrapper keep the method (POST, PATCH) and the body, as RFC 7231 and RFC 7538 require, on the GHSA-fpwc-w8rq-cr92 fix of Remi's branch (its HTTP_WRAPPER_STRIP_AUTH and same-origin check, which this patch carried before; f98c3c2 of 17.11.2026, which follows a 307 with GET). The fixes of 7.4 for an empty and a 1-character Location (phpGH-23467, phpGH-23521) do not apply: 5.6 does not follow an empty Location and reads it from a fixed-size buffer. Origin: php-src commit c812ca1 (phpGH-11274, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with its test; the GHSA-fpwc-w8rq-cr92 part of dc1f36a is in Remi's 5.6 branch - backport-http-response-headers.patch: GHSA-v8xr-gpvj-cx9g (CVE-2025-1217), GHSA-pcmh-g36c-qc44 (CVE-2025-1734) and GHSA-52jp-hrpf-2jff (CVE-2025-1861) for PHP 5.6: the http:// stream wrapper reads the response headers as PHP 7.4 and later do: a folded header (a line that starts with a space or a tab) is joined to the header before it, a header line without a colon, with a space in the header name, starting with a CR or folded before the first header fails the request, a Location header is followed with up to 8182 bytes (5.6 cut it at 1024 bytes) and fails the request when longer; with the bounds fixes of phpGH-23467 (CVE-2026-93682) and phpGH-23521 for a relative Location, merged with Remi's own (an empty path becomes /). An empty Location header is not followed, as before in 5.6 (7.4 and later go to /). GHSA-hgf5-96fm-v528 (CVE-2025-1736), the user's Authorization or Proxy-Authorization header seen only at the start of a header line, is in Remi's branch (c0bc944, 14.02.2025): its check_has_header() gets the bound of ours, no read before the start of the header bag Origin: port of php-src commits bf4a8df (31.12.2024), 0b965cf (19.01.2025), 134f821 (14.02.2025) and 5418040 (04.03.2025, all Jakub Zelenka), f489702 (24.08.2026, Ilia Alshanetsky) and bd7e19b (31.08.2026, Jordi Kroon) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), with their tests and bug47021.phpt and bug75535.phpt of that branch (5.6 had neither), and ext/standard/tests/http/ServerClientTestCase.inc of that branch without the type declarations PHP 5 does not have; the ghsa-hgf5 tests read the request up to its empty line, as 5.6 sends it in several writes; http_empty_location_no_redirect.phpt is ours; on Remi's 5.6 branch f98c3c2 (17.11.2026) - backport-mysqlnd-free-result.patch: mysqlnd: $stmt->free_result() of a prepared statement after the connection was closed set the state of the closed connection back to ready, and the $stmt->close() after it crashed the process (bug #69899); the state is kept when the connection is closed now Origin: php-src commit bd75f9e (Richard Fussenegger, 30.09.2016, PHP 7.0.13; in Remi Collet's 7.4 branch), as Debian carries it for 5.6 (php5 5.6.40+dfsg-0+deb8u22, debian/patches/0118-Fix-bug-69899.patch), with its test - backport-mysqlnd-overread.patch: GHSA-r6x9-5r99-36j7 (the 2026 partial fix) for PHP 5.6, on top of the GHSA-h35g-vwh6-m678 (CVE-2024-8929) fix that Remi's 5.6 branch now has: a hostile or man-in-the-middle MySQL server could still make the mysqlnd client read past the end of a received packet and leak heap bytes into PHP-visible values. php_mysqlnd_net_field_length() takes the bytes left in the packet and returns MYSQLND_INVALID_NET_FIELD_LENGTH when a length-encoded integer would read past them, php_mysqlnd_net_field_length_ll() returns an optional value that the callers check, and every packet reader checks the bytes left before a read (BAIL_IF_NOT_ENOUGH_DATA_EX) instead of after it (BAIL_IF_NO_MORE_DATA): greeting (server version and plugin name found with memchr, both scramble parts bounded), auth response and change-user (the auth switch plugin name found with memchr), OK, EOF, result-set header, column definition (name lengths and the fixed block), prepare response and sha256 public key; the "shorter than expected" warnings no longer print a byte count computed past the packet. The EOF of a text row needs its 4 status bytes, the prepared-statement value decoders give the length decoder the bytes left in the row and reject a length it cannot read, the BIT value of a text row is bounded by the space reserved from the column length, and the prepared-statement EOF reset releases the connection reference and the command buffer before its memset. Every check of the branch stays (the h35g fix with its auth_protocol and binary row follow-ups, the minimum lengths of temporal fields, the OK message past the packet body); only its OK length-prefix check is done by the bounded length decoder now. 31 tests for the fake MySQL server of the branch: ext/mysqli/tests/fake_server.inc gains the packets they need and starts the server with exec, so that proc_terminate() stops the server and not only the shell. Origin: azsupport, port of php-src commit 2af14de (Partial Fix GHSA-r6x9-5r99-36j7, Jakub Zelenka and Nora Dossche, 12.07.2026) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports), rebuilt on Remi's 5.6 branch f98c3c2 (17.11.2026), which has the GHSA-h35g-vwh6-m678 fix (dae0e5c, a cherry-pick of php-src 2f5aa9f, with ec0107a) and Ondřej Surý's 5.6 follow-ups c3279aa, 7a82a61 and f10baba; of our earlier port of 2f5aa9f, only what the branch lacks is kept - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0199-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), without its whitespace changes; its test with the SKIPIF of 5.6 (an online test, skipped with SKIP_ONLINE_TESTS) - backport-unsigned-char-ctype.patch: GHSA-m8rr-4c36-8gq4 (CVE-2026-7258): every char handed to a ctype.h function (isalpha(), isdigit(), isspace(), tolower(), toupper() and the others) is cast to unsigned char: a byte of 0x80 and above made a negative argument, which the C standard leaves undefined and some C libraries use as an index before their table (FreeBSD and glibc check or allow it). The places of 7.4 that 5.6 does not have are left out. Origin: port of php-src commits b44c4c8 (03.05.2026, Ilija Tovilo) and 2c4b0c4 (25.10.2026: the -d value check of the CLI, CGI, FPM and phpdbg SAPIs) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports); in 5.6 also in ext/gd/libgd/xbm.c (gd_xbm.c in 7.4) and in the files that re2c made from the changed .re files - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of azsupport is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php56 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 5.6) - backport-xml-toffset-test.patch: GHSA-wg4p-4hqh-c3g9 (a recurrence of bug #72714 in xml_parse_into_struct() with XML_OPTION_SKIP_TAGSTART): the test only; 5.6 is not affected, as it passes the tag name to _xml_add_to_info() through SKIP_TAGSTART(), which bounds the offset. Origin: the test of php-src commit c5e836c (18.12.2024, Niels Dossche) of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); brought onto 5.6 by hand: the deprecated zip_set_file_comment() calls of PHP_ZIP_SET_FILE_COMMENT replaced by php_zip_set_file_comment() on zip_file_get_comment() and zip_file_set_comment(); its tests not taken (PHP 7 and later) Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); brought onto 5.6 by hand (its safe_emalloc() buffer, n zip_int64_t); its tests not taken (PHP 7 and later) Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); brought onto the PHP 5 code of 5.6 by hand; its tests not taken (PHP 7 and later) Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); brought onto 5.6 by hand, with the HashPosition iteration of PHP 5; its tests not taken (PHP 7 and later) Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); brought onto 5.6 by hand (its strncpy() copy before the open_basedir check); its tests not taken (PHP 7 and later) Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zip-18-bug70322-test.patch: bug70322.phpt (ZipArchive::close() returns false and warns when a file it was to add is gone): the warning is "<the message of libzip>: No such file or directory", which libzip 1.6 and later word otherwise than "Read error" (the test failed with libzip 1.7.3, with and without the zip backports; azsupport has libzip 1.12.1); the expectation of PHP 7.4, %s for the message of libzip Origin: ext/zip/tests/bug70322.phpt of the PHP 7.4 security branch of Remi Collet (remicollet/php-src-security PHP-7.4-security-backports) - backport-zip-empty-file.patch: ZipArchive::open() of an existing empty file (one of tempnam(), say) without ZipArchive::OVERWRITE failed with "Not a zip archive" with libzip 1.6.0 and later, which no longer take an empty file for an empty archive (bug #79296): the modules of 5.6 are built with the libzip of azsupport (1.12); such a file is opened as with ZipArchive::OVERWRITE now, as PHP 7.3 and later do. Nothing changes with the libzip bundled in PHP (0.11) Origin: php-src commit 8aab43c (Remi Collet, 19.03.2020, PHP 7.3.17), as Ondřej Surý carries it for 5.6 (php5.6 5.6.40-105, debian/patches/0146-Fix-Bug-79296-ZipArchive-open-fails-on-empty-file.patch); the version of libzip checked when building (that of azsupport, linked dynamically) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix on Remi Collet's branch (f98c3c2) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only, and the JSON page gave them raw (a quote in the user made it invalid JSON); for 5.6 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 5.6 can be a module of its own, which FPM cannot call), as for 7.4; the JSON part of our backport of 20.11.2026, which the move onto f98c3c2 dropped (21.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): session.upload_progress.enabled is off by default; for 5.6: the default off, rfc1867_enabled reset in GINIT, the guard (a warning and FAILURE, as the other checks of 5.6) in the INI handlers of 5.6 that set the save handler, the serializer, the save path, the name and the hash function, and in OnUpdateSessionLong, OnUpdateSessionString and OnUpdateSessionBool, wrappers of the standard handlers that the long, string and boolean settings of the session take here as in PHP 7.2 and later (gc_*, cookie_*, use_cookies, use_only_cookies, use_strict_mode, referer_check, entropy_*, cache_*, hash_bits_per_character), as the fix guards those; session.auto_start (PHP_INI_PERDIR), use_trans_sid and upload_progress.* not, as there; its tests not taken The default off and the reset of rfc1867_enabled in GINIT are in Remi's branch (f98c3c2, 17.11.2026); this patch adds the guard. Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36) - backport-zz-GHSA-mmf9-xm3v-hg2x.patch: GHSA-mmf9-xm3v-hg2x (CVE-2026-127960, the PHP security release of 19.11.2026): quadratic folded header concatenation; for 5.6: the folded line appended in place to the last header line, in a buffer that grows by doubling (the folding code of 5.6 is ours, on char * without smart_str) Origin: php-src commit a303f69 (Jakub Zelenka, 06.10.2026, PHP 8.2.36) - backport-zz-phar-openssl-sign.patch: phar of 5.6 with openssl a shared module: Phar::setSignatureAlgorithm(Phar::OPENSSL) of a zip-based phar now and then left the archive signed as before (SHA-1), with no error. phar_call_openssl_signverify() read the result of openssl_sign() after efree() of its zval, so whatever the allocator wrote over it decided whether the signature failed; and phar_zip_flush() dropped the error of phar_zip_applysignature(), so the failed flush kept the file of the flush before and reported nothing. The result is read before the zval is freed (in PHP 7.0 and later it is on the stack), and the zip flush gives the error of the signature to its caller, as PHP 8 does (php-src master, ext/phar/zip.c; PHP 7.4 still drops it) Origin: ours, from the GHSA-68fq-fh7h-f8gr check of a zip-based phar in the tests of the packages of azsupport/ports (run 44798851154, 20.11.2026: the archive signed with OpenSSL came out signed with SHA-1)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-openssl3-unexpected-eof.patch: OpenSSL 3 (that of the base system of FreeBSD 15) takes a TLS peer that closes the connection without close_notify for an attack on the end of the data: "SSL: ... unexpected eof while reading", a warning and a failed read in https://, ssl://, tls:// streams and SoapClient, where OpenSSL 1.1.1 gave the end of the data (bug #79589, phpGH-8369; many servers close so); SSL_OP_IGNORE_UNEXPECTED_EOF keeps the behaviour of OpenSSL 1.1.1, as PHP 8.1 and later do Origin: php-src commit 74f75db (Jakub Zelenka, 15.05.2022, PHP 8.1.7), as Ondřej Surý carries it for 7.4 (php7.4 7.4.33-31, debian/patches/0051-Fix-bug-79589-ssl3_read_n-unexpected-eof-while-readi.patch), with its test (the SKIPIF of 7.4; an online test, skipped with SKIP_ONLINE_TESTS) - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of azsupport is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 7.4) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); 0 for false (7.4 has no stdbool); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); brought onto php_zip_get_from() of 7.4 by hand; its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); zend_bool and 1 (7.4 has no stdbool); its test with locateName() for the lastId of PHP 8; its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); the switch of extractTo() of 7.4, php_zip_extract_file() has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-3mg3-cr28-46gc-json.patch: GHSA-3mg3-cr28-46gc (CVE-2026-129292, the PHP security release of 19.11.2026): FPM XSS within status endpoint via user and script; the fix of this branch (00922d4) escapes the request method, the URI, the query string, the user and the script for the HTML and XML pages only; for 7.4 these five fields escaped for the JSON page too, by an escaper of its own that writes them as php_json_encode_string() of 8.x does with PHP_JSON_INVALID_UTF8_IGNORE (the json of 7.4 can be a module of its own, which FPM cannot call; 20.11.2026); its tests not taken Origin: php-src commit 1ecb92f (Jakub Zelenka, 26.10.2026, PHP 8.2.36): its escaping of the JSON page - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch) Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-gd-font-uninitialized.patch: gd: imagefontwidth(), imagefontheight(), imagestring(), imagestringup(), imagechar() and imagecharup() with a font of imageloadfont() (a GdFont object) left the integer of the font uninitialised, which the font of the object was looked up with too: undefined behaviour, a wrong font with clang 14 and later at -Os (phpGH-13082); both initialised now Origin: php-src commits 1e464e5 and df85c25 (Niels Dossche, 09.01.2024 and 13.01.2024, PHP 8.2.15), as MacPorts carries them for php81 (lang/php/files/patch-php81-ext-gd.diff); their test needs a binary font file, which a patch cannot carry: left out - backport-xml-libxml213-entities.patch: ext/xml with libxml2 2.13 and later (that of azsupport is 2.15): _get_entity() of compat.c waited for parser states that libxml2 2.13 no longer sets, so the entities in attribute and entity values went to the default handler as text, data that is not in the document (<a hint="x'y"> gave an extra ' to the character data handler; phpGH-14834, PEAR could not read its package.xml): only in the content of elements now Origin: php-src commit 67259e4 (Niels Dossche, 05.07.2024, PHP 8.2.22), as pkgsrc carries it for lang/php74 and lang/php81 (patches/patch-ext_xml_compat.c) and MacPorts for php74, with its test (the SKIPIF of 8.1) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); brought onto getStream() and php_stream_zip_open() of 8.1, which has no getStreamIndex() and getStreamName(); its test with getStream() only; its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() is an int here: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern(), the callback registration and the stream opener of 8.1 by hand (8.1 has no clearError()); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() has no index argument here; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); the guard of getStream() of 8.1; its test without getStreamIndex() and getStreamName(); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21) - backport-zz-GHSA-658j-r8rw-q6mx-runtime.patch: GHSA-658j-r8rw-q6mx (CVE-2026-115560, the PHP security release of 19.11.2026): the session settings not to be changed at run time while session.upload_progress.enabled is on (an Error, as PHP 8.2 and later), the part of the fix Remi Collet's backport leaves out ("Default change only"; his commit of the default off and the reset in GINIT is upstream of this branch), with its test Origin: php-src commit 3f70f66 (Arnaud Le Blanc, 09.11.2026, PHP 8.2.36): its SESSION_CHECK_UPLOAD_PROGRESS_STATE and the INI handlers it guards; on the decision of aZ, 19.11.2026
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-separate-live-range.patch: CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch Origin: php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-zip-01-add-file-fd-leak.patch: php_zip_add_file() leaked the file it had opened for ZIP_FL_OPEN_FILE_NOW when zip_source_filep() failed (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 4c54dce (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-fpm-scoreboard-readers.patch: php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one Origin: php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm) - backport-separate-live-range.patch: CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch Origin: php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
azsupport
added a commit
to azsupport/php-src
that referenced
this pull request
Nov 25, 2026
Interim backports carried until the upstream branch has its own fix: - backport-zip-01-add-file-fd-leak.patch: php_zip_add_file() leaked the file it had opened for ZIP_FL_OPEN_FILE_NOW when zip_source_filep() failed (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 4c54dce (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-02-pcre-name-leak.patch: php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-03-get-from-fread-leak.patch: getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken Origin: php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23) - backport-zip-04-gh21705-fl-unchanged.patch: phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24) - backport-zip-05-gh22649-comment-uaf.patch: phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken Origin: php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24) - backport-zip-06-addglob-default-options.patch: phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); its tests taken Origin: php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25) - backport-zip-07-gh17787-stream-owner.patch: phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26) - backport-zip-08-gh23240-crc-errors.patch: phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26) - backport-zip-09-phpinfo-aes.patch: phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26) - backport-zip-10-gh23276-archive-state.patch: phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26) - backport-zip-11-getnameindex-int.patch: getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-12-stat-open-fail.patch: phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken Origin: php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26) - backport-zip-13-extractto-non-list.patch: extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27) - backport-zip-14-gh23747-close-callback-uaf.patch: phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken Origin: php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27) - backport-zip-15-gh23779-destructor-uaf.patch: phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28) - backport-zip-16-gh24025-close-mutators.patch: phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); its tests taken Origin: php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28) - backport-zip-17-gh21698-addglob-leak.patch: phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); its tests taken Origin: php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.