SQL Injection is probably the best reason, other than speed of execution sometimes, to use stored procedures instead of dynamic SQL queries. Ill-intentioned users can inject character literals through their input that can be used to comment out part of the query being executed. Scott Glu has a tip on ways of preventing it (via Miguel de Icaza). It is specific to .Net, but can easily be extended to any other language/platform.


November 23rd, 2006 at 12:54 pm
[...] Brian Sullivan points out that code injection need not be always through SQL. Though SQL injection is popular, malicious code can be injected through user input during any data retrieval, including for XML and LDAP. He discusses some techniques for protecting against the injection with the common principle of validating every single input from the user. Having a whitelist instead of a blacklist can help as usually you know the allowed parameters and the set of invalid parameters can be infinite. A good article. [...]
February 3rd, 2007 at 8:52 am
[...] technique is conceptually very obviously similar to other injection techniques, like SQL Injection, where the user can provide (inject) malicious input which is not correctly handled by the [...]
May 9th, 2007 at 11:11 pm
[...] in a very clear and detailed manner, explains the various ways of preventing SQL Injection. SQL Injection is one of the biggest security worries. If not handled properly you can leave your entire [...]