#19604 [NEW]: source.php has major security vulnerability
| From: | h3h at h3h dot net | Date: | Wed, 25 Sep 2002 22:54:00 +0000 |
| Subject: | #19604 [NEW]: source.php has major security vulnerability | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-12774@lists.php.net to get a copy of this message | ||
From: h3h@h3h.net
Operating system: Windows 2000 SP3
PHP version: 4.2.3
PHP Bug Type: Website problem
Bug description: source.php has major security vulnerability
As I was writing my own source.php script, to basically accomplish the same
task as the source.php file on php.net, I noticed a significant
vulnerability that was present on my system using this approach. In UNIX
and Windows, ../ can be used to access the parent directory of the current
working directory. Using this methodology, I was able to transcend above
my web directory where the source.php file resides and into protected
system files that should not otherwise be accessed. I tried to duplicate
this behavior with the source.php script on php.net and was successful. I
believe that by continuing to use an arbitrary amount of '../' blocks in
the url, any file currently on the server within the web server's
permissions can be accessed without authorization. Case in point:
http://www.php.net/source.php?url=../.htaccess
With that simple url, I have gained access to the .htaccess file that
resides above the root web directory of php.net.
In my implementation of source.php, I simply checked for any occurence of
'..' and denied access accordingly. There may be other exploitable
commands along with this, however this is the only one that comes to
mind.
My Source: http://h3h.ath.cx/source.php?file=source.php
I hope this comes as a constructive bug report. Thanks.
--
Edit bug report at http://bugs.php.net/?id=19604&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19604&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19604&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19604&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19604&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19604&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19604&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19604&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19604&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19604&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19604&r=globals