|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-31 11:18 UTC] stevewest15 at yahoo dot com
Description:
------------
PHP 4.4.2 still has the bug which allows CURL to bypass open_basedir restrictions. Your release notes for 4.4.2 state that it has been fixed...but it hasn't! :-(
Here is the configure line for PHP:
'./configure' '--localstatedir=/var/hsphere/php' '--with-apxs=/hsphere/shared/apache/bin/apxs' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-bz2=/usr' '--enable-calendar' '--with-jpeg-dir=/hsphere/shared' '--enable-ftp' '--with-gd' '--with-ttf' '--with-freetype-dir=/hsphere/shared' '--enable-gd-native-ttf' '--with-png-dir=/hsphere/shared' '--with-gettext=/hsphere/shared' '--with-imap=/hsphere/shared' '--with-mysql=//usr' '--with-pgsql=//usr' '--with-curl=/hsphere/shared' '--with-curlwrappers' '--with-mhash=/hsphere/shared' '--with-mcrypt=/hsphere/shared' '--with-iconv=/hsphere/shared' '--enable-sockets' '--with-zip=/hsphere/shared' '--enable-versioning' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--enable-mbstring' '--disable-debug' '--enable-pspell' '--enable-memory-limit' '--disable-files'
Changes to php.ini made:
open_basedir = /home/hsphere/shared/apache/htdocs/:/usr/local/lib/php/:/tmp/
disable_functions = "pack,system"
Please fix this
Reproduce code:
---------------
<?php
$ch = curl_init("file:/etc/snmp/snmpd.conf");
$file=curl_exec($ch);
echo $file
?>
Expected result:
----------------
It should say that open_basedir restrictions are in affect and that it couldn't retrieve file.
Actual result:
--------------
When the above code is run, it actually retrieves my /etc/snmpd.conf and displays it's content in my browser. BIG SECURITY concern!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
I cannot confirm the fix in CVS, the following still works: <?php $ch = curl_init("file:///etc/passwd"); $file=curl_exec($ch); echo $file ?> shows the content of /etc/passwd using php4-STABLE-200602131136 and safe_mode=ON