in reply to Re: Removing malicious HTML entities (now with more questions!)
in thread Removing malicious HTML entities (now with more questions!)

"If you later modify the script and accidentally introduce a vulnerability, having "-T" on the shebang line will make a difference"

That is why I plan on using it ^.^

I'm so adjective, I verb nouns!

chomp; # nom nom nom

  • Comment on Re^2: Removing malicious HTML entities (now with more questions!)

Replies are listed 'Best First'.
Re^3: Removing malicious HTML entities (now with more questions!)
by LesleyB (Friar) on Aug 17, 2008 at 23:31 UTC

    You should always plan to use it with CGI scripts

    The trick to untaint data, as far as I am aware, is to ensure your data is correct . i.e. do data validation. Usually this means using (tight) regexps to ensure the user input doesn't go outside expected bounds.

    From what I have read, if you are entering anything into a db then you might want to SQL-escape it too so that people can't hijack your database and delete everything.

    HTML::Entites will help display stuff that might otherwise break your web page - what's left that can beak your db?

      "If you are entering anything into a db then you might want to SQL-escape it too so that people can't hijack your database"

      By using placeholders, right?

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom

        I would always use placeholders simply for the speed increase they offer, but does the use of them imply the placeholder content is, for want of a better phrase, SQL-escaped for the actual DB in use?

        My scan of the documentation didn't find that information for placeholders but seemed to imply that $db->quote() might. I would like to know for sure if placeholders also perform this function.