note 107654 added to security.apache
| From: | bk2atmedotcom | Date: | Fri, 24 Feb 2012 05:17:41 +0000 |
| Subject: | note 107654 added to security.apache | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186330@lists.php.net to get a copy of this message | ||
doc_root already limits apache/php script folder locations.
open_basedir is better used to restrict script access to folders
which do NOT contain scripts. Can be a sub-folder of doc_root as in php doc example doc_root/tmp,
but better yet in a separate folder tree, like ~user/open_basedir_root/. Harmful scripts could
modify other scripts if doc_root (or include_path) and open_basedir overlap.
If apache/php can't browse scripts in open_basedir, even if malicious scripts uploaded more bad
scripts there, they won't be browse-able (executable).
One should also note that the many shell execute functions are effectively a way to bypass
open_basedir limits, and such functions should be disabled if security demands strict folder access
control. Harmful scripts can do the unix/windows version of "delete */*/*/*" if allowed to
execute native os shell commands via those functions. OS Shell commands could similarly bypass
redirect restrictions and upload file restrictions by just brute force copying files into the
doc_root tree. It would be nice if they could be disabled as a group or class of functions, but it
is still possible to disable them one by one if needed for security.
PS. currently there is a bug whereby the documented setting of open_basedir to docroot/tmp will not
work if any include or require statements are done. Right now include will fail if the included php
file is not in BOTH the open_basedir tree and the doc_root+include_path trees. Which is the opposite
of safe.
This means by any included php file must be in open_basedir, so is vulnerable to harmful scripts and
php viruses like Injektor.
----
Server IP: 69.147.83.197
Probable Submitter: 99.18.229.208
----
Manual Page -- http://www.php.net/manual/en/security.apache.php
Edit -- https://master.php.net/note/edit/107654
Del: integrated -- https://master.php.net/note/delete/107654/integrated
Del: useless -- https://master.php.net/note/delete/107654/useless
Del: bad code -- https://master.php.net/note/delete/107654/bad+code
Del: spam -- https://master.php.net/note/delete/107654/spam
Del: non-english -- https://master.php.net/note/delete/107654/non-english
Del: in docs -- https://master.php.net/note/delete/107654/in+docs
Del: other reasons-- https://master.php.net/note/delete/107654
Reject -- https://master.php.net/note/reject/107654
Search -- https://master.php.net/manage/user-notes.php