Re: SQL Injection Prevention
From: Valery Pryamikov (Valery_at_nospam.harper.no)
Date: 09/28/04
- Next message: Nigel Rivett: "Re: SQL Injection Prevention"
- Previous message: Jeff Dillon: "Re: Error in Inintial Replication"
- In reply to: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Next in thread: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Reply: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 17:12:27 +0200
Aaron,
here is the summary from my posts to that thread that are related to your
question:
1. when you call parameterized stored procedure, it (the procedure) may
internally use dynamic sql (ie concatenate parameters to SQL string), thus
introducing another SQL injection vulnerability.
2. but when you call parameterized DML statement, you are guaranteed against
SQL injection vulnerabilities (if we don't consider the most weird situation
of triggers that are using dynamic sql). Guarantee is because parameters are
not passed to SQL parser, but is used on later stage when command is already
prepared and execution plan is ready.
Anyway, dynamic SQL in stored procedure is much more likely to occur than
dynamic SQL in triggers (I'm not sure that last is possible at all).
Therefore my conclusion. You can check my other posts to that thread for
more details.
p.s. And, it doesn't matter how likely it actually is that dynamic SQL be
used in stored procedures - as long as this possibility exists, we have to
account for it.
-Valery.
http://www.harper.no/valery
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:OW1owqWpEHA.2900@TK2MSFTNGP12.phx.gbl...
>> Therefore my statement stays that parameterized SQL select
>> (insert/update/delete) actually provides better protection against SQL
>> injection than parameterized call to stored procedure.
>
> I'm not sure I understand where you've proven that parameterized DML
> statements are better than parameterized stored procedure calls.
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
- Next message: Nigel Rivett: "Re: SQL Injection Prevention"
- Previous message: Jeff Dillon: "Re: Error in Inintial Replication"
- In reply to: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Next in thread: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Reply: Aaron [SQL Server MVP]: "Re: SQL Injection Prevention"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|