Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Security Bug Databases Microsoft Programming Software News IT

Half a Million Microsoft-Powered Sites Hit With SQL Injection 222

Titus Germanicus writes to tell us that a recent attack has compromised somewhere in the neighborhood of 500,000 pages with a SQL injection attack. The vulnerability seems to be limited to Microsoft's IIS webserver and is easily defeated by the end user with Firefox and "NoScript." "The automated attack takes advantage to the fact that Microsoft's IIS servers allow generic commands that don't require specific table-level arguments. However, the vulnerability is the result of poor data handling by the sites' creators, rather than a specific Microsoft flaw. In other words, there's no patch that's going to fix the issue, the problem is with the developers who failed follow well-established security practices for handling database input. The attack itself injects some malicious JavaScript code into every text field in your database, the Javascript then loads an external script that can compromise a user's PC." Ignoring corporate spin-doctoring, there seems to be plenty of blame to go around.
This discussion has been archived. No new comments can be posted.

Half a Million Microsoft-Powered Sites Hit With SQL Injection

Comments Filter:
  • Dupe? (Score:5, Informative)

    by TubeSteak ( 669689 ) on Monday April 28, 2008 @06:06PM (#23230440) Journal
    500 Thousand MS Web Servers Hacked
    Posted by kdawson on Friday April 25, @11:48AM
    from the scream-and-shout dept.
    http://it.slashdot.org/it/08/04/25/1358234.shtml [slashdot.org]
  • by eldavojohn ( 898314 ) * <eldavojohn@gma[ ]com ['il.' in gap]> on Monday April 28, 2008 @06:10PM (#23230494) Journal
    You know, as an incompetent Java developer, I will take the time to explain why none of my web applications suffered from this.

    I use Hibernate [hibernate.org]. I use it with Java, although I know it's now available for .NET.

    A feature of Hibernate (aside from some efficient connection pooling and resource management like caching) is that you have to actually call a delete method to delete a row. Something like HibernateSession.delete(myObject); would have to be done. And while this might sound annoying or ruin some tools that are used to generate SQL statements, it protects me time and time again. Now, you can use HQL which is a bastardized version of SQL to generate similar things but, again, I think that you can't drop/delete in it (could be wrong, rarely use it).

    Try passing part of an SQL string into an object property and then merge/save it into the HibernateSession. Doesn't do the SQL injection stuff the bad guys want it to. Of course, I still use regular expression common utilities to validate the input, but assuming you didn't do that ...

    So why don't other people use Hibernate? Am I missing something about it that's bad?
  • Dupe Dance (Score:3, Informative)

    by jd ( 1658 ) <imipak@yahoGINSBERGo.com minus poet> on Monday April 28, 2008 @06:13PM (#23230520) Homepage Journal
    Yay! We get a re-run of one of the more non-story events of recent times. The problem was spotted very quickly by IIS admins, as was noted before, and it's half a millon pages, not half a million sites. Well, unless all sites have one page and I've only been thinking they used hypertext links to more of their own content. It's unclear what percent of those sites were IIS, what were Apache (an easy server to misconfigure), and what were other web servers. Blaming it on IIS is easy, and there probably is some truth to the allegation that IIS has flaws when it comes to SQL support, but this time they almost (I said almost) have justification in crying foul when Microsoft gets blamed.

    What I don't get, though, is not only does this dupe the earlier story, it dupes ALL OF THE ERRORS as well. Sheesh!

  • by Lobster Quadrille ( 965591 ) on Monday April 28, 2008 @06:29PM (#23230674)
    Actually, PHP's mysql engine won't run that query- you cannot execute more than one query in a single mysql_query() call.

    There are plenty of ways around it, but your query will fail.
  • by panaceaa ( 205396 ) on Monday April 28, 2008 @06:38PM (#23230748) Homepage Journal
    Actually, most dupes on Slashdot are a couple days apart like this one. After that they fail to be news and tend not to get reposted.

    The extreme cases are actually measured in the years or hours. There's multiple cases of an article being duped 2-3 years later, especially when they're industry studies on how people use technology or occasionally about scientific discoveries. For the latter, it's often that a university announces they've done something and then publishes the results, which results in two very similar though arguably non-duplicative Slashdot articles.

    On the other side, sometimes there's big news and an editor decides to get it out fast without reading the current front page. I've seen dupes within the same hour, but more likely they're 2-3 articles apart in the worst cases. This was one of the arguments for introducing the Slashdot subscription model, in fact: Subscribers have early access to upcoming articles and can tell editors that an upcoming article is a dupe. In many cases (but not all) the editor pulls the dupe before it gets pushed to the front page.
  • by Dekortage ( 697532 ) on Monday April 28, 2008 @06:59PM (#23230928) Homepage

    Well, to quote from the Hackademix FAQ on this issue [hackademix.net]... "Crackers put together a clever SQL procedure capable of polluting any Microsoft SQL Server database in a generic way, with no need of knowing the specific table and fields layouts. There's no Microsoft-specific vulnerability involved: SQL injections can happpen (and do happen) on LAMP and other web application stacks as well. SQL injections, and therefore these infections, are caused by poor coding practices during web site development. Nonetheless, this mass automated epidemic is due to specific features of Microsoft databases, allowing the exploit code to be generic, rather than tailored for each single web site."

  • by S'harien ( 779928 ) on Monday April 28, 2008 @07:01PM (#23230954)
    ColdFusion is most certainly vulnerable to SQL injection if you are not religiously using the CFQUERYPARAM tag inside your queries. Of course the database being queried needs to support multiple SQL statements in a single query (MySQL does, Access does not, can't speak for any others). http://www.adobe.com/devnet/coldfusion/articles/cfqueryparam.html [adobe.com]
  • Re:Quicky Question (Score:3, Informative)

    by cervo ( 626632 ) on Monday April 28, 2008 @07:20PM (#23231136) Journal
    I think you misunderstand the article. The attack injects javascript code into the text fields of the database. The attack is done by someone exploiting SQL injection on the website. Nothing to do with a web surfing account on the database computer. The attack inserts Javascript into every text field. If it was a message forum, this might be the from fields of an e-mail, the message text of posts, the subject fields of posts, etc.... Regular users using the forum are suddenly exposed to the javascript.
  • by Sancho ( 17056 ) * on Monday April 28, 2008 @07:26PM (#23231174) Homepage
    That's close.

    http://hackademix.net/2008/04/26/mass-attack-faq/#comment-7742 [hackademix.net] has a decent explanation of why this is primarily hitting IIS. SQL injection is common to many platforms, but Microsoft's database driver has some features that made it particularly easy to generalize the exploit. Specifically, prior knowledge of the table layout was apparently unnecessary to create the exploit, meaning that it was easy to hit a large number of websites in a short period of time.
  • by ShaunC ( 203807 ) on Monday April 28, 2008 @08:41PM (#23232174)
    The exploit in question has nothing to do with IIS, period, whatsoever. It's being targeted at servers that run IIS because those are the ones most likely to have SQL Server as their database back-end. Plenty of companies have deployed a Linux/Apache/PHP stack that talks to a SQL Server backend via FreeTDS [freetds.org], for example, and some of them will be getting hit by this, despite not running a single instance of IIS.

    The query being used is exploiting features in Microsoft SQL Server, combined with a couple of external factors. Developers who have failed to check and sanitize user input, and DBAs who have not properly secured their databases. In order for your website to be owned through this attack:
    1. You must be running Microsoft SQL Server as your database platform
    2. Your web application must be vulnerable to SQL injection
    3. The SQL Server user that your web application authenticates as must have SELECT and UPDATE access to the sysobjects table
    Notice that nowhere in that list is IIS mentioned. In addition, plenty of shops meet the first criterion above, without meeting either of the other two. Unfortunately it's all too common that web applications are configured to use the "sa" account, or some functionally-equivalent clone thereof.

    If your web application can query dbo.sysobjects and get anything other than "Server: Msg 229, Level 14, State 5, Line 1" in response, it's time to hire an additional DBA. If your web application allows random queries to be passed into SQL Server in the first place, it's time to hire an additional developer. In either case, make "security" a bullet-point on the job posting.

Those who can, do; those who can't, write. Those who can't write work for the Bell Labs Record.

Working...