Compare commits

...
Author SHA1 Message Date
Christoph M. Becker 4b2854db6f Bump version 2020-01-21 09:17:45 +01:00
Stanislav Malyshev a8a6242db7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`)
  Fix #79099: OOB read in php_strip_tags_ex
  Fix #79091: heap use-after-free in session_create_id()

(cherry picked from commit 25ec7eb346)
2020-01-21 09:15:37 +01:00
Christoph M. Becker 793d775b04 Bump version 2020-01-07 10:15:39 +01:00
10 changed files with 128 additions and 10 deletions

No files matched your search

+9 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.14
23 Jan 2020, PHP 7.3.14
- Core
. Fixed bug #78999 (Cycle leak when using function result as temporary).
@@ -30,6 +30,10 @@ PHP NEWS
- Libxml:
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
- Mbstring:
. Fixed bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`).
(CVE-2020-7060) (Nikita)
- OPcache:
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
@@ -45,10 +49,14 @@ PHP NEWS
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
Kentarō)
- Session:
. Fixed bug #79091 (heap use-after-free in session_create_id()). (cmb, Nikita)
- Shmop:
. Fixed bug #78538 (shmop memory leak). (cmb)
- Standard:
. Fixed bug #79099 (OOB read in php_strip_tags_ex). (CVE-2020-7059). (cmb)
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
(cmb)
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.14-dev"
#define ZEND_VERSION "3.3.14"
#define ZEND_ENGINE_3
+1 -1
View File
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=14
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+2 -2
View File
@@ -145,10 +145,10 @@ static unsigned short cp950_pua_tbl[][4] = {
static inline int is_in_cp950_pua(int c1, int c) {
if ((c1 >= 0xfa && c1 <= 0xfe) || (c1 >= 0x8e && c1 <= 0xa0) ||
(c1 >= 0x81 && c1 <= 0x8d) || (c1 >= 0xc7 && c1 <= 0xc8)) {
return (c > 0x39 && c < 0x7f) || (c > 0xa0 && c < 0xff);
return (c >=0x40 && c <= 0x7e) || (c >= 0xa1 && c <= 0xfe);
}
if (c1 == 0xc6) {
return c > 0xa0 && c < 0xff;
return c >= 0xa1 && c <= 0xfe;
}
return 0;
}
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #79037: global buffer-overflow in `mbfl_filt_conv_big5_wchar`
--FILE--
<?php
var_dump(mb_convert_encoding("\x81\x3a", "UTF-8", "CP950"));
?>
--EXPECT--
string(1) "?"
+1
View File
@@ -2287,6 +2287,7 @@ static PHP_FUNCTION(session_create_id)
/* Detect collision and retry */
if (PS(mod)->s_validate_sid(&PS(mod_data), new_id) == FAILURE) {
zend_string_release_ex(new_id, 0);
new_id = NULL;
continue;
}
break;
+67
View File
@@ -0,0 +1,67 @@
--TEST--
Bug #79091 (heap use-after-free in session_create_id())
--SKIPIF--
<?php
if (!extension_loaded('session')) die('skip session extension not available');
?>
--FILE--
<?php
class MySessionHandler implements SessionHandlerInterface, SessionIdInterface, SessionUpdateTimestampHandlerInterface
{
public function close()
{
return true;
}
public function destroy($session_id)
{
return true;
}
public function gc($maxlifetime)
{
return true;
}
public function open($save_path, $session_name)
{
return true;
}
public function read($session_id)
{
return '';
}
public function write($session_id, $session_data)
{
return true;
}
public function create_sid()
{
return uniqid();
}
public function updateTimestamp($key, $val)
{
return true;
}
public function validateId($key)
{
return false;
}
}
ob_start();
var_dump(session_set_save_handler(new MySessionHandler()));
var_dump(session_start());
ob_flush();
session_create_id();
?>
--EXPECTF--
bool(true)
bool(true)
Warning: session_create_id(): Failed to create new ID in %s on line %d
+3 -3
View File
@@ -5164,7 +5164,7 @@ state_1:
}
lc = '>';
if (is_xml && *(p -1) == '-') {
if (is_xml && p >= buf + 1 && *(p -1) == '-') {
break;
}
in_q = state = is_xml = 0;
@@ -5196,7 +5196,7 @@ state_1:
goto reg_char_1;
case '!':
/* JavaScript & Other HTML scripting languages */
if (*(p-1) == '<') {
if (p >= buf + 1 && *(p-1) == '<') {
state = 3;
lc = c;
p++;
@@ -5206,7 +5206,7 @@ state_1:
}
break;
case '?':
if (*(p-1) == '<') {
if (p >= buf + 1 && *(p-1) == '<') {
br=0;
state = 2;
p++;
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #79099 (OOB read in php_strip_tags_ex)
--FILE--
<?php
$stream = fopen('php://memory', 'w+');
fputs($stream, "<?\n\"\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
$stream = fopen('php://memory', 'w+');
fputs($stream, "<\0\n!\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
$stream = fopen('php://memory', 'w+');
fputs($stream, "<\0\n?\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
?>
--EXPECT--
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 14
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.3.14-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.3.14"
#define PHP_VERSION_ID 70314