Skip to content

Commit c34895e

Browse files
committed
Fix bug #77967 - Bypassing open_basedir restrictions via file uris
1 parent 73ff419 commit c34895e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

NEWS

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PHP NEWS
33
?? ??? 2019, PHP 7.1.30
44

55
- EXIF:
6-
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
6+
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
77
(CVE-2019-11040) (Stas)
88

99
- GD:
@@ -14,6 +14,9 @@ PHP NEWS
1414
. Fixed bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode()
1515
due to integer overflow). (CVE-2019-11039). (maris dot adam)
1616

17+
- SQLite:
18+
. Fixed bug #77967 (Bypassing open_basedir restrictions via file uris). (Stas)
19+
1720
03 May 2019, PHP 7.1.29
1821

1922
- EXIF:
@@ -28,8 +31,8 @@ PHP NEWS
2831
- EXIF:
2932
. Fixed bug #77753 (Heap-buffer-overflow in php_ifd_get32s). (CVE-2019-11034)
3033
(Stas)
31-
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value).
32-
(CVE-2019-11035) (Stas)
34+
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value).
35+
(CVE-2019-11035) (Stas)
3336

3437
- SQLite3:
3538
. Added sqlite3.defensive INI directive. (BohwaZ)

ext/sqlite3/sqlite3.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,15 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
20342034
case SQLITE_ATTACH:
20352035
{
20362036
if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
2037+
if (strncmp(arg3, "file:", 5) == 0) {
2038+
/* starts with "file:" */
2039+
if (!arg3[5]) {
2040+
return SQLITE_DENY;
2041+
}
2042+
if (php_check_open_basedir(arg3 + 5)) {
2043+
return SQLITE_DENY;
2044+
}
2045+
}
20372046
if (php_check_open_basedir(arg3)) {
20382047
return SQLITE_DENY;
20392048
}

0 commit comments

Comments
 (0)