RE: [PHP] download script

From: Date: Tue, 10 Aug 2004 21:41:25 +0000
Subject: RE: [PHP] download script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193395@lists.php.net to get a copy of this message
A hacker could modify the URL Mypage.php?file=book.pdf Becomes Mypage.php?file=../htdocs/.htaccess > -----Original Message----- > From: Aaron Todd [mailto:aaloki88@hotmail.com] > Sent: Wednesday, August 11, 2004 11:58 AM > To: php-general@lists.php.net > Subject: Re: [PHP] download script > > Why would this be a security hole if I do not filter the file name before > I > use it? > > Thanks, > > Aaron > > > "Ed Lazor" <Ed.Lazor@d20News.com> wrote in message > news:php.general-193359@news.php.net... > > The other guys addressed how to get the script working, but I thought I > > might also mention that you're presenting a potential security hole in > your > > app by not filtering the file name before using it. You'll also want to > use > > the realpath command on the full file name and path. > > > > > -----Original Message----- > > > $file = "/home/dlr/test/".$_GET['file'].""; > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#193395) next »