First of all, I would like to thank those who assisted me with this problem a few days ago in the CB. I am posting here to get a wider range of opinions on what to do.
I have a CGI form that asks the user for their username and inserts it into a database. I then retrieve it from the database and display it on the web page. I use placeholders when inserting into the database, so that takes care of that. To solve the latter issue, I am currently using the HTML::Entities module: $username = encode_entities($q->param('name')) which seems to work fine. Of course, I am not competently educated in website vulnerabilities , so I do not know if that small piece of code will protect me.
Is there something more I can do or will that line of code take care of the problem?
Update: Just thought of another question (and feel like an idiot by not knowing the answer :[). In the CGI script, I have the credentials to connect to a mysql database. Is there anyway for someone to inspect the CGI script itself, bypassing the HTML it generates?
Update2: Taint-mode has been brought to my attention. It seems like an excellent way to secure user input. Should it be used in conjunction with the other methods suggested in this node (and comments), or is it good enough by itself?
I'm so adjective, I verb nouns!
chomp; # nom nom nom
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |