I have a CENTOS server running directadmin. The folder '/home/[account]/imap' and subfolders of this folder contain all email from the emailaccounts associated with this user. If i now run the following PHP code on one of the websites:
die(json_encode(scandir("/home/[account]/imap")));
I get the full email content of these mailboxes, which means php can just access all of the imap email. Because of this, it could only take a single malicious wordpress plugin or composer package to have all my emails leaked!
I would like to prevent php running on the server from accessing these folders. When i search google about this issue, nothing relevant comes up. This worries me. Does this mean that everyone has the same 'problem'? Or is my directadmin/server just misconfigured? Is there some setting in PHP, DirectAdmin or the server that i overlooked?
I do not care about Perl (or other), just about PHP. I do know about the open_basedir setting and I do know about custom httpd configurations, but until now all efforts in this direction have had no succes for us.
Is there a good solution to have this solved (and should DIrectadmin not do so in general?). Help is much appreciated!
die(json_encode(scandir("/home/[account]/imap")));
I get the full email content of these mailboxes, which means php can just access all of the imap email. Because of this, it could only take a single malicious wordpress plugin or composer package to have all my emails leaked!
I would like to prevent php running on the server from accessing these folders. When i search google about this issue, nothing relevant comes up. This worries me. Does this mean that everyone has the same 'problem'? Or is my directadmin/server just misconfigured? Is there some setting in PHP, DirectAdmin or the server that i overlooked?
I do not care about Perl (or other), just about PHP. I do know about the open_basedir setting and I do know about custom httpd configurations, but until now all efforts in this direction have had no succes for us.
Is there a good solution to have this solved (and should DIrectadmin not do so in general?). Help is much appreciated!
Last edited: