Six ways to protect yourself from SQL Injection
mattbearman.co.uk
Six ways to protect yourself from SQL Injection
1–9 of 9 posts
Re: Six ways to protect yourself from SQL Injection
#2Re: Six ways to protect yourself from SQL Injection
#3Re: Six ways to protect yourself from SQL Injection
#4And the number one way... don't use a sql database. I worked with an object database for a couple years and not having to think about sql injections while coding was really nice.
http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-...
Re: Six ways to protect yourself from SQL Injection
#5Re: Six ways to protect yourself from SQL Injection
#6Use placeholders in prepared statements. "Sanitising" your input, banning magic words etc is hacky and fragile by comparison.
Re: Six ways to protect yourself from SQL Injection
#7Use placeholders in prepared statements. "Sanitising" your input, banning magic words etc is hacky and fragile by comparison.
For anyone else who isn't sure what they are: prepared statements involves sending a template style query and parameters to the SQL api separately, eg:
query template: "select * from users where username = ?"
Parameter: "Matt"
The SQL api knows that one is a query and one is just a parameter so injection is impossible
Re: Six ways to protect yourself from SQL Injection
#8And the number one way... don't use a sql database. I worked with an object database for a couple years and not having to think about sql injections while coding was really nice.
Right, because there aren't any similar vulnerabilities that affect NoSQL databases... ;) http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-...
Re: Six ways to protect yourself from SQL Injection
#9And the number one way... don't use a sql database. I worked with an object database for a couple years and not having to think about sql injections while coding was really nice.
Right, because there aren't any similar vulnerabilities that affect NoSQL databases... ;) http://www.idontplaydarts.com/2010/07/mongodb-is-vulnerable-...