- Sep 29, 2000
- 70,150
- 5
- 0
I am looking at some VB DLLs that serve as a data layer for some old ASP that are calling SQL 2000 stored procedures. These procedures do not consist of dynamic SQL. They only take parameters and look like:
SELECT User FROM Users WHERE [name] = @Param1
Based on my understanding, this is invulnerable to an injection attack because, regardless of the contents of @Param1 (which could be anything, fed in from the web pages through to the VB DLL), SQL will still try to do matches of [name] to @Param1. If it was all dynamic, I know additional statements could piggy back.
My question, though is, how they're called from the VB. In some cases the parametes for the sprocs are specific, binding variables to a parameter and then executed and Bob's your uncle. However, in a few cases we have code that looks like this:
sql = "<stored procedure> " & 'Bob'
oConn.Execute sql
Are these calls susceptible? Does a dynamic appending of parameters in the above manner to a stored procedure that itself has a) no dynamic SQL and b) specific parameters within it mean this code is still protected from injection at the database layer even if the data layer itself would appear vulnerable?
Thanks!!!!!!
SELECT User FROM Users WHERE [name] = @Param1
Based on my understanding, this is invulnerable to an injection attack because, regardless of the contents of @Param1 (which could be anything, fed in from the web pages through to the VB DLL), SQL will still try to do matches of [name] to @Param1. If it was all dynamic, I know additional statements could piggy back.
My question, though is, how they're called from the VB. In some cases the parametes for the sprocs are specific, binding variables to a parameter and then executed and Bob's your uncle. However, in a few cases we have code that looks like this:
sql = "<stored procedure> " & 'Bob'
oConn.Execute sql
Are these calls susceptible? Does a dynamic appending of parameters in the above manner to a stored procedure that itself has a) no dynamic SQL and b) specific parameters within it mean this code is still protected from injection at the database layer even if the data layer itself would appear vulnerable?
Thanks!!!!!!