note 9069 deleted from function.highlight-file by aidan
| From: | aidan@php.net | Date: | Sun, 26 Sep 2004 13:58:09 +0000 |
| Subject: | note 9069 deleted from function.highlight-file by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77389@lists.php.net to get a copy of this message | ||
Note Submitter: niciaspac at yahoo dot com
----
Although the example script above does do a decent job of checking the filetype (it allows only .php
or .inc files to be viewed), it has some serious security issues. It allows anyone to view PHP files
in password protected or IP restricted directories. If you wish to maintain any form of security,
try making a source directory with symbolic links to the files you wish to share (give the links a
.phps extension so the web server will serve them as highlighted text instead of parsing them.) ...
Or maybe use PHP's CURL library to make the user authenticate before viewing restricted source.
IP restricted directories will still be vulnerable though, assuming you have any.