437 Commits
Author SHA1 Message Date
Ilija Tovilo 9705fda1bb Merge branch 'PHP-8.6' into master
* PHP-8.6:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:34:56 +02:00
Ilija Tovilo d6373dfe15 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:33:23 +02:00
Ilija Tovilo c7273b9ba8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:30:04 +02:00
Ilija Tovilo 8a94bb3822 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:27:03 +02:00
Ilija Tovilo c1a5f468d0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:12:35 +02:00
3584a98bda Avoid state corruption via bailout
- Replace bailout on OOM with UnwindExit
- Properly reset various globals that may be accessed during startup

Fix GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
Fix GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Jakub Zelenka <bukka@php.net>
Co-authored-by: Nora Dossche <7771979+ndossche@users.noreply.github.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
2026-10-21 16:06:22 +02:00
Gina Peter Banyard 1439349419 tree: use zend_string API when possible (#24330) 2026-10-14 22:40:12 +01:00
David Carlier 58f680c81e Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  ext/soap: to_xml_array() heap use-after-free with illegal iterator keys.
2026-10-01 19:13:18 +01:00
David Carlier 81a83bb33a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/soap: to_xml_array() heap use-after-free with illegal iterator keys.

# Conflicts:
#	Zend/zend_API.c
2026-10-01 19:12:52 +01:00
David Carlier d044f28b80 ext/soap: to_xml_array() heap use-after-free with illegal iterator keys.
Fix #22895

The return value of array_set_zval_key() was ignored, so when the key is
not a legal array offset, e.g. MultipleIterator::key() returning an
array, it threw and took no reference. The unconditional zval_ptr_dtor()
then dropped the iterator's only reference to the borrowed value and the
following Z_TRY_ADDREF_P() read freed memory. array_set_zval_key() now
also fails when a float or resource key diagnostic throws, and the loop
stops on failure.

Close GH-22896
2026-10-01 19:12:01 +01:00
Jakub Zelenka 48e53b0921 Merge branch 'PHP-8.5'
* PHP-8.5:
  Skip bz2 GH-20807 test when less than 13 GiB of memory is available
  ext/soap: make GHSA-cj93-vc83-wgqv test lean and reliable
  Add NEWS entries
  ext/standard: Fix 1-char relative Location redirects after GH-23467
  [http] Fix out-of-bounds read on empty Location header
  Fix GHSA-ch8v-r6jh-4vvr: encode 0xFF in FILTER_SANITIZE_ENCODED
  Fix GHSA-9f67-6fw4-hpfp
  Fix GHSA-j3wh-g957-2m85: phar tar entry injection
  Fix GHSA-cj93-vc83-wgqv
  Fix GHSA-rgrp-mwpx-f6rm: unbounded recursion in ext/soap XML parsing and decoding
  Fix GHSA-fpwc-w8rq-cr92: strip credentials from user headers on cross-origin redirects
  Fix GHSA-r6x9-5r99-36j7: Various packet overreads in mysqlnd wireprotocol
  Fix GHSA-xr7j-rvgx-xq5p: OOB read in php_openssl_matches_wildcard_name()
  Fix GHSA-vvx9-73fr-5jjx: do not fall back to CN if the cert has a service ID
  Fix GHSA-62xp-839h-2637: FastCGI allowed_clients compared only 96 bits of IPv6 addresses
  Fix heap-buffer-overflow in convert stream filters with NUL in line-break-chars

# Conflicts:
#	NEWS
#	ext/openssl/xp_ssl.c
#	ext/phar/tar.c
#	ext/soap/php_http.c
#	ext/standard/http_fopen_wrapper.c
2026-09-22 11:15:26 +02:00
Jakub Zelenka 2ef7525be7 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Skip bz2 GH-20807 test when less than 13 GiB of memory is available
  ext/soap: make GHSA-cj93-vc83-wgqv test lean and reliable
  Add NEWS entries
  ext/standard: Fix 1-char relative Location redirects after GH-23467
  [http] Fix out-of-bounds read on empty Location header
  Fix GHSA-ch8v-r6jh-4vvr: encode 0xFF in FILTER_SANITIZE_ENCODED
  Fix GHSA-9f67-6fw4-hpfp
  Fix GHSA-j3wh-g957-2m85: phar tar entry injection
  Fix GHSA-cj93-vc83-wgqv
  Fix GHSA-rgrp-mwpx-f6rm: unbounded recursion in ext/soap XML parsing and decoding
  Fix GHSA-fpwc-w8rq-cr92: strip credentials from user headers on cross-origin redirects
  Fix GHSA-r6x9-5r99-36j7: Various packet overreads in mysqlnd wireprotocol
  Fix GHSA-xr7j-rvgx-xq5p: OOB read in php_openssl_matches_wildcard_name()
  Fix GHSA-vvx9-73fr-5jjx: do not fall back to CN if the cert has a service ID
  Fix GHSA-62xp-839h-2637: FastCGI allowed_clients compared only 96 bits of IPv6 addresses
  Fix heap-buffer-overflow in convert stream filters with NUL in line-break-chars

# Conflicts:
#	NEWS
#	ext/phar/tar.c
#	ext/soap/php_http.c
#	ext/soap/php_xml.c
#	ext/standard/http_fopen_wrapper.c
#	win32/ioutil.c
2026-09-22 11:14:09 +02:00
Jakub Zelenka 2cd16757b2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/soap: make GHSA-cj93-vc83-wgqv test lean and reliable
  Add NEWS entries
  ext/standard: Fix 1-char relative Location redirects after GH-23467
  [http] Fix out-of-bounds read on empty Location header
  Fix GHSA-ch8v-r6jh-4vvr: encode 0xFF in FILTER_SANITIZE_ENCODED
  Fix GHSA-9f67-6fw4-hpfp
  Fix GHSA-j3wh-g957-2m85: phar tar entry injection
  Fix GHSA-cj93-vc83-wgqv
  Fix GHSA-rgrp-mwpx-f6rm: unbounded recursion in ext/soap XML parsing and decoding
  Fix GHSA-fpwc-w8rq-cr92: strip credentials from user headers on cross-origin redirects
  Fix GHSA-r6x9-5r99-36j7: Various packet overreads in mysqlnd wireprotocol
  Fix GHSA-xr7j-rvgx-xq5p: OOB read in php_openssl_matches_wildcard_name()
  Fix GHSA-vvx9-73fr-5jjx: do not fall back to CN if the cert has a service ID
  Fix GHSA-62xp-839h-2637: FastCGI allowed_clients compared only 96 bits of IPv6 addresses
  Fix heap-buffer-overflow in convert stream filters with NUL in line-break-chars

# Conflicts:
#	ext/openssl/xp_ssl.c
2026-09-22 11:03:08 +02:00
Jakub Zelenka f9e04180ae Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/soap: make GHSA-cj93-vc83-wgqv test lean and reliable
  Add NEWS entries
  ext/standard: Fix 1-char relative Location redirects after GH-23467
  [http] Fix out-of-bounds read on empty Location header
  Fix GHSA-ch8v-r6jh-4vvr: encode 0xFF in FILTER_SANITIZE_ENCODED
  Fix GHSA-9f67-6fw4-hpfp
  Fix GHSA-j3wh-g957-2m85: phar tar entry injection
  Fix GHSA-cj93-vc83-wgqv
  Fix GHSA-rgrp-mwpx-f6rm: unbounded recursion in ext/soap XML parsing and decoding
  Fix GHSA-fpwc-w8rq-cr92: strip credentials from user headers on cross-origin redirects
  Fix GHSA-r6x9-5r99-36j7: Various packet overreads in mysqlnd wireprotocol
  Fix GHSA-xr7j-rvgx-xq5p: OOB read in php_openssl_matches_wildcard_name()
  Fix GHSA-vvx9-73fr-5jjx: do not fall back to CN if the cert has a service ID
  Fix GHSA-62xp-839h-2637: FastCGI allowed_clients compared only 96 bits of IPv6 addresses
  Fix heap-buffer-overflow in convert stream filters with NUL in line-break-chars
2026-09-22 10:54:22 +02:00
Weilin Du 90fd4f2f21 Merge branch 'PHP-8.4' into PHP-8.5
Propagate the backport of PR #23771 from PHP-8.4 to PHP-8.5.

* PHP-8.4:
  Backport: fix integer overflow in to_xml_hexbin (#23771)
2026-09-22 01:53:22 +08:00
jvoisin b03e26720b Backport: fix integer overflow in to_xml_hexbin (#23771)
Backport PR #23771 from master to PHP-8.4.
Original commit: 94ddf35ca9

Closes #23771
2026-09-22 01:53:21 +08:00
Julien Voisin 94ddf35ca9 Fix an integer overflow in to_xml_hexbin (#23771) 2026-09-19 19:36:55 +02:00
Alexandre Daubois 3655b79c7b Fix GHSA-rgrp-mwpx-f6rm: unbounded recursion in ext/soap XML parsing and decoding 2026-09-18 17:12:11 +02:00
41f2ca4dd4 ext/soap: Fix SOAP classmap validation for integer keys (#22884)
Previously, SOAP only rejected packed arrays, which still allowed sparse
integer-keyed arrays and mixed string integer-keyed arrays to be accepted.

Since classmap is expected to be an associative mapping, arrays containing
integer keys are now rejected consistently.

Co-authored-by: David CARLIER <devnexen@gmail.com>
Co-authored-by: NickSdot <32384907+NickSdot@users.noreply.github.com>
2026-07-31 00:18:12 +08:00
Weilin Du 4fa10e2513 ext/soap: Improve SOAP scalar decoding error messages (#22706)
SOAP encoding errors now report the affected type or failing operation in
the error message instead of the generic "Encoding: Violation of encoding
rules" message. Code that compares the exact message may need to be
updated.
2026-07-14 04:27:52 +08:00
Weilin Du 1fd15d4254 ext/soap: Fix SOAP xsd:hexBinary odd-length decoding (#22698)
xsd:hexBinary values must contain an even number of hexadecimal digits.

However, previously we allocated strlen(content) / 2 bytes and decoded only
complete byte pairs. As a result, an odd-length value such as ABC was
accepted as ab (what...?), silently ignoring the trailing nibble.

Lets reject odd-length xsd:hexBinary values instead and throw an Error here
which makes better sense. The error message is copied from other decoding
errors. (I think in the future, we can make the decoding error message more
useful, in bulk.)

This is in master as a stricter parsing PR
2026-07-12 06:45:34 +08:00
Weilin Du aa12a652c3 ext/soap: Add UNEXPECTED() in obvious error path (#22596)
This added `UNEXPECTED()` in several obvious error path for optimization
in ext/soap.
2026-07-05 12:28:12 +08:00
Weilin Du 9ae23bae5f Zend: Use zend_string_equals* APIs for string comparisons (#21707)
Use the zend_string APIs zend_string_equals* which are clearer,
and can also do some pointer comparisons if the strings are
interned for any reason.
2026-06-25 17:07:23 +08:00
David Carlier 4c027ea4ea Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/soap: Fix integer overflow when decoding SOAP array indexes
2026-05-19 20:14:34 +01:00
David Carlier 9d7207212f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/soap: Fix integer overflow when decoding SOAP array indexes
2026-05-19 20:14:22 +01:00
lamentxu f5db09db14 ext/soap: Fix integer overflow when decoding SOAP array indexes
close GH-21963
2026-05-19 20:14:05 +01:00
Ilija Tovilo 257cb3a57e Merge branch 'PHP-8.5'
* PHP-8.5:
  GHSA-wm6j-2649-pv75: [mbstring] Fix null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()
  GHSA-7qg2-v9fj-4mwv: [fpm] XSS within status endpoint
  GHSA-hmxp-6pc4-f3vv: [soap] Fix broken Apache map value NULL check
  GHSA-m33r-qmcv-p97q: [soap] Fix use-after-free after header parsing failure with SOAP_PERSISTENCE_SESSION
  GHSA-85c2-q967-79q5: [soap] Fix stale SOAP_GLOBAL(ref_map) pointer with Apache Map
2026-05-06 12:58:20 +02:00
Ilija Tovilo 9db4c1a4ca Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  GHSA-wm6j-2649-pv75: [mbstring] Fix null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()
  GHSA-7qg2-v9fj-4mwv: [fpm] XSS within status endpoint
  GHSA-hmxp-6pc4-f3vv: [soap] Fix broken Apache map value NULL check
  GHSA-m33r-qmcv-p97q: [soap] Fix use-after-free after header parsing failure with SOAP_PERSISTENCE_SESSION
  GHSA-85c2-q967-79q5: [soap] Fix stale SOAP_GLOBAL(ref_map) pointer with Apache Map
2026-05-06 12:58:00 +02:00
Ilija Tovilo a2ee688f48 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  GHSA-wm6j-2649-pv75: [mbstring] Fix null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()
  GHSA-7qg2-v9fj-4mwv: [fpm] XSS within status endpoint
  GHSA-hmxp-6pc4-f3vv: [soap] Fix broken Apache map value NULL check
  GHSA-m33r-qmcv-p97q: [soap] Fix use-after-free after header parsing failure with SOAP_PERSISTENCE_SESSION
  GHSA-85c2-q967-79q5: [soap] Fix stale SOAP_GLOBAL(ref_map) pointer with Apache Map
2026-05-06 12:57:56 +02:00
Ilija Tovilo 86bb29de34 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  GHSA-wm6j-2649-pv75: [mbstring] Fix null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()
  GHSA-7qg2-v9fj-4mwv: [fpm] XSS within status endpoint
  GHSA-hmxp-6pc4-f3vv: [soap] Fix broken Apache map value NULL check
  GHSA-m33r-qmcv-p97q: [soap] Fix use-after-free after header parsing failure with SOAP_PERSISTENCE_SESSION
  GHSA-85c2-q967-79q5: [soap] Fix stale SOAP_GLOBAL(ref_map) pointer with Apache Map
2026-05-06 12:57:51 +02:00
Ilija Tovilo 79551ab8b1 GHSA-hmxp-6pc4-f3vv: [soap] Fix broken Apache map value NULL check
Fixes GHSA-hmxp-6pc4-f3vv
Fixes CVE-2026-7262
2026-05-06 12:57:43 +02:00
Ilija Tovilo aee3b3ac9b GHSA-85c2-q967-79q5: [soap] Fix stale SOAP_GLOBAL(ref_map) pointer with Apache Map
Fixes GHSA-85c2-q967-79q5
Fixes CVE-2026-6722
2026-05-06 12:57:11 +02:00
Ben Ramsey d14aad1d7b license-update: ext/soap source headers
RFC: https://wiki.php.net/rfc/php_license_update
2026-04-11 21:20:54 -05:00
Marc Bennewitz f4d9ed1368 Use consistent type for h on call zend_hash_index_* (#19255) 2026-04-06 14:39:41 +01:00
Gina Peter Banyard 7f20223143 ext/soap: use zend_string_equals_literal() instead of strcmp() (#21405) 2026-03-10 20:13:05 +00:00
ndossche 9a73c009f3 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const violation
2026-03-10 21:08:56 +01:00
ndossche f33091c972 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const violation
2026-03-10 21:08:51 +01:00
ndossche c4c1261196 soap: Fix const violation 2026-03-10 21:06:20 +01:00
ndossche d3055912b7 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const-generic compile warning
2026-03-10 20:52:05 +01:00
ndossche bc0871dd3d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const-generic compile warning
2026-03-10 20:52:00 +01:00
ndossche ae0bf447b4 soap: Fix const-generic compile warning 2026-03-10 20:51:51 +01:00
Petr Sumbera ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Niels Dossche e82ed96bd6 soap: Fix comment (#20126)
The fallthrough isn't right, but it didn't matter as the loop will
definitely execute the return statement.
2025-10-11 18:05:18 +02:00
Niels Dossche 418c755b52 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:42:11 +02:00
Niels Dossche 7f9b6a8c2a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:41:59 +02:00
Niels Dossche 19f345c824 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20011: Array of SoapVar of unknown type causes crash
2025-10-02 19:39:25 +02:00
Niels Dossche eab2c2007b Fix GH-20011: Array of SoapVar of unknown type causes crash
We "guess" the type in this case, consistent with what a SoapVar would
do outside of an array.

Closes GH-20030.
2025-10-02 19:38:44 +02:00
Tim Düsterhus 45bbe8c36d soap: Use return true / return false for functions returning bool
Changes done with Coccinelle:

    @r1@
    identifier fn;
    typedef bool;
    symbol false;
    symbol true;
    @@

    bool fn ( ... )
    {
    <...
    return
    (
    - 0
    + false
    |
    - 1
    + true
    )
    ;
    ...>
    }

Coccinelle patch sourced from
torvalds/linux@46b5c9b856.
2025-09-24 18:51:40 +02:00
Niels Dossche d7f9caf37c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18640: heap-use-after-free ext/soap/php_encoding.c:299:32 in soap_check_zval_ref
2025-07-20 19:50:01 +02:00
Niels Dossche f8196a5db5 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18640: heap-use-after-free ext/soap/php_encoding.c:299:32 in soap_check_zval_ref
2025-07-20 19:49:56 +02:00