Re: [SMARTY] Security

From: Date: Mon, 20 Jan 2003 18:04:09 +0000
Subject: Re: [SMARTY] Security
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7275@lists.php.net to get a copy of this message
Ferdinand Beyer wrote:
On 19 Jan 2003 at 14:07, Monte Ohrt wrote:
$template_dir should be secured, SMARTY_DIR, no. Why would you access files from there? As for the debug template, just be sure that $smarty->debug_tpl is set to the location of the debug.tpl file, it should work even if it is not in a secure directory.
Does this mean that you plan to treat $template_dir secure internally even if it is not in the $secure_dir array like I suggested? Actually it does work this way, except that they are static values. I changed it in CVS so the actual $template_dir is used within the constructor at runtime. Good catch.
I agree with you that there is no need to access the SMARTY_DIR except for the debug template. But in 2.3.1 debug.tpl does _not_ work when security is enabled and SMARTY_DIR is not in the $secure_dir array. Just enable debugging and security and you'll get the warning: This is a bug. The debug_tpl should be added to the secure_dir but it looks like this was broke when the debug setup was moved from the constructor to the _generate_debug_output function. It's fixed in CVS.
Smarty error: (secure mode) accessing "file:f:\...\smarty\debug.tpl" is not allowed By the way, while testing this PHP told me that "the variable results is not defined" - it is used as a return value in the _generate_debug_output() method on line 785 - please check that! Not sure what that error is, please give the CVS version a try and see if it still happens.
Monte

« previous php.smarty.general (#7275) next »