Wisdom on security for user input seems to be that one doesn't block what might be bad; one only allows what is known to be good.
For a good introduction to the security issues and reasons why this is accepted wisdom, check out ovid's CGI course.
One point is that the CGI form passing mechanism escapes out most of the "nasty" characters, they are turned into %xx where xx is a hex number. These are turned back into the original characters by CGI.pm's escapeHTML function - transparently.
Same documentation also advises that "if you manually change the charset, either by calling the charset() method explicitly or by passing a -charset argument to header(), then all characters will be replaced by their numeric entities, since CGI.pm has no lookup table for all the possible encodings."
This is a caveat for those using UTF-8 encoding. CGI.pm predates this functionality in perl.
Hope this helps
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
In reply to Re: apostrophes and security
by rinceWind
in thread apostrophes and security
by deadnancy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |