#41655 [Opn->Asn]: open_basedir bypass via glob()

From: Date: Tue, 12 Jun 2007 12:41:46 +0000
Subject: #41655 [Opn->Asn]: open_basedir bypass via glob()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113698@lists.php.net to get a copy of this message
 ID:               41655
 Updated by:       iliaa@php.net
 Reported By:      dr at peytz dot dk
-Status:           Open
+Status:           Assigned
 Bug Type:         Safe Mode/open_basedir
 Operating System: Linux
 PHP Version:      5.2.3
-Assigned To:      
+Assigned To:      iliaa


Previous Comments:
------------------------------------------------------------------------

[2007-06-11 17:14:02] dr at peytz dot dk

Description:
------------
file_exists() etc. does not allow checking the existence of files
outside the directories specified in open_basedir.

This can be circumvented using glob(). glob() does check open_basedir,
but its return type still reveals whether files exist outside
open_basedir. The existence of a file can be checked using
!is_array(glob($filename)).


Reproduce code:
---------------
var_dump(glob('/etc/hosts'));
var_dump(glob('/etc/does-not-exist'));


Expected result:
----------------
bool(false)
bool(false)

or

array(0) {
}
array(0) {
}


Actual result:
--------------
bool(false)
array(0) {
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41655&edit=1


Thread (10 messages)

« previous php.bugs (#113698) next »