Compare commits

...
4 Commits
Author SHA1 Message Date
Christoph M. Becker 335008f6b2 Prepare PHP 7.3.11 2019-10-22 09:15:41 +02:00
Christoph M. Becker 126018250e Fix #78633: Heap buffer overflow (read) in mb_eregi
We backport kkos/oniguruma@15c4228aa2.

(cherry picked from commit 4f50d58cab)
2019-10-22 09:12:53 +02:00
Jakub Zelenka 19e17d3807 Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043)
(cherry picked from commit ab061f95ca)
2019-10-22 09:11:10 +02:00
Christoph M. Becker 12cca48ff6 Prepare 7.3.11RC1 2019-10-08 11:51:47 +02:00
10 changed files with 95 additions and 10 deletions

No files matched your search

+4 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.11
24 Oct 2019, PHP 7.3.11
- Core:
. Fixed bug #78535 (auto_detect_line_endings value not parsed as bool).
@@ -12,10 +12,13 @@ PHP NEWS
(Kalle)
- FPM:
. Fixed bug #78599 (env_path_info underflow in fpm_main.c can lead to RCE).
(CVE-2019-11043) (Jakub Zelenka)
. Fixed bug #78413 (request_terminate_timeout does not take effect after
fastcgi_finish_request). (Sergei Turchanov)
- MBString:
. Fixed bug #78633 (Heap buffer overflow (read) in mb_eregi). (cmb)
. Fixed bug #78579 (mb_decode_numericentity: args number inconsistency).
(cmb)
. Fixed bug #78609 (mb_check_encoding() no longer supports stringable
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.11-dev"
#define ZEND_VERSION "3.3.11"
#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=11
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`
+1 -1
View File
@@ -724,8 +724,8 @@ add_compile_string(UChar* s, int mb_len, int str_len,
COP(reg)->exact_n.s = p;
}
else {
xmemset(COP(reg)->exact.s, 0, sizeof(COP(reg)->exact.s));
xmemcpy(COP(reg)->exact.s, s, (size_t )byte_len);
COP(reg)->exact.s[byte_len] = '\0';
}
return 0;
+1
View File
@@ -2900,6 +2900,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
DATA_ENSURE(0);
q = lowbuf;
while (len-- > 0) {
if (ps >= endp) goto fail;
if (*ps != *q) goto fail;
ps++; q++;
}
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #78633 (Heap buffer overflow (read) in mb_eregi)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
if (!function_exists('mb_eregi')) die('skip mb_eregi function not available');
?>
--FILE--
<?php
var_dump(mb_eregi(".+Isssǰ", ".+Isssǰ"));
?>
--EXPECT--
bool(false)
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 11
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.3.11-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.3.11"
#define PHP_VERSION_ID 70311
+2 -2
View File
@@ -1148,8 +1148,8 @@ static void init_request_info(void)
path_info = script_path_translated + ptlen;
tflag = (slen != 0 && (!orig_path_info || strcmp(orig_path_info, path_info) != 0));
} else {
path_info = env_path_info ? env_path_info + pilen - slen : NULL;
tflag = (orig_path_info != path_info);
path_info = (env_path_info && pilen > slen) ? env_path_info + pilen - slen : NULL;
tflag = path_info && (orig_path_info != path_info);
}
if (tflag) {
@@ -0,0 +1,61 @@
--TEST--
FPM: bug78599 - env_path_info underflow - CVE-2019-11043
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
require_once "tester.inc";
$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = dynamic
pm.max_children = 5
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
EOT;
$code = <<<EOT
<?php
echo "Test Start\n";
var_dump(\$_SERVER["PATH_INFO"]);
echo "Test End\n";
EOT;
$tester = new FPM\Tester($cfg, $code);
$tester->start();
$tester->expectLogStartNotices();
$uri = $tester->makeSourceFile();
$tester
->request(
'',
[
'SCRIPT_FILENAME' => $uri . "/" . str_repeat('A', 35),
'PATH_INFO' => '',
'HTTP_HUI' => str_repeat('PTEST', 1000),
],
$uri
)
->expectBody(
[
'Test Start',
'string(0) ""',
'Test End'
]
);
$tester->terminate();
$tester->close();
?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>
+9 -2
View File
@@ -513,7 +513,7 @@ class Tester
return new Response(null, true);
}
if (is_null($uri)) {
$uri = $this->makeFile('src.php', $this->code);
$uri = $this->makeSourceFile();
}
$params = array_merge(
@@ -538,7 +538,6 @@ class Tester
],
$headers
);
try {
$this->response = new Response(
$this->getClient($address, $connKeepAlive)->request_data($params, false)
@@ -944,6 +943,14 @@ class Tester
return $filePath;
}
/**
* @return string
*/
public function makeSourceFile()
{
return $this->makeFile('src.php', $this->code);
}
/**
* @param string|null $msg
*/