Lets say on MySQL database (if it matters).
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you will not be completely safe. As others have mentioned, parameterized queries are always the way to go — no matter how you’re accessing the database.
It’s a bit of an urban legend that with procs you’re safe. I think the reason people are under this delusion is because most people assume that you’ll call the procs with parameterized queries from your code. But if you don’t, if for example you do something like the below, you’re wide open:
Because you’re using unfiltered content from the end user. Once again, all they have to do is terminate the line (‘;’), add their dangerous commands, and boom — you’re hosed.
(As an aside, if you’re on the web, don’t take unfiltered junk from the query string of the browser — that makes it absurdly easy to do extremely bad things to your data.)
If you parameterize the queries, you’re in much better shape. However, as others here have mentioned, if your proc is still generating dynamic SQL and executing that, there may still be issues.
I should note that I’m not anti-proc. Procs can be very helpful for solving certain problems with data access. But procs are not a ‘silver-bullet solution to SQL injections.