Commit graph

110730 commits

Author SHA1 Message Date
Christoph M. Becker
f15f8fc573
Fix #79971: special character is breaking the path in xml function
The libxml based XML functions accepting a filename actually accept
URIs with possibly percent-encoded characters.  Percent-encoded NUL
bytes lead to truncation, like non-encoded NUL bytes would.  We catch
those, and let the functions fail with a respective warning.
2021-11-14 23:24:33 -08:00
Derick Rethans
88f99c9c1d Revert "Updated to version 2021.5 (2021e)"
This reverts commit a93ff1df20.
2021-11-03 16:13:05 +00:00
Derick Rethans
a93ff1df20 Updated to version 2021.5 (2021e) 2021-11-03 15:49:23 +00:00
Christoph M. Becker
5f4e034e57
[ci skip] Fix typo (Okt → Oct) 2021-10-26 16:26:23 +02:00
Jakub Zelenka
f47798e685
Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
(cherry picked from commit cb2021e5f6)

Closes GH-7614.
2021-10-26 16:03:33 +02:00
Derick Rethans
32c0850b4a Revert "Updated to version 2021.3 (2021c)"
This reverts commit e81554c6e6.
2021-10-08 13:12:50 +01:00
Derick Rethans
e81554c6e6 Updated to version 2021.3 (2021c) 2021-10-08 12:54:50 +01:00
Christoph M. Becker
f2f40b1cf7
7.3.32 is next 2021-09-21 13:18:08 +02:00
Christoph M. Becker
96a5b4e43a
[ci skip] Add missing CVE to NEWS 2021-09-21 13:02:42 +02:00
Christoph M. Becker
bb84722364
[ci skip] Add missing NEWS entry 2021-09-21 11:43:36 +02:00
Nikita Popov
549cb4406e
Fix persistent smart_str allocation
This would allocate a too small buffer if the first smart_str
allocation is > SMART_STR_START_LEN but <= SMART_STR_START_SIZE.

(cherry picked from commit af8fccee9c)
2021-09-21 10:52:43 +02:00
Christoph M. Becker
df2ceac25a
Fix #81420: ZipArchive::extractTo extracts outside of destination
We need to properly detect and handle absolute paths in a portable way.
2021-09-20 21:29:24 -07:00
Christoph M. Becker
521bd7ce15
7.3.31 is next 2021-08-24 12:47:21 +02:00
Stanislav Malyshev
b815645aac
Fix test 2021-08-23 23:43:32 -07:00
Stanislav Malyshev
b2008ab97d
Update NEWS 2021-08-23 23:28:27 -07:00
Christoph M. Becker
2ff853aa11
Fix #81211: Symlinks are followed when creating PHAR archive
It is insufficient to check whether the `base` is contained in `fname`;
we also need to ensure that `fname` is properly separated.  And of
course, `fname` has to start with `base`.
2021-08-23 23:25:16 -07:00
Christoph M. Becker
53ea910d17
7.3.30 is next 2021-06-29 14:14:53 +02:00
Christoph M. Becker
f5cba2d491
[ci skip] Fix NEWS format 2021-06-29 10:28:35 +02:00
Stanislav Malyshev
c68a687566
Update NEWS 2021-06-20 22:20:38 -07:00
Christoph M. Becker
67afa32541
Fix #76448: Stack buffer overflow in firebird_info_cb
We ensure not to overflow the stack allocated buffer by using `strlcat`.
2021-06-20 22:01:06 -07:00
Christoph M. Becker
08da7c7372
Fix #76449: SIGSEGV in firebird_handle_doer
We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_vax_integer()` has a permissible value; otherwise we bail out.
2021-06-20 21:59:51 -07:00
Christoph M. Becker
bcbf8aa0c9
Fix #76450: SIGSEGV in firebird_stmt_execute
We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_vax_integer()` has a permissible value; otherwise we bail out.
2021-06-20 21:59:37 -07:00
Christoph M. Becker
286162e9b0
Fix #76452: Crash while parsing blob data in firebird_fetch_blob
We need to prevent integer overflow when calling `erealloc()` with
`len+1`.
2021-06-20 21:56:07 -07:00
Christoph M. Becker
a5538c6229
Fix #81122: SSRF bypass in FILTER_VALIDATE_URL
We need to ensure that the password detected by parse_url() is actually
a valid password; we can re-use is_userinfo_valid() for that.
2021-06-20 21:49:49 -07:00
Christoph M. Becker
98c8ad9218
7.3.29 is next 2021-04-27 16:55:20 +02:00
Christoph M. Becker
096f148c61
Fix ./makedist wrt. to GH move
We can no longer export from git.php.net, and apparently exporting from
Github is not supported.  We apply a quick fix to export from the local
clone by default, still leaving an option to export from some other
repo.  This is, unfortunately, a minor BC break in a security release.

Co-authored-by: Remi Collet <remi@php.net>

Closes GH-6919.
2021-04-27 15:48:58 +02:00
Christoph M. Becker
60a68a45c3
Add missing NEWS entry for #80710 2021-04-27 13:38:39 +02:00
Christoph M. Becker
37962c61d2
Fix #80710: imap_mail_compose() header injection
Like `mail()` and `mb_send_mail()`, `imap_mail_compose()` must prevent
header injection.  For maximum backward compatibility, we still allow
header folding for general headers, and still accept trailing line
breaks for address lists.
2021-04-26 21:43:03 -07:00
Stanislav Malyshev
1b88c85cd8
Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
Sorry, this solution seems to have BC breaks, will need to look
for better one.

This reverts commit 9f7e8b777c.
2021-04-26 21:01:25 -07:00
Christoph M. Becker
9f7e8b777c
Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
We ignore `XML_ENTITY_DECL` nodes when getting the hash of the
properties of a `SimpleXMLElement`.
2021-04-26 20:43:45 -07:00
Dylan K. Taylor
729cd8bacd run-tests: fixed exit code not being set on BORKED tests
When no test paths are specified this shows up when 'make test' is used on a PECL extension without specifying tests to run (or in php-src too, I guess...)

Closes GH-6717.
2021-02-23 12:50:03 +01:00
Nikita Popov
06c9633b43 Fix newly introduced compiler warning
(cherry picked from commit ab8177de2c)
2021-02-03 12:42:28 +01:00
Christoph M. Becker
039ca4e219 7.3.28 is next 2021-02-02 17:01:55 +01:00
Christoph M. Becker
57257a4335 Revert "Updated to version 2021.1 (2021a)"
This reverts commit 491488d217, since
PHP-7.3 is in security mode, and this does not look security related.
2021-02-01 13:41:32 +01:00
Stanislav Malyshev
3c939e3f69 Fix bug #80672 - Null Dereference in SoapClient 2021-01-31 21:15:23 -08:00
Stanislav Malyshev
9c673083cd Rm unneeded function 2021-01-27 00:13:43 -08:00
Christoph M. Becker
4a89e726bd Alternative fix for bug 77423
That bug report originally was about `parse_url()` misbehaving, but the
security aspect was actually only regarding `FILTER_VALIDATE_URL`.
Since the changes to `parse_url_ex()` apparently affect userland code
which is relying on the sloppy URL parsing[1], this alternative
restores the old parsing behavior, but ensures that the userinfo is
checked for correctness for `FILTER_VALIDATE_URL`.

[1] <5174de7cd3 (commitcomment-45967652)>
2021-01-26 22:54:58 -08:00
Derick Rethans
491488d217 Updated to version 2021.1 (2021a) 2021-01-25 10:44:04 +00:00
Stanislav Malyshev
65d7ade684 [ci skip] Fix order 2021-01-04 01:45:15 -08:00
Stanislav Malyshev
8967e66559 [ci skip] Unpdate NEWS 2021-01-04 01:43:45 -08:00
Stanislav Malyshev
128fca4037 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77423: parse_url() will deliver a wrong host to user
2021-01-01 21:06:07 -08:00
Christoph M. Becker
2d3d72412a Fix #77423: parse_url() will deliver a wrong host to user
To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.
2021-01-01 20:08:01 -08:00
Christoph M. Becker
40d9e3ab86 7.3.27 is next 2020-12-15 11:28:01 +01:00
Daniel Black
0697a64f7e Fix mysqli_expire_password test for mariadb
In MariaDB-10.4.3 EXPIRE passwords where supported for
MariaDB. This only behaves like MySQL when the system
variable disconnect_on_expired_passwords=1.

MariaDB if there was no password it could not be considered
expired. So the test is adjusted to use actual passwords.
(MariaDB commit a94b20a8e0d9e64eeaabdaaa7a3e03fcdb8a686e)

The error codes produced my MariaDB are different
however still conforming to the SQL specification.

Closes GH-6480.
2020-12-03 10:56:00 +01:00
Nikita Popov
d6fcaf5da4 Fixed bug #80457
On x32 sizeof(size_t) != sizeof(zend_long), so we need to be
careful with sign extension here.

Patch by bruno dot premont at restena dot lu.
2020-12-02 11:26:10 +01:00
Jakub Zelenka
685708160e Fix test for bug62890 to not depend on system cert store 2020-11-27 16:32:43 +00:00
Daniel Black
4a10037cb4 Fix mysqli_get_client_stats test
MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0
(Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it.

It also breaks when testing against MariaDB.

As the alternate path in this test covers all supported MySQL and MariaDB
versions and a signifant portion of unsupported versions lets keep it simple.

Closes GH-6459.
2020-11-27 11:43:34 +01:00
Christoph M. Becker
b5ce6df0da 7.3.26 is next 2020-11-10 11:08:16 +01:00
Alexander M. Turek
8eaaabdd58 Fixed bug #80310: Support for icu4c 68.1.
On stable versions, bring back the TRUE/FALSE defines by defining
_U_DEFINE_TRUE_AND_FALSE.

Closes GH-6397.
2020-11-09 14:31:29 +01:00
Christoph M. Becker
2cab085bb3 Fix #80266: parse_url silently drops port number 0
As of commit 81b2f3e[1], `parse_url()` accepts URLs with a zero port,
but does not report that port, what is wrong in hindsight.

Since the port number is stored as `unsigned short` there is no way to
distinguish between port zero and no port.  For BC reasons, we thus
introduce `parse_url_ex2()` which accepts an output parameter that
allows that distinction, and use the new function to fix the behavior.

The introduction of `parse_url_ex2()` has been suggested by Nikita.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=81b2f3e5d9fcdffd87a4fcd12bd8c708a97091e1>

Closes GH-6399.
2020-11-04 14:53:19 +01:00