
A lion in a cage shouldn't be a danger - but release the lion from the cage and you could be at risk.
An include file that's pulled in by a PHP script shouldn't be a danger if it's used only from within that PHP script, but if it has its own URL the it could be released like the lion, and it could be a danger.
If you're writing a PHP script that requires or includes files, please put the included files in a directory that's NOT got its own URL .... you can do it by giving a path to the file in the include or require statements, or by using the preconfigured directory that's set up on your PHP installation.
Image from
Hone's Everyday Book (written 2006-11-10 18:34:07)
Associated topics are indexed under
H117 - Security in PHP [2628] An example of an injection attack using Javascript - (2010-02-08)
[2025] Injection Attack if register_globals in on - PHP - (2009-02-04)
[1779] Injection Attacks - avoiding them in your PHP - (2008-08-31)
[1747] Who is watching you? - (2008-08-10)
[1694] Defensive coding techniques in PHP? - (2008-07-02)
[1679] PHP - Sanitised application principles for security and useability - (2008-06-16)
[1542] Are nasty programs looking for security holes on your server? - (2008-02-17)
[1482] A story about benchmarking PHP - (2007-12-23)
[1396] Using PHP to upload images / Store on MySQL database - security questions - (2007-10-19)
[1387] Error logging to file not browser in PHP - (2007-10-11)
[1323] Easy handling of errors in PHP - (2007-08-27)
[1086] Injection attacks - safeguard your PHP scripts - (2007-02-20)
[1052] Learning to write secure, maintainable PHP - (2007-01-25)
[947] What is an SQL injection attack? - (2006-11-27)
[426] Robust checking of data entered by users - (2005-08-27)
[345] Spotting a denial of service attack - (2005-06-12)
Some other Articles
The LAMP Cookbook - Linux, Apache, MySQL, PHP / PerlWhy shouldn't I spam?Staying at your own hotelFrench ExchangeA lion in a cage - PHPFreedom for X is denial of privacy for YDatabases needn't be frightening, hard or expensiveSyntax checking in PHPDriving customers awayPaging through hundreds of entries