Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: How to secure a perl script from attacksby thomas895 (Deacon) |
on Jun 09, 2012 at 19:40 UTC ( [id://975330]=note: print w/replies, xml ) | Need Help?? |
I assume that you are using some form of database. In the DBI docs somewhere, it states that you should use placeholders for your data. For example:
Placeholders also have the added advantage of reusing your queries. For example:
The advantage of that is not only performance(only need to compile SQL statement once), but the placeholders are replaced with safe data that can be used in the database. Of course, I left out several things like error handling for incorrect or malformed queries, but it is implied that you should have that. In terms of other security, make sure you use common sense. Hash your passwords and add a salt, ensure that nobody should see data they're not supposed to see, and all other typical web security tips.
~Thomas~ confess( "I offer no guarantees on my code." );
In Section
Seekers of Perl Wisdom
|
|