Microsoft Responds to the SQL Injection Problem - Tools to Fight SQL Injection (
Page 2 of 2 )
The
Microsoft Source Code Analyzer for SQL Injection tool is a static code
analysis tool, built on the .NET Framework version 3.0, which analyzes
your ASP code for SQL injection vulnerabilities, both first order and second order vulnerabilities.
ADVERTISEMENT
First order is the type my own sites would be vulnerable to: using
user input directly to construct SQL statements. Second order is where
those statements are constructed based on data from the database. See Preventing SQL Injections in ASP
for more on this distinction. As a programming matter, by the way, the
general solution to SQL injection is called parameterized queries, a
topic also covered in this article.
A second tool is UrlScan version 3.0 Beta,
the latest in a long line of UrlScan versions that have prevented many
a common attack. UrlScan is a runtime filtering tool that looks at HTTP
requests sent through IIS. It scans for malicious ones and can be set
to block whatever you want to block. This can be handy when you read
about specific attack patterns being committed.
SQL injections are often performed through HTTP GET commands, in
which case UrlScan should be able to detect them (for instance, by
setting a rule to drop any request that contains the string "INSERT
INTO "), but I don't see where Microsoft has provided UrlScan rules for
this purpose. You might be on your own in that regard.
Finally, there is a third-party tool, Scrawlr from HP.
This tool crawls Web sites, analyzing parameters of pages for SQL
injection vulnerabilities. Unlike the Microsoft Source Code Analyzer
for SQL Injection tool, it doesn't require source code. Even if you
have source code, this provides a different perspective and a useful
comparison.
Preventing successful SQL injection attacks has to begin with proper
programming techniques, and there's only so much Microsoft can do about
that. They have provided the programming systems you need to do the job
right. Scrawlr and UrlScan are good tools to have and are worth
running, at least for a while, but if they are your main defense you
can't feel good about it.
SQL injection is a great example of how security is everyone's
job. Ten years ago very few people appreciated that this level of
programming could be the target of a massive attack, but systems are so
complex these days that every level is suspect. Don't take anything for
granted.
Security Center Editor Larry Seltzer has worked in and written about the computer industry since 1983.
For insights on security coverage around the Web, take a look at eWEEK.com Security Center Editor Larry Seltzer's blog Cheap Hack