I am at a loss. I have suPHP, suExec and open_basedir installed on my server and today I decided to use some PHP code from one account and put it on another account to work on. I discovered that the code on the new account had no problem executing the database connection code from the old account's root! I could even echo out the file contents from the other account and see the database passwords plain as day. Thank god I manage all of the sites on my server.
My main concern is that I can execute the files in another accounts web root or anywhere just by knowing their username and the file name.
Am I wrong in assuming that the purpose of suExec and suPHP is to lock down files to the account's user?
While I can't find an explanation stating that I just assumed it was true. Here is something I found that sort of backs up my assumption:
Btw I realized recently that open_basedir doesn't work out of the box with suPHP and have found the thread where Tristan explains how to lock down php.ini files. I will do this after I figure out what's going on.
I'm using PHP 5.4
My main concern is that I can execute the files in another accounts web root or anywhere just by knowing their username and the file name.
Code:
echo file_get_contents('/home/otherUser/file.php');
While I can't find an explanation stating that I just assumed it was true. Here is something I found that sort of backs up my assumption:
What am I missing here?PHP Files are not meant to be read, but parsed, otherwise everyone who is able to read your php file will able to view settings that you would want to keep private, such as your MySQL username and password.
SuPHP fixes this issue because it requires PHP scripts to be executed with the permissions of their owners.
Btw I realized recently that open_basedir doesn't work out of the box with suPHP and have found the thread where Tristan explains how to lock down php.ini files. I will do this after I figure out what's going on.
I'm using PHP 5.4