Jump to content

preventing Remote File Inclusion


jeff5656

Recommended Posts

Yes, if you are including a file based on a GET parameter passed to your code, you must validate that the file name is just an allowed value (which will eliminate those cases where it is an actual URL of some raw php code on a hacker's site.)

 

Also, you must validate the file name in the context where it is being included (only allow the correct files to be included on any particular page.) This is needed to prevent someone on your site from including say an administrative file on your site when they are only a guest on your site.

 

Edit: If you are including a literal file name, as in include "file.php";, then no, that is the only file that can possibly be included by that line of code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.