Re: Question about Smarty [secure?]
| From: | eddy kim | Date: | Tue, 19 Jun 2001 05:22:28 +0000 |
| Subject: | Re: Question about Smarty [secure?] | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-897@lists.php.net to get a copy of this message | ||
Good point.
I had set it up so that I prepended an absolute path to the url that was passed in. But after your email, it triggered a thought and I realised a relative path would get around my checks. So I think after I add another check and remove any relative path components, that sort of thing should be impossible.
Thanks! :)
Eddy
Gavin Cowie wrote:
index.php ---------- [...] /* Setup, get the page variable and do anything you need to it. I normalise it to make it as short as possible, since the value of the page variable is actually a path to a file. I also have a default set if page isn't. */is that secure enough for you? passing the filename as a var via the query string I mean. Could I do something unpleasant like : index.php?page=../../pics_of_siteop_nekkid/index.html or less amusingly index.php?page=/etc/passwd ?if ($page) { // normalise } else { $page=default.html--- You are currently subscribed to smarty as: ehkim@tsoft.com To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/