11
Mithrandir
Re: mainfile.php in read only but still can write in it ...

Quote:
If the webserver USER is also the file OWNER, this could lead to serious security issues, as the web site could be intruded for malicious behavior if the code is sloppy made


But in general, I wouldn't recommend that the webserver user is also the file owner - group is ok, but not owner.

12
DonXoop
Re: mainfile.php in read only but still can write in it ...

Best if the file owner isn't the same as the web process owner. Set it for read-only as mentioned. You could also set the group ownership to the Apache user and set rights to -440-, now only you (file owner) and the server can read the file.

If you want a little extra paranoid protection besides file level rights you can add this to your Apache config file:
<Files ~ "mainfile.php">
Order allow,deny
Deny from all
</Files>

This prevents a browser request from directly calling the file. I do the same for a selection of other files that are never/shouldn't called from a browser.

If you're using a PHP encryptor app (Zend, mmcache etc.) you can encrypt the file too and it can only be viewed as designed (include(); ).

13
zer0fill
Re: mainfile.php in read only but still can write in it ...
  • 2004/4/14 19:33

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


try deleting the file then re-uploading it with the 444 chmod

Login

Who's Online

221 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 221


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits