Commit Graph

1523 Commits

Author SHA1 Message Date
Christoph M. Becker
85874af404 Remove obsolete oniguruma.patch
The proper `SIZEOF_SIZE_T` definitions are available as of Oniguruma
6.9.1; no more need to patch.
2019-11-05 10:16:22 +01:00
Christoph M. Becker
4f50d58cab Fix #78633: Heap buffer overflow (read) in mb_eregi
We backport kkos/oniguruma@15c4228aa2.
2019-10-20 22:47:38 -07:00
Christoph M. Becker
2046b3ce4f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:04:54 +02:00
Christoph M. Becker
45db6fa567 Fix #78609: mb_check_encoding() no longer supports stringable objects
We apply type juggling for other types than array.
2019-09-30 12:42:04 +02:00
Christoph M. Becker
8f949eba80 Fix #78559: Heap buffer overflow in mb_eregi
We backport kkos/oniguruma@d3e402928b.
2019-09-23 21:49:55 -07:00
Christoph M. Becker
698088ca7c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78579: mb_decode_numericentity: args number inconsistency
2019-09-21 16:16:52 +02:00
Christoph M. Becker
398b308316 Fix #78579: mb_decode_numericentity: args number inconsistency
mb_decode_numericentity() accepts a fourth optional parameter, which is
unused, however.  Since this parameter doesn't do any harm, and to avoid
the small BC break, we're keeping this parameter for PHP 7, but adjust
the arginfo.

For PHP 8, we will remove this parameter.
2019-09-21 16:15:23 +02:00
Stanislav Malyshev
5748cec3ee Upgrade oniguruma lib to 6.9.3 2019-08-27 23:40:46 -07:00
Stanislav Malyshev
d3f2cfe20a Update Oniguruma to 6.9.1 2019-08-25 00:02:32 -07:00
Stanislav Malyshev
5704eca6f7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
  set version for release
2019-08-24 23:16:09 -07:00
Stanislav Malyshev
087cb7bab2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
  set version for release
2019-08-24 23:15:36 -07:00
Stanislav Malyshev
1258303e66 Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
Backport from 0f7f61ed1b
2019-08-24 23:11:45 -07:00
Nikita Popov
354a1c27aa Merge branch 'PHP-7.2' into PHP-7.3 2019-04-12 10:37:08 +02:00
Nikita Popov
3b53d28e60 Fix key leaks in mb_convert_encoding() 2019-04-12 10:36:58 +02:00
Nikita Popov
a61d24e4d8 Avoid onig match param unused variable warning 2019-04-11 12:35:24 +02:00
Stanislav Malyshev
bc8f292c05 Merge branch 'mb-limit-73' into PHP-7.3
* mb-limit-73:
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:00:14 -07:00
Stanislav Malyshev
e12c069d33 Add fallbacks for older oniguruma versions 2019-03-30 23:18:33 -07:00
Matteo Beccati
263c587854 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:29:49 +01:00
Matteo Beccati
f030f34622 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed SKIPIF when --disable-mbregex is used
2019-03-30 18:29:44 +01:00
Matteo Beccati
0dbb581cf4 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:28:33 +01:00
Stanislav Malyshev
66c35b083b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:42:56 -07:00
Stanislav Malyshev
402adc1df1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:35:22 -07:00
Yasuo Ohgaki
738016bd88 Implement RF bug #72777 - ensure stack limits on mbstring functions.
The patch creates new config: mbstring.regex_stack_limit, which
defaults to 100000.
2019-03-28 00:31:57 -07:00
Nikita Popov
0ecac37c40 Validate subject encoding in mb_split and mb_ereg_match
We were already validating the subject encoding in most functions,
but not these two.
2019-03-27 23:20:27 -07:00
Nikita Popov
40fe50daf6 Validate pattern against mbregex encoding
Oniguruma does not consistently perform this validation itself (at least
on older versions), so make sure we check pattern encoding validity on the
PHP side.
2019-03-27 23:19:46 -07:00
Nikita Popov
3c98c2d0cb Fixed bug #77514 2019-01-24 15:13:49 +01:00
Nikita Popov
d6212835f2 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-14 10:23:44 +01:00
Nikita Popov
3ad0ebdf5c Fixed bug #77454 2019-01-14 10:22:48 +01:00
Nikita Popov
76c687feaf Fixed bug #77428
mb_ereg_replace historically has not supported escaping backslashes
with backslashes. Go back to that behavior for BC reasons.
2019-01-08 10:21:01 +01:00
Remi Collet
b9072788cd Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  cleanup merge
2019-01-08 09:34:05 +01:00
Remi Collet
0d9935739c cleanup merge 2019-01-08 09:33:41 +01:00
Stanislav Malyshev
aeec40cb50 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  Add NEWS
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:35:09 -08:00
Stanislav Malyshev
cfe77ea543 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  Add NEWS
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:34:26 -08:00
Stanislav Malyshev
1afebfb3fa Merge branch 'PHP-5.6' into PHP-7.1
* PHP-5.6:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:33:34 -08:00
Stanislav Malyshev
9d6c59eeea Fix bug #77418 - Heap overflow in utf32be_mbc_to_code 2019-01-06 23:31:15 -08:00
Stanislav Malyshev
7ed3cfb2e8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests - newer versions check Unicode
  Add NEWS
  Fix test
2019-01-06 13:50:28 -08:00
Stanislav Malyshev
d0d0d922de Fix tests - newer versions check Unicode 2019-01-06 13:28:30 -08:00
Christoph M. Becker
e617f03066 Fix #77367: Negative size parameter in mb_split
When adding the last element to the result value of `mb_split`, the
`chunk_pos` may point beyond the end of the string, in which case the
unsigned `n` would underflow.  Therefore, we check whether this is the
case in the first place, and only calculate `n` otherwise.  Since `n`
is no longer used outside the block, we move its declaration inside.
2019-01-06 12:24:15 -08:00
Stanislav Malyshev
e40027ef0f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 12:23:53 -08:00
Stanislav Malyshev
fe820fcba6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 11:57:16 -08:00
Stanislav Malyshev
31f59e1f30 Fix more issues with encodilng length
Should fix bug #77381, bug #77382, bug #77385, bug #77394.
2019-01-06 11:38:46 -08:00
Stanislav Malyshev
c6e34d91b8 Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) 2019-01-06 11:38:46 -08:00
Stanislav Malyshev
deb06bbb9c Fix bug #77370 - check that we do not read past buffer end when parsing multibytes 2019-01-06 11:38:46 -08:00
Stanislav Malyshev
c95daa9c75 Fix more issues with encodilng length
Should fix bug #77381, bug #77382, bug #77385, bug #77394.
2019-01-06 11:34:27 -08:00
Stanislav Malyshev
28362ed4fa Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) 2019-01-06 11:33:54 -08:00
Stanislav Malyshev
20407d06ca Fix bug #77370 - check that we do not read past buffer end when parsing multibytes 2019-01-06 11:33:44 -08:00
Nikita Popov
dee5a450d9 Fixed bug #77165
Also add some helper macros for PROTECT/UNPROTECT that check for
IMMUTABLE. These checks are needed for nearly any use of
PROTECT/UNPROTECT.
2018-11-15 17:16:39 +01:00
Nikita Popov
09c7108f74 Fix mb_strrpos() with encoding passed as 3rd param 2018-10-29 18:56:17 +01:00
Nikita Popov
1151554668 Remove the "auto" encoding
"auto" is only meaningful in functions which accept an encoding
*list* and support encoding detection. These functions have
explicit checks for "auto". It cannot be used as a standalone
encoding in any meaningful capacity, so I'm dropping it entirely.
2018-10-17 12:50:24 +02:00
Nikita Popov
56665a1b17 Fixed bug #77025
Implements 8bit conversions equivalently to iso-8859-1 conversions.
This seems quite dubious to me, but seems to match the previous
behavior.

It might make more sense to map the characters into a private area
instead, so that the 8bit encoding is treated as binary data with
no case conversions (including no case conversions in the ascii
range).
2018-10-17 12:38:31 +02:00