[Gloucs] mysql query in a php loop?
Guy Edwards
gloucs at mailman.lug.org.uk
Tue Jun 17 21:45:00 2003
On Tue, 2003-06-17 at 21:32, Mark wrote:
> Guy,
>
> I just had a thought (rare I know) as i'm sat here writing a format
> string vulnerability for a client,
>
> What is the field that it is fetching and does it contain anything that
> could cause it to be erroneous? slashes, semi-colons etc?
>
> I doubt its the problem but might as well raise.
ahh, I thought about that as I was writing it...
when I get variables posted by the client I take precautions by
commenting out characters - goes like this:
// get hour_out posted from form on previous page
$hour_out = $_POST["hour_out"];
// comment out dangerous characters
$hour_out = addslashes($hour_out);
when getting stuff from the mysql database I try to use
$req_num = htmlspecialchars(stripslashes($row["itemid"]));
though I think that is more html formatting than security (I'm
guessing).
Good point though.
Guy
--
Guy Edwards <guy_j_edwards@hotpop.com>