#31309 [NEW]: open_basedir restrictions do not work on symlinks

From: Date: Mon, 27 Dec 2004 11:30:35 +0000
Subject: #31309 [NEW]: open_basedir restrictions do not work on symlinks
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71113@lists.php.net to get a copy of this message
From: frido at isp-services dot nl Operating system: RedHat 7.2 / Gentoo 2004 PHP version: 4.3.10 PHP Bug Type: PHP options/info functions Bug description: open_basedir restrictions do not work on symlinks Description: ------------ We currently define in our apache vhost the following doc_root: php_admin_value open_basedir "/home/sites/site7/:/home/sites/www.sjeemz.be/:/usr/lib/php/: /tmp:/home/sites/general" Where site7 is a real directory and sjeemz.be is a symlink, when we use the symlink as a directory to safe to: http://www.sjeemz.be/upload/index.php this creates an error, while the symlink is in the open_basedir. Reproduce code: --------------- http://www.sjeemz.be/upload/index.phps Expected result: ---------------- "When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink." the symlink is not resolved to site7 in example above. Actual result: -------------- Warning: move_uploaded_file(): open_basedir restriction in effect. File(/home/sites/symlink/web/uploads/chenbro_aug.sxc) is not within the allowed path(s): (/home/sites/symlink/web) in /home/sites/test/web/index.php on line 16 There was an error whilst uploading the file. -- Edit bug report at http://bugs.php.net/?id=31309&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31309&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31309&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31309&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31309&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31309&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31309&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31309&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31309&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31309&r=support Expected behavior: http://bugs.php.net/fix.php?id=31309&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31309&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31309&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31309&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31309&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31309&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31309&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31309&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31309&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31309&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31309&r=mysqlcfg

« previous php.bugs (#71113) next »