Aaron is a senior consultant for
SQL Sentry, Inc., makers of performance monitoring and event management software for SQL Server, Analysis Services, and Windows. He has been blogging here at sqlblog.com since 2006, focusing on manageability, performance, and new features; has been a
Microsoft MVP since 1997; tweets as
@AaronBertrand; and speaks frequently at user group meetings and
SQL Saturday events.
Fellow MVP Steve Kass and Microsoft's Buck Woody have some links and advice about preventing SQL injection attacks not only from affecting your data but also from affecting your users. You can see the information here:
http://stevekass.com/blog/2008/05/31/read-this-if-you-serve-up-web-pages-from-sql-data/
And here:
http://blogs.msdn.com/buckwoody/archive/2008/05/30/sql-injection-attacks.aspx
I agree with Steve wholeheartedly here. Having your data compromised is one thing... you learn from it, you fix it, you move on. But aiding in the distribution of whatever payload is in all of these <script> files that you are unwittingly unleashing on your viewers is something you should try to avoid at all costs. Unless you are storing your actual HTML content and layout in the database (which is usually a no-no), there is no reason you should ever blindly throw data from the database into a web page without first making sure that all HTML tags (like <BR>) are replaced with characters that make them non-rendering (like <BR>).
Another excellent resource is the following article:
http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
About AaronBertrand
...about me...