Skip to content

ext/zip: addGlob() and addPattern() ignore their default options. - #23108

Closed
devnexen wants to merge 2 commits into
php:PHP-8.4from
devnexen:ext_zip_add_glob_pattern
Closed

devnexen wants to merge 2 commits into
php:PHP-8.4from
devnexen:ext_zip_add_glob_pattern

Conversation

@devnexen

@devnexen devnexen commented Aug 7, 2026

Copy link
Copy Markdown
Member

php_zip_parse_options() held the defaults but only ran for a non-empty options array, so opts stayed zeroed otherwise: comp_method 0 is CM_STORE and flags 0 drops FL_OVERWRITE. Entries were therefore stored uncompressed, and an already present entry name failed the call instead of being replaced. The defaults now live in PHP_ZIP_DEFAULT_OPTIONS, applied at declaration.

php_zip_parse_options() held the defaults but only ran for a non-empty
options array, so opts stayed zeroed otherwise: comp_method 0 is CM_STORE
and flags 0 drops FL_OVERWRITE. Entries were therefore stored uncompressed,
and an already present entry name failed the call instead of being replaced.
The defaults now live in PHP_ZIP_DEFAULT_OPTIONS, applied at declaration.
@devnexen
devnexen marked this pull request as ready for review August 7, 2026 19:40
@devnexen
devnexen requested a review from LamentXU123 as a code owner August 7, 2026 19:40

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the same default-options regression coverage for ZipArchive::addPattern()?

Both entry points share php_zip_add_from_pattern(), only addGlob() was covered.

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@devnexen devnexen closed this in 8d5b0d6 Aug 8, 2026
@devnexen
devnexen deleted the ext_zip_add_glob_pattern branch August 23, 2026 14:26
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-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&apos;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 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&apos;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-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&apos;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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants