mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-18 14:36:38 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1daa19750 | ||
|
|
a0f6c5474e | ||
|
|
d84f56a4a7 | ||
|
|
d99c019535 | ||
|
|
e88dcdcdc8 | ||
|
|
5ffcee9d48 | ||
|
|
1fb7c0a459 |
No files matched your search
@@ -1,8 +1,10 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2020, PHP 7.4.11
|
||||
01 Oct 2020, PHP 7.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79699 (PHP parses encoded cookie names so malicious `__Host-`
|
||||
cookies can be sent). (CVE-2020-7070) (Stas)
|
||||
. Fixed bug #79979 (passing value to by-ref param via CUFA crashes). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #80037 (Typed property must not be accessed before initialization
|
||||
@@ -26,6 +28,10 @@ PHP NEWS
|
||||
. Fixed bug #79825 (opcache.file_cache causes SIGSEGV when custom opcode
|
||||
handlers changed). (SammyK)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12
|
||||
bytes IV). (CVE-2020-7069) (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
|
||||
many bind parameters (Matteo)
|
||||
|
||||
@@ -125,6 +125,11 @@ DOM:
|
||||
After: ReflectionMethod::getClosure($object = null)
|
||||
The new signature is also (LSP) compatible with older PHP versions.
|
||||
|
||||
- SAPI:
|
||||
. Starting with 7.4.11, incoming cookie names are not url-decoded. This was never
|
||||
required by the standard, outgoing cookie names aren't encoded and this leads
|
||||
to security issues (CVE-2020-7070).
|
||||
|
||||
- SPL:
|
||||
. Calling get_object_vars() on an ArrayObject instance will now always return
|
||||
the properties of the ArrayObject itself (or a subclass). Previously it
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice.
|
||||
dnl ----------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT([PHP],[7.4.11-dev],[https://bugs.php.net],[php],[https://www.php.net])
|
||||
AC_INIT([PHP],[7.4.11],[https://bugs.php.net],[php],[https://www.php.net])
|
||||
AC_CONFIG_SRCDIR([main/php_version.h])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_PRESERVE_HELP_ORDER
|
||||
|
||||
@@ -6521,11 +6521,6 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
|
||||
{
|
||||
char *iv_new;
|
||||
|
||||
/* Best case scenario, user behaved */
|
||||
if (*piv_len == iv_required_len) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (mode->is_aead) {
|
||||
if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) {
|
||||
php_error_docref(NULL, E_WARNING, "Setting of IV length for AEAD mode failed");
|
||||
@@ -6534,6 +6529,11 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* Best case scenario, user behaved */
|
||||
if (*piv_len == iv_required_len) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
iv_new = ecalloc(1, iv_required_len + 1);
|
||||
|
||||
if (*piv_len == 0) {
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
<?php
|
||||
$php_openssl_cipher_tests = array(
|
||||
'aes-128-ccm' => array(
|
||||
array(
|
||||
'key' => '404142434445464748494a4b4c4d4e4f',
|
||||
'iv' => '1011121314151617',
|
||||
'aad' => '000102030405060708090a0b0c0d0e0f',
|
||||
'tag' => '1fc64fbfaccd',
|
||||
'pt' => '202122232425262728292a2b2c2d2e2f',
|
||||
'ct' => 'd2a1f0e051ea5f62081a7792073d593d',
|
||||
),
|
||||
array(
|
||||
'key' => '404142434445464748494a4b4c4d4e4f',
|
||||
'iv' => '101112131415161718191a1b',
|
||||
'aad' => '000102030405060708090a0b0c0d0e0f' .
|
||||
'10111213',
|
||||
'tag' => '484392fbc1b09951',
|
||||
'pt' => '202122232425262728292a2b2c2d2e2f' .
|
||||
'3031323334353637',
|
||||
'ct' => 'e3b201a9f5b71a7a9b1ceaeccd97e70b' .
|
||||
'6176aad9a4428aa5',
|
||||
),
|
||||
),
|
||||
'aes-256-ccm' => array(
|
||||
array(
|
||||
'key' => '1bde3251d41a8b5ea013c195ae128b21' .
|
||||
|
||||
@@ -10,14 +10,16 @@ if (!in_array('aes-256-ccm', openssl_get_cipher_methods()))
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . "/cipher_tests.inc";
|
||||
$method = 'aes-256-ccm';
|
||||
$tests = openssl_get_cipher_tests($method);
|
||||
$methods = ['aes-128-ccm', 'aes-256-ccm'];
|
||||
|
||||
foreach ($tests as $idx => $test) {
|
||||
echo "TEST $idx\n";
|
||||
$pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
|
||||
$test['iv'], $test['tag'], $test['aad']);
|
||||
var_dump($test['pt'] === $pt);
|
||||
foreach ($methods as $method) {
|
||||
$tests = openssl_get_cipher_tests($method);
|
||||
foreach ($tests as $idx => $test) {
|
||||
echo "$method - TEST $idx\n";
|
||||
$pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
|
||||
$test['iv'], $test['tag'], $test['aad']);
|
||||
var_dump($test['pt'] === $pt);
|
||||
}
|
||||
}
|
||||
|
||||
// no IV
|
||||
@@ -32,7 +34,11 @@ var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
TEST 0
|
||||
aes-128-ccm - TEST 0
|
||||
bool(true)
|
||||
aes-128-ccm - TEST 1
|
||||
bool(true)
|
||||
aes-256-ccm - TEST 0
|
||||
bool(true)
|
||||
|
||||
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d
|
||||
|
||||
@@ -10,15 +10,17 @@ if (!in_array('aes-256-ccm', openssl_get_cipher_methods()))
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . "/cipher_tests.inc";
|
||||
$method = 'aes-256-ccm';
|
||||
$tests = openssl_get_cipher_tests($method);
|
||||
$methods = ['aes-128-ccm', 'aes-256-ccm'];
|
||||
|
||||
foreach ($tests as $idx => $test) {
|
||||
echo "TEST $idx\n";
|
||||
$ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA,
|
||||
$test['iv'], $tag, $test['aad'], strlen($test['tag']));
|
||||
var_dump($test['ct'] === $ct);
|
||||
var_dump($test['tag'] === $tag);
|
||||
foreach ($methods as $method) {
|
||||
$tests = openssl_get_cipher_tests($method);
|
||||
foreach ($tests as $idx => $test) {
|
||||
echo "$method - TEST $idx\n";
|
||||
$ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA,
|
||||
$test['iv'], $tag, $test['aad'], strlen($test['tag']));
|
||||
var_dump($test['ct'] === $ct);
|
||||
var_dump($test['tag'] === $tag);
|
||||
}
|
||||
}
|
||||
|
||||
// Empty IV error
|
||||
@@ -32,7 +34,13 @@ var_dump(strlen($tag));
|
||||
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 16), $tag, '', 1024));
|
||||
?>
|
||||
--EXPECTF--
|
||||
TEST 0
|
||||
aes-128-ccm - TEST 0
|
||||
bool(true)
|
||||
bool(true)
|
||||
aes-128-ccm - TEST 1
|
||||
bool(true)
|
||||
bool(true)
|
||||
aes-256-ccm - TEST 0
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
|
||||
@@ -514,7 +514,9 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
|
||||
}
|
||||
|
||||
val = estrndup(val, val_len);
|
||||
php_url_decode(var, strlen(var));
|
||||
if (arg != PARSE_COOKIE) {
|
||||
php_url_decode(var, strlen(var));
|
||||
}
|
||||
if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len)) {
|
||||
php_register_variable_safe(var, val, new_val_len, &array);
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 4
|
||||
#define PHP_RELEASE_VERSION 11
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.4.11-dev"
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "7.4.11"
|
||||
#define PHP_VERSION_ID 70411
|
||||
@@ -10,7 +10,7 @@ cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=
|
||||
var_dump($_COOKIE);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(10) {
|
||||
array(12) {
|
||||
["cookie1"]=>
|
||||
string(6) "val1 "
|
||||
["cookie2"]=>
|
||||
@@ -19,11 +19,15 @@ array(10) {
|
||||
string(6) "val 3."
|
||||
["cookie_4"]=>
|
||||
string(10) " value 4 ;"
|
||||
["%20cookie1"]=>
|
||||
string(6) "ignore"
|
||||
["+cookie1"]=>
|
||||
string(6) "ignore"
|
||||
["cookie__5"]=>
|
||||
string(7) " value"
|
||||
["cookie_6"]=>
|
||||
["cookie%206"]=>
|
||||
string(3) "þæö"
|
||||
["cookie_7"]=>
|
||||
["cookie+7"]=>
|
||||
string(0) ""
|
||||
["$cookie_8"]=>
|
||||
string(0) ""
|
||||
|
||||
@@ -10,9 +10,11 @@ c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","valu
|
||||
var_dump($_COOKIE);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
array(4) {
|
||||
["c_o_o_k_i_e"]=>
|
||||
string(5) "value"
|
||||
["c%20o+o_k+i%20e"]=>
|
||||
string(1) "v"
|
||||
["name"]=>
|
||||
string(24) ""value","value",UEhQIQ=="
|
||||
["UEhQIQ"]=>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Cookies Security Bug
|
||||
--INI--
|
||||
max_input_vars=1000
|
||||
filter.default=unsafe_raw
|
||||
--COOKIE--
|
||||
__%48ost-evil=evil; __Host-evil=good; %66oo=baz;foo=bar
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_COOKIE);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(4) {
|
||||
["__%48ost-evil"]=>
|
||||
string(4) "evil"
|
||||
["__Host-evil"]=>
|
||||
string(4) "good"
|
||||
["%66oo"]=>
|
||||
string(3) "baz"
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
Reference in new issue
Block a user