Bug #76296 [NEW]: openssl_pkey_get_public does not respect open_basedir
| From: | erik at datahack dot se | Date: | Wed, 02 May 2018 20:39:25 +0000 |
| Subject: | Bug #76296 [NEW]: openssl_pkey_get_public does not respect open_basedir | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215025@lists.php.net to get a copy of this message | ||
From: erik at datahack dot se
Operating system:
PHP version: Irrelevant
Package: OpenSSL related
Bug Type: Bug
Bug description:openssl_pkey_get_public does not respect open_basedir
Description:
------------
Not all paths check for open_basedir, move the check to make sure it's
always done.
https://github.com/php/php-src/pull/3230
Test script:
---------------
<?php
ini_set('open_basedir', '/xyz/');
var_dump(openssl_pkey_get_public("file://cert.pem")); // cert.pem must
exist
Expected result:
----------------
Warning: openssl_pkey_get_public(): open_basedir restriction in effect.
File(cert.pem) is not within the allowed path(s): (/xyz/) in ... on line
3
bool(false)
Actual result:
--------------
Warning: openssl_pkey_get_public(): open_basedir restriction in effect.
File(cert.pem) is not within the allowed path(s): (/xyz/) in ... on line
3
resource(4) of type (OpenSSL key)
--
Edit bug report at https://bugs.php.net/bug.php?id=76296&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76296&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76296&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76296&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76296&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76296&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76296&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76296&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76296&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76296&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76296&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76296&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76296&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76296&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76296&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76296&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76296&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76296&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76296&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76296&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76296&r=mysqlcfg