Preventing SQL injection with stored procedures
Posted Jun 1, 2006 3:53 UTC (Thu) by
mrshiny (subscriber, #4266)
Parent article:
SQL injection vulnerabilities in PostgreSQL
I'm curious as to how using stored procedures prevents SQL injection? In my experience you can create a call to a stored procedures just like a call to SQL:
String query = "{ call some_package.somefunc('" + arg + "'); }";
CallableStatement cs = connection.prepareCall(query);
cs.execute();
The above is just as vulnerable to sql injection as any normal SQL statement. Am I missing something?
(
Log in to post comments)