note 54088 added to security.filesystem
| From: | 1 at 234 dot cx | Date: | Thu, 23 Jun 2005 12:24:15 +0000 |
| Subject: | note 54088 added to security.filesystem | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90835@lists.php.net to get a copy of this message | ||
I don't think the filename validation solution from Jones at partykel is complete. It
certainly helps, but it doesn't address the case where the user is able to create a symlink
pointing from his home directory to the root. He might then ask to unlink
"foo/etc/passwd" which would be in his home directory, except that foo is a symlink
pointing to /.
Personally I wouldn't feel confident that any solution to this problem would keep my system
secure. Running PHP as root (or some equivalent which can unlink files in all users' home
directories) is asking for trouble.
If you have a multi-user system and you are afraid that users may install scripts like this, try
security-enhanced Linux. It won't give total protection, but it at least makes sure that an
insecure user script can only affect files which the web server is meant to have access to.
Whatever script someone installs, outsiders are not going to be able to read your password file---or
remove it.
----
Manual Page -- http://www.php.net/manual/en/security.filesystem.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54088
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54088&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54088&report=yes
Search -- http://master.php.net/manage/user-notes.php