<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>FAQ - Frequently Asked Questions</title><link>http://forums.asp.net/13.aspx</link><description>Your question has probably already been answered. Look here for some great answers!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3440761.aspx</link><pubDate>Mon, 05 Oct 2009 11:29:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3440761</guid><dc:creator>slavik118</dc:creator><author>slavik118</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3440761.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3440761</wfw:commentRss><description>&lt;p&gt;As for me,&amp;nbsp;it is very cut and dry with the&amp;nbsp;matter&amp;nbsp;- migration to LINQ to SQL clears up the problem: &lt;a href="http://msdn.microsoft.com/en-us/library/bb386929.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb386929.aspx&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3436048.aspx</link><pubDate>Thu, 01 Oct 2009 17:04:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3436048</guid><dc:creator>Chandra Prakash Andani</dc:creator><author>Chandra Prakash Andani</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3436048.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3436048</wfw:commentRss><description>&lt;p&gt;very simple and good post! &lt;/p&gt;&lt;p&gt;it will be helpful for many developers&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3434895.aspx</link><pubDate>Thu, 01 Oct 2009 07:31:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3434895</guid><dc:creator>k.srinivas81</dc:creator><author>k.srinivas81</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3434895.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3434895</wfw:commentRss><description>&lt;p&gt;The main weak point for SQL injection attack is writing in-line SQL or building the statement in the Stored Procedure dynamically using string concatenations. To avaoid SQL injection attacks use Stored Procedures and pass the only values.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3305415.aspx</link><pubDate>Tue, 21 Jul 2009 07:48:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3305415</guid><dc:creator>Arif Sheikh</dc:creator><author>Arif Sheikh</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3305415.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3305415</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I agree with Manas. I use the Helper SQL myself. I had several sql injection attacks in the last few months to drop the database or change the data, but all of them were balked.&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3288734.aspx</link><pubDate>Sun, 12 Jul 2009 21:32:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3288734</guid><dc:creator>TATWORTH</dc:creator><author>TATWORTH</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3288734.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3288734</wfw:commentRss><description>&lt;p&gt;Thank you for posting the link.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3288130.aspx</link><pubDate>Sun, 12 Jul 2009 07:43:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3288130</guid><dc:creator>Naom</dc:creator><author>Naom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3288130.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3288130</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Not sure, if this great article was already referenced in this thread&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.sommarskog.se/dynamic_sql.html"&gt;The Curse and Blessings of Dynamic SQL&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3273777.aspx</link><pubDate>Fri, 03 Jul 2009 15:40:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273777</guid><dc:creator>hminaya</dc:creator><author>hminaya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273777.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3273777</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;This kind of attack has been around for a long time, and I don&amp;#39;t think it will go away any time soon...&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3272135.aspx</link><pubDate>Thu, 02 Jul 2009 19:30:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272135</guid><dc:creator>TATWORTH</dc:creator><author>TATWORTH</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272135.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3272135</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;nothingisnecessary:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Is there a way (a database setting or&amp;nbsp;data provider&amp;nbsp;option)&amp;nbsp;to disable or disallow multiple statements being executed by Mssql?&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;A very good question! Should such an option exist it would be a further barrier to malicious input!&lt;/p&gt;&lt;p&gt;As it is a specialist SQL question it would be best asked at:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;SQL Server Team &lt;a href="http://www.sqlteam.com/forums/" target="_blank"&gt;&lt;font color="#034efa"&gt;http://www.sqlteam.com/forums/&lt;/font&gt;&lt;/a&gt; &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;SQL Server Central &lt;a href="http://www.sqlservercentral.com/" target="_blank"&gt;&lt;font color="#034efa"&gt;http://www.sqlservercentral.com/ &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;SQL Server at MSDN &lt;a href="http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=19&amp;amp;SiteID=1" target="_blank"&gt;&lt;font color="#034efa"&gt;http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=19&amp;amp;SiteID=1&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3271933.aspx</link><pubDate>Thu, 02 Jul 2009 17:30:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271933</guid><dc:creator>nothingisnecessary</dc:creator><author>nothingisnecessary</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271933.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3271933</wfw:commentRss><description>&lt;p&gt;A purely academic question to&amp;nbsp;SQL Server gurus:&lt;/p&gt;
&lt;p&gt;Is there a way (a database setting or&amp;nbsp;data provider&amp;nbsp;option)&amp;nbsp;to disable or disallow multiple statements being executed by Mssql?&lt;/p&gt;
&lt;p&gt;Please do me a favor and spare me any answers of &amp;quot;use stored procedures,&amp;quot; &amp;quot;sanitize your input,&amp;quot; &amp;quot;run as an unprivileged user,&amp;quot; etc. (Y&amp;#39;all have already made several good points in this thread, and I&amp;#39;m aware of the best practices, but like I said, this is just a purely academic question that begs a yes or no answer, not philosophy.)&lt;/p&gt;
&lt;p&gt;The question is: can you disable multiple statements in SQL Server, and how?&lt;/p&gt;
&lt;p&gt;For example, as a way to prevent the most fun and trivial of sql injection shown in this cartoon:&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class="mceItemTable"&gt;&lt;a href="http://xkcd.com/327/"&gt;http://xkcd.com/327/&lt;/a&gt;&amp;nbsp; &lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3269782.aspx</link><pubDate>Wed, 01 Jul 2009 20:15:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3269782</guid><dc:creator>shados</dc:creator><author>shados</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3269782.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3269782</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;As i mentionned earlier in this thread,&amp;nbsp;if we&amp;#39;re talking about database security in general, yes. If we&amp;#39;re talking about SQL injection (which is what this thread is about), the -only- thing you need is to use parameterized queries (stored procedures are a type of parameterized queries, but do not enhance security beyond the normal kind) and to avoid dynamic sql within stored procedures.&lt;/p&gt;
&lt;p&gt;Once you do that, it is impossible to use sql injection against you, even if you don&amp;#39;t cast datatypes and your app is running as domain administrator (still err...don&amp;#39;t do that for other reasons, obviously!).&lt;/p&gt;
&lt;p&gt;Other exploits could be used, of course, so these best practices are indeed useful, but i feel its important to make the difference between sql injections and general database best practices, as too much confusion over the subject hurts more than help... See the same pattern about XSS attacks, where programmers can&amp;#39;t properly defend themselves because they&amp;#39;re confused and mixed up over a bunch of different exploits.&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3269691.aspx</link><pubDate>Wed, 01 Jul 2009 19:17:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3269691</guid><dc:creator>TATWORTH</dc:creator><author>TATWORTH</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3269691.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3269691</wfw:commentRss><description>&lt;p&gt;&amp;gt;Good post&amp;nbsp; but&amp;nbsp; best way is to avoid queries in code&lt;/p&gt;&lt;p&gt;Moving embedded TSQL into stored procedures is only part of the solution as defence must in depth, therefore also:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A minimum priviledge SQL account&lt;/li&gt;&lt;li&gt;All data cast to the correct data type&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3268551.aspx</link><pubDate>Wed, 01 Jul 2009 10:21:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3268551</guid><dc:creator>kthummala</dc:creator><author>kthummala</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3268551.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3268551</wfw:commentRss><description>&lt;p&gt;Good post&amp;nbsp; but&amp;nbsp; best way is to avoid&amp;nbsp; queries in code (Best method is write procedures )&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/3264850.aspx</link><pubDate>Mon, 29 Jun 2009 17:51:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3264850</guid><dc:creator>TATWORTH</dc:creator><author>TATWORTH</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3264850.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3264850</wfw:commentRss><description>&lt;p&gt;In the post at &lt;a target="_blank" href="http://www.unixwiz.net/techtips/sql-injection.html"&gt;http://www.unixwiz.net/techtips/sql-injection.html&lt;/a&gt;, there is a very important point:&lt;/p&gt;&lt;p&gt;&amp;quot;Instead, rather than &amp;quot;remove known bad data&amp;quot;, it&amp;#39;s better to
&amp;quot;remove everything but known good data&amp;quot;: &lt;span style="font-size:large;"&gt;&lt;b&gt;this distinction is
crucial&amp;quot;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In otherwords use a White List of what you know to be valid and not a black list.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/2973524.aspx</link><pubDate>Sat, 28 Feb 2009 16:41:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2973524</guid><dc:creator>omalbose</dc:creator><author>omalbose</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2973524.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2973524</wfw:commentRss><description>&lt;p&gt;Thank you boss it is nice article about the sql injection. Following link also will be useful for the programmers to familier with the Different sql injection methods employed to break into DB. When we are aware of such threats we can prepare better prevention methods&lt;/p&gt;&lt;p&gt;http://www.unixwiz.net/techtips/sql-injection.html&lt;/p&gt;&lt;p&gt;Hope this would help others.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Avoid SQL Injection attacks</title><link>http://forums.asp.net/thread/2963311.aspx</link><pubDate>Tue, 24 Feb 2009 15:49:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2963311</guid><dc:creator>shados</dc:creator><author>shados</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2963311.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2963311</wfw:commentRss><description>&lt;p&gt;If the query can be flattened in a way that the optimizer can easily figure out that the conditions will always return true (and it can do that fairly aggressively, thanks to statistics usage, among other things), performance will be similar.&lt;/p&gt;
&lt;p&gt;That said, my main point was mainly that when using dynamic sql through parameterized queries, to try, while staying reasonable, to keep the queries mostly static and to use parameters as much as possible, to avoid clogging the query plan cache.&lt;/p&gt;</description></item></channel></rss>