#19604 [Opn->Bgs]: source.php has major security vulnerability

From: Date: Wed, 25 Sep 2002 23:00:46 +0000
Subject: #19604 [Opn->Bgs]: source.php has major security vulnerability
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-12775@lists.php.net to get a copy of this message
ID: 19604 Updated by: imajes@php.net Reported By: h3h@h3h.net -Status: Open +Status: Bogus Bug Type: Website problem Operating System: Windows 2000 SP3 PHP Version: 4.2.3 New Comment: if you had read the source this just isn't a problem... we don't allow stuff outside of the docroot to be viewed. Previous Comments: ------------------------------------------------------------------------ [2002-09-25 17:54:00] h3h@h3h.net 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 this bug report at http://bugs.php.net/?id=19604&edit=1

« previous php.mirrors (#12775) next »