php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24333 stat() and file_exists() is neither affected by safe_mode nor open_basedir
Submitted: 2003-06-25 07:31 UTC Modified: 2005-01-31 23:21 UTC
From: david at darville dot name Assigned:
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 4.3.2 OS: RedHat Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at darville dot name
New email:
PHP Version: OS:

 

 [2003-06-25 07:31 UTC] david at darville dot name
Description:
------------
Even when safe mode is enabled, and open_basedir restrictions is in place, it is possible to use file_exists(), stat() (and fileperms()) on any file on the system.


Reproduce code:
---------------
$filename = "/etc/shadow";
if (file_exists($filename))
{
  echo "$filename exists\n";
}
else
{
  echo "$filename does not exist\n";
}

$stat = stat($filename);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-25 10:32 UTC] sniper@php.net
Already fixed in CVS.

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 15:01:23 2020 UTC