Slashdot Mirror


Mass SQL Injection Attack Hits Sites Running IIS

Trailrunner7 writes "There's a large-scale attack underway that is targeting Web servers running Microsoft's IIS software, injecting the sites with a specific malicious script. The attack has compromised tens of thousands of sites already, experts say, and there's no clear indication of who's behind the campaign right now. The attack, which researchers first noticed earlier this week, already has affected a few high-profile sites, including those belonging to The Wall Street Journal and The Jerusalem Post. Some analyses of the IIS attack suggest that it is directed at a third-party ad management script found on these sites."

288 comments

  1. Wrong tag by unity100 · · Score: 1, Interesting

    its not 'sql'. its IIS. sql accepts any query given to it by the program. its the script's job not to let in any malicious queries. its a script fault.

    1. Re:Wrong tag by Anonymous Coward · · Score: 0

      It matters not, inb4theonslaughtofZOMGapachemysql

    2. Re:Wrong tag by endikos · · Score: 4, Informative

      While the faulty script on a specific platform may be allowing the attack, it's absolutely a SQL injection attack, which is iterating through tables and appending strings to data it finds.

    3. Re:Wrong tag by Anonymous Coward · · Score: 0

      Nor is it IIS. This is a third party script that utilizes a database. The script apparently allows external data to be provided, doesn't validate it and then performs unsafe database access. It could be PHP on Apache on Windows with MySQL just as easily as it could be VBScript on IIS on Windows with SQL Server. The platform itself is irrelevant.

      What makes this interesting and problematic is that the third party script is common, but that's what you get for trusting third party code to display ads on your web site.

    4. Re:Wrong tag by unity100 · · Score: 3, Informative

      it is wrong to picture this as a lack or shortcoming of sql. sql is doing what query it is given to it. nothing else. its NOT related to sql. it is named a sql injection attack, but its not due to sql.

    5. Re:Wrong tag by jsnipy · · Score: 1

      Sounds to me like the liability rests on the third party who produces the script. Has there ever been such a case?

      --
      -- if you mod me down, I will become more powerful than you can possibly imagine
    6. Re:Wrong tag by Monkeedude1212 · · Score: 1

      No one is saying that SQL Injection is a SQL vulnerability, it's just a nifty way to alter a database without exactly hacking into it. As such, when I hear "SQL Injection" I think "Someones not following security protocols". Or they thought "That will never happen to us".

    7. Re:Wrong tag by Michael+Kristopeit · · Score: 4, Insightful

      it is due to sql... if the databases and website frameworks forced a different query language that forced variable parametrization, there wouldn't be any injection risk.

    8. Re:Wrong tag by endikos · · Score: 2, Insightful

      Not saying it is a problem with SQL. Some SQL statements are being injected into a script, which is then happily executing them. The problem is with the script, but SQL is being injected into it... which is why its known as SQL injection. The term does not imply that the root of the problem is with SQL itself. It's a variant of Code Injection, but with SQL instead...

    9. Re:Wrong tag by unity100 · · Score: 1

      its possible that its script's fault. it is also possible that its iis's fault, if it is not providing proper functions for easily filtering sql queries, or sanitizing them.

    10. Re:Wrong tag by jsnipy · · Score: 1

      However as others have pointed out, that is not really the role of IIS (by default). It is a development issue of building parameters rather than concatenating a statement string together.

      --
      -- if you mod me down, I will become more powerful than you can possibly imagine
    11. Re:Wrong tag by Michael+Kristopeit · · Score: 1

      if SQL forced variable parametrization, there would be no injection risk. this most certainly is an exploit of SQL, not IIS.

    12. Re:Wrong tag by BitterOak · · Score: 3, Insightful

      it is due to sql... if the databases and website frameworks forced a different query language that forced variable parametrization, there wouldn't be any injection risk.

      Mod parent up. According to the GP "it is wrong to picture this as a lack or shortcoming of sql. sql is doing what query it is given to it. nothing else." That's precisely the problem! Most security vulnerabilities are the result of software doing exactly what it is told to do!

      --
      If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
    13. Re:Wrong tag by Anonymous Coward · · Score: 0

      If SQL forced variable parametrization people would look around for a language that allows not parametrized queries. It's so hard to understand?

    14. Re:Wrong tag by magarity · · Score: 1

      it's absolutely a SQL injection attack
       
      Exactly; just look at the logs in the second link. How hard is it anyway to program your scripts to ignore commands in aLtErNaTiNg CaPs?

    15. Re:Wrong tag by Michael+Kristopeit · · Score: 1

      so because people want the feature that was used to exploit it, exploiting that feature is no longer considered an exploit. not hard to understand at all.

    16. Re:Wrong tag by Anonymous Coward · · Score: 0

      when i hear "SQL Injection" I think of a giant hypodermic needle, full of alphabet soup, being injected into Bill Gates' nose.

      I am so fucking high right now.

    17. Re:Wrong tag by LurkerXXX · · Score: 4, Interesting

      It certainly is SQL injection. A query was allowed to run which did bad things. I run everything through well parametrized stored procedures. The webserver client isn't allowed to look directly at any tables, insert, delete, or do ANYTHING other than run those set stored procedures. No 'bad' queries are allowed to run on my server because of that. These folks used an easy-to-use but insecure framework, and got the results that very often happen in that circumstance.

    18. Re:Wrong tag by unity100 · · Score: 1

      guy.

      sql was given a query that was exactly the same with other queries script gives it. with the SAME database user that script uses. its SCRIPT's fault for allowing an unauthorized user to run a sql query as s/he wants.

      it is NOT a fault of SQL. sql does what query you give it. if you fail at the point of GIVING that query, you cant blame sql for it.

    19. Re:Wrong tag by Dogtanian · · Score: 1

      if the databases and website frameworks forced a different query language that forced variable parametrization, there wouldn't be any injection risk.

      Yes (or rather, no- see below), but it would be at the expense of making SQL a PITA for the very common cases where we're using hardcoded parameter values and there isn't a cats chance in hell of any risk; e.g. you wouldn't be able to say

      SELECT * FROM Foods WHERE type = "hamburger"

      It'd have to be

      SELECT * FROM Foods WHERE type = "$1"
      PARAM1 = "hamburger"

      ...or whatever syntax was used. And the reason would be that which caused SQL injection problems in the first place.

      Assembling SQL statements by concatenating strings within a program and only *then* passing them to the SQL/DBMS engine means that the DBMS itself can't "know" how the statement was created. It doesn't know whether "hamburger" is actually hardwired or plastered in there by an inept PHP script.

      <infomercial>But wait.... there's more!</infomercial> The above was going to be a qualified "agreement" until something rather obvious smacked me in the face. I realised that the PARAM1 = "hamburger" bit was prone to exactly the same problem!

      So I'm not sure what the solution is unless the DBMS can somehow impose additional restrictions on how it's fed data. And this strikes me as a workaround for some people's lack of skill that would just make things more complicated and likely have its own (but less obvious) drawbacks.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    20. Re:Wrong tag by aztracker1 · · Score: 1

      I think the issue is a particular application or framework that may be popular. ASP.Net has been the tool of choice for about 8-9 years now with IIS based apps. I think it's wrong to suggest it's IIS or SQL specifically. ASP.Net's recommended input methods have been parametrized queries from the beginning. I'm more curious to find which application specifically is being targeted, not that it is IIS. This is very different from the worms in the late 90's and early 2000's that targeted IIS specifically. And the framework itself does have parametrization as the recommended method.

      I'm not a fan of a "safety scissors" equivalent for programming in C#. If a developer is stupid enough to cut themselves up, they kind of deserve what they get. This isn't an issue with the underlying platform, but the apps on that platform.

      --
      Michael J. Ryan - tracker1.info
    21. Re:Wrong tag by Michael+Kristopeit · · Score: 1
      it isn't prone to the same problem... the query and the variables are each separate commands... stop thinking about strings

      SELECT * FROM Foods WHERE type=$1 hamburger

    22. Re:Wrong tag by Michael+Kristopeit · · Score: 1

      SELECT * FROM Foods WHERE type=$1
      *new command*
      hamburger

    23. Re:Wrong tag by t33jster · · Score: 2, Informative

      SELECT * FROM Foods WHERE type = "hamburger" It'd have to be SELECT * FROM Foods WHERE type = "$1" PARAM1 = "hamburger"

      This functionality you propose is available today, although not required (at least in Oracle where I'm familiar). Look into bind variables. in fact, let me google it for anybody reading this who wants to know how to prevent sql injection. http://www.lmgtfy.com/?q=bind+variables The positive side effect (again in Oracle) is that use of bind variables reduces the CPU cost of parsing SQL statements, so not only should you use bind variables, you should REALLY use bind variables.

      --
      Take off every 'sig' for great justice.
    24. Re:Wrong tag by LurkerXXX · · Score: 1

      Apparently you aren't familiar with SQL injection. It almost always occurs the the SAME user database as the databases scripts use. And no one said it's the fault of the SQL language or database. SQL injection happens, almost always, because of bad app developers. In this case the ones designing and using the 3rd party scripts. Using well parametrized stored procedures in the RDBMS prevents it. Even if the web developers are idiots.

    25. Re:Wrong tag by MillionthMonkey · · Score: 1

      I realised that the PARAM1 = "hamburger" bit was prone to exactly the same problem!

      No it isn't; the SQL is parsed before it looks at the hamburger. It doesn't blindly plug parameter values into the query string and then parse the resulting SQL.

    26. Re:Wrong tag by butlerm · · Score: 1

      it is due to sql... if the databases and website frameworks forced a different query language that forced variable parametrization, there wouldn't be any injection risk.

      A query language that doesn't allow literals? That is not very practical.

      Or a website framework that doesn't allow you to construct queries at runtime? That is not very practical either.

      This is not SQL's fault (although MS SQL is particularly susceptible) - it is the fault of programmers who do not have a clue.

    27. Re:Wrong tag by butlerm · · Score: 1

      This particular form of SQL injection *is* an MS SQL vulnerability. You couldn't mount an attack a tiny fraction as severe as this on on any other database other than Sybase (which MS SQL was originally derived from).

    28. Re:Wrong tag by Anonymous Coward · · Score: 0

      SQL's combination of commands/literals in a single string query is what was exploited. my only point is that SQL wasn't NOT exploited. a query language could still allow literals if it was stateful and accepted the literals in a separate query.

    29. Re:Wrong tag by Dogtanian · · Score: 1

      No it isn't; the SQL is parsed before it looks at the hamburger. It doesn't blindly plug parameter values into the query string and then parse the resulting SQL.

      Given that it's hypothetical syntax (or was meant to be), that does depend how it's implemented. It's quite possible that another string- rather than "hamburger" contains an embedded quote followed by some further commands.

      Though it might not need to be that way, as the other reply to my original post said (and I accept that the second point I made may have been incorrect, though I still think that my main point- that requiring parameters for *all* variables would be a PITA compensation for some people's incompetence).

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    30. Re:Wrong tag by MillionthMonkey · · Score: 1

      In theory it could be implemented either as "plug then parse" or "parse then plug", but realistically the "parse then plug" approach is going to appeal much more to a database writer- who only cares about translating the query into the correct internal data structures with pointers to different parameters in the correct places. (Whether they point at literals, or subqueries, or arrays, or are still NULL waiting for their parameter settings, or whatever.)

      I'm not sure what the payoff would be in doing it the other way. A "plug then parse" approach would be suicidal in the case of an IN clause or an embedded query. The parser could encounter a query string bigger than the database itself. (This obviously isn't a problem with the manually constructed queries everyone is talking about, but it would become a huge mess.) And of course there could be a SQL injection attack hiding in there anywhere, and detecting it wouldn't be trivial.

    31. Re:Wrong tag by dindi · · Score: 1

      Stored procedures CAN help with this issue. Not making parameters optional at the end, serializing data, using magic quotes etc... etc... ..are all small things you can make your sites safer with....

      Also QUERY LANGUAGE .... allows you to run queries. It is the badly written web app (or webserver) that allows the queries to be executed, it is not SQL's fault, wether it is Oracle (sql), MySWL or M$ Sql .....

    32. Re:Wrong tag by man_of_mr_e · · Score: 1

      The attack seems to be targeting a specific application, as such it can only be as "severe" as the applications pervasiveness. If the app were installed only only one computer, it could only attack one computer. If the app is on a million, then it can potentially attack a million.

    33. Re:Wrong tag by butlerm · · Score: 1

      The severity refers to a type of vulnerability that *every* MS SQL app that does not properly bind variables is subject to, one that is much worse than applications that use other databases.

      Of course you have to find an application that has a particular instance of the vulnerability in order to exploit it. MS SQL makes an attacker's life much easier in that regard too.

    34. Re:Wrong tag by man_of_mr_e · · Score: 1

      There is no vulnerability that is being taken advantage of in MS SQL, it's a vulnerability in the app.

      If there is such a vulnerability, it exists in most major databases, including MySQL and Postgres.

    35. Re:Wrong tag by Bungie · · Score: 1

      Mod parent up. According to the GP "it is wrong to picture this as a lack or shortcoming of sql. sql is doing what query it is given to it. nothing else." That's precisely the problem! Most security vulnerabilities are the result of software doing exactly what it is told to do!

      SQL's job is to efficiently run queries. It's job is not to not question and validate every statement that it receives. The SQL engine has no idea how the data is being used in the program that passed it the statement. That would be like requiring your intel processor to determine that every instruction will be part of a securly written block of code before it executes it.

      A layer of abstraction between the low interface (SQL) and the user supplied parameters is what is needed. It's common sense. In this case, the script should be that layer and should clean and validate user input before forming them into queries and passing them to SQL. The script is the one that best understands how the user inputs and the query will interact.

      Even if SQL did do more, it would only encourage lazy, insecure script developers who write insecure code and expect SQL to sort it all out in a consistent manner.

      --
      The clash of honour calls, to stand when others fall.
    36. Re:Wrong tag by butlerm · · Score: 1

      There is no vulnerability that is being taken advantage of in MS SQL, it's a vulnerability in the app.

      I said MS SQL "app" for a reason. MS SQL is not directly vulnerable, it is _indirectly_ vulnerable in spades.

      If there is such a vulnerability, it exists in most major databases, including MySQL and Postgres.

      Sorry. There are no databases other than MS SQL, Sybase, and derivatives that allow the injection of an entirely new SQL statement where a literal belongs. It is due to the way they support combining multiple statements separated by semicolons.

      Other databases that allow you to do that (Oracle for example) use a block syntax (begin/end, etc) that makes it impossible to change a single SQL statement into multiple SQL statements by inline substitution.

      All SQL databases are of course vulnerable to predicate expansion by inline substitution, it is just that predicate expansion: "SELECT * FROM table WHERE x = 5 OR 1 = 1" is not remotely as exploitable as trivial statement injection "SELECT * FROM table WHERE x = 5; {arbitrary statement/procedure here}".

      Predicate expansion in a select statement at best leads to an information disclosure vulnerability. Statement injection, which is only possible on Sybase and MS SQL, converts every such vulnerability into the equivalent of a root exploit.

      Well designed systems have a property known as "defense in depth". MS SQL does not, and they ought to fix it, before it becomes known as the database where every sophomoric programming mistake as potentially catastrophic consequences. Talk about an Achilles' heel. An entirely unnecessary one.

    37. Re:Wrong tag by Bungie · · Score: 1

      IIS is a web server, it has nothing to do with providing script functions or queries at all. All it does is take user input, run the script through the scripting language's interpreter, and serve the output. It doesn't know shit about how the script, scripting language, or SQL works.

      If I have a PHP script that doesn't sanitize inputs, it's not up to IIS to insert PHP functions that will do it. How would it even know what to sanitize inputs for? It could sanitize the inputs for Perl which would do shit if I'm using them to form a query string.

      --
      The clash of honour calls, to stand when others fall.
    38. Re:Wrong tag by unity100 · · Score: 1

      is it ? but it was so very alright while you were dumping the deficiencies of the SCRIPT language that the app uses, onto the database query language.

      if that can be done, why cant we dump web server's all responsibilities of security onto the database query language too ? its only logical, since you were illogical enough to hold the database language responsible for the deficiencies of the scripting language.

    39. Re:Wrong tag by man_of_mr_e · · Score: 1

      Sorry. There are no databases other than MS SQL, Sybase, and derivatives that allow the injection of an entirely new SQL statement where a literal belongs. It is due to the way they support combining multiple statements separated by semicolons.

      Wrong.

      http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html

      Also:

      http://www.postgresql.org/docs/6.4/static/install12418.htm

      "(Get in the habit of including those SQL semicolons. Psql won't execute anything until it sees the semicolon or a "\g" and the semicolon is required to delimit multiple statements.)"

    40. Re:Wrong tag by Kalriath · · Score: 1

      MSSQL allows the same thing - with the same benefits (greatly increased query speed due to execution plan caching and query compilation).

      SELECT * FROM Foods WHERE Type = @foodType
      @foodType = "hamburger"

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    41. Re:Wrong tag by Kalriath · · Score: 1

      You wouldn't be able to do this with my MSSQL/ASP.NET based applications because I always use Stored Procedures, and don't even allow access to databases except via those procedures.

      Also, the batch syntax used is supported by every DBMS I've looked at (MySQL, PostgreSQL) as well. The only reason this only works with MSSQL is because they do a SELECT from sysobjects, which is Sybase/MSSQL. If they used SHOW TABLES, it'd work just as well on MySQL.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    42. Re:Wrong tag by Kalriath · · Score: 1

      Oracle does too. Except that in Oracle's case, it virtually requires it (that is some verbose syntax they got there).

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    43. Re:Wrong tag by butlerm · · Score: 1

      Good pull on MySQL. Now all you have to do is demonstrate any framework or driver that turns this potentially dangerous option on by default. The drivers for Python? Perl? PHP?

      Your PostgreSQL link is inconclusive, however. A high level command line interface and a low level prepare / bind / execute interface are not the same thing. A command line interface is just another application, and the way it determines you are finished entering a command has no necessary relationship with the way the low level database interface works.

      Oracle, for example, allows the use of semicolons as a top level statement terminator in SQL*Plus (the Oracle command line tool), but if you try to prepare an SQL statement with a semicolon it will throw a syntax error. "ORA-00911 invalid character", to be precise.

      In fact if you enter multiple statements on a line separated by semicolons, SQL*Plus could easily prepare and execute them in series. However what really happens is this:

      SQL> select sysdate from dual; select sysdate from dual;
      select sysdate from dual; select sysdate from dual
                                          *
      ERROR at line 1:
      ORA-00911: invalid character

      SQL*Plus takes off the second semicolon before sending the entire line to the database, but has no idea about the first, leading to the error. This error is the same error that would result if an attacker attempted to use a semicolon to inject an entirely new SQL statement.

    44. Re:Wrong tag by butlerm · · Score: 1

      You are correct. PostgreSQL does have this problem, and it apparently cannot be disabled. See here.

    45. Re:Wrong tag by butlerm · · Score: 1

      Oracle is not trivially vulnerable to semicolon based statement injection. The reason is that it requires block syntax to execute multiple SQL statements in the same prepare / bind / execute sequence. So an attacker cannot convert a poorly programmed SELECT statement into something that does anything other than SELECT things (assuming the word "SELECT" is hard coded of course).

      In common cases where the operation type and the table names are hard coded, predicate expansion attacks could lead to a carelessly programmed SQL statement selecting, updating, or deleting too many rows. Perhaps every row in the pertinent table. But at least the attacker cannot dump your entire schema and manipulate data in any table at will.

    46. Re:Wrong tag by man_of_mr_e · · Score: 1

      Oracle will willingly execute multiple statements on a single line if that line is enclosed in begin/end statements. So while you can't exploit multiple statements with a semicolon in a line that was intended to only execute one statement (or rather a line that doesn't contain begin/end tokens), you can edploit it in statements that do have begin/end statements, which certainly diminishes the attack surface.. but doesn't eliminate it.

      Yes, MySQL does have the ability to turn on and off the feature, but i'm unsure of what the default state is. Even if it's off by default, all it takes is for someone to turn it on because they want to use it in their code.

      Regardless, more databases have the feature than do not. This greatly changes the substance of your claim.

    47. Re:Wrong tag by Michael+Kristopeit · · Score: 1

      the single string command/variables nature of SQL is what was exploited. "fault" is not the issue... one could argue it was the exploiter's parents who are at "fault", but please don't claim SQL was not exploited in this case. it clearly was.

    48. Re:Wrong tag by butlerm · · Score: 1

      Oracle has a similar vulnerability with poorly programmed PL/SQL calls to be sure. It is just that the preponderance of dynamic PL/SQL blocks to compared to ordinary Oracle SQL statements is minimal at best. There are very large Oracle applications that do not have any dynamic PL/SQL blocks - most Oracle applications use statically code PL/SQL exclusively - typically in triggers, database functions, and stored procedures.

      I know that the MySQL interface does not have this option turned on by default. I am admittedly surprised to discover that PostgreSQL not only has it by default, but it cannot be disabled.

      I am quite certain that DB2 does not have this problem. There is no indication in the documentation at any rate. So it would appear that the preponderance of the severe form of the problem (by default) is about 50/50:

      MSSQL: yes
      Sybase: yes
      PostgreSQL: yes

      MySQL: no (by default)
      Oracle: no
      DB2: no

    49. Re:Wrong tag by hesaigo999ca · · Score: 1

      >This functionality you propose is available today
      I think they call it ajax, but i could be wrong....

    50. Re:Wrong tag by godefroi · · Score: 1

      Yeah, you are. "Ajax" has nothing to do with SQL or databases whatsoever.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    51. Re:Wrong tag by godefroi · · Score: 1

      How is MS SQL "particularly susceptible"? It uses the same query language that all the other database engines use. As you say, it's the fault of the application programmers, not the database engine programmers. If anything, I'd point to PHP as the hotbed of SQL injection. Constructing queries at runtime by concatenating input values with sql statements is going to lead to pain, EVERY TIME.

      Runtime-constructed queries and using literal values instead of parameters are not mutually exclusive.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    52. Re:Wrong tag by godefroi · · Score: 1

      Wait, what? It's squarely the fault of the programmer who created the script, not the scripting language. He didn't imply anything else. What is it you're looking to fight over? If you'd clearly state what you have a beef with, we can formulate intelligent arguments for you to counter. Otherwise, it's just shooting in the dark...

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    53. Re:Wrong tag by butlerm · · Score: 1

      I have explained why databases that allow executing multiple SQL statements in one go without using block syntax (like Oracle does, for example) are particularly vulnerable to complete SQL statement injection several times already.

      When block syntax is required to prepare and execute multiple SQL statements in one go, an ordinary dynamic SQL statement is not susceptible to complete SQL statement injection when programmed incorrectly. Instead you get a syntax error.

      This is not to say that people bind parameters, just that there are too many incompetent programmers out there and databases should practice defense in depth as a consequence. Not requiring block syntax for multiple statement execution is asking for trouble.

    54. Re:Wrong tag by hesaigo999ca · · Score: 1

      But Ajax is supposed to hold the info in encrypted format before sending to a POST for the html document model, and thereby avoiding such things as sql injection because you are getting your values from the synched up ajax model running behind the code (.net and others)...i guess you could try to
      manipulate the encrypted info, but from my understanding, you have part of a checksum included inside the code, and if it is off, the page does not post.... i could be wrong again.

    55. Re:Wrong tag by unity100 · · Score: 1

      precisely. that is why the idiots who are trying to hold sql responsible for the event, are beyond stupid and wrong. or, shills.

    56. Re:Wrong tag by godefroi · · Score: 1

      Requiring block syntax protects against the worst injection attacks, yes. Requiring parameterized queries protects against ALL of them.

      Besides, Oracle is in the minority, here (from my experience). Right or wrong (I've got no dog in that particular fight), most database engines don't require special block syntax.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    57. Re:Wrong tag by godefroi · · Score: 1

      What are you talking about? You don't have the slightest clue what AJAX is, do you?

      AJAX has nothing to do with checksums, encryption, or "models". It's a technique for moving data (any data, in spite of the acronym) to and from the server without requiring a reload of the page. Nothing more, nothing less.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    58. Re:Wrong tag by Anonymous Coward · · Score: 0

      most database engines don't require special block syntax.

      Ah yes, but they should. Add an option to turn off support for the especially vulnerable syntax. Make it the default in the next major version.

      Requiring parameterized queries protects against ALL of them.

      I agree. A query that should be parameterized, but isn't, even properly escaped, is dangerously close to professional malpractice. In many cases it kills performance as well. It is not the sort of rule a database can easily enforce though.

    59. Re:Wrong tag by hesaigo999ca · · Score: 1

      So the fact that M$ uses ajax (within asp.net) to support encryption of their data
      between page posts or self update to avoid any tampering is something
      I guess they know nothing about as well....

      God if I had a nickel every time someone was trying to prove themselves
      by erroneously shooting someone else down....well let's just say
      I would be buying a few hotels down in Dubai.

    60. Re:Wrong tag by godefroi · · Score: 1

      Why not? Just disallow inline literals. If we're going to require major backwards-incompatible changes to database engines, let's fix the REAL problem, not just part of it.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    61. Re:Wrong tag by godefroi · · Score: 1

      Wait, wait, let me try to follow your logic here:

      MS "encrypts" a hidden field and uses AJAX to post it to the server ... somehow leads to ...

      AJAX prevents SQL injection attacks ... somehow leads to ...

      AJAX is the same technology as "bind variables" in database engines ... riiiiiight.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    62. Re:Wrong tag by hesaigo999ca · · Score: 1

      I can see by your tone, no matter what i explain or say it will be for nothing.
      I could clarify that my first post was talking about the previous post above mine /*
      This functionality you propose is available today, although not required (at least in Oracle where I'm familiar). Look into bind variables. in fact, let me google it for anybody reading this who wants to know how to prevent sql injection. http://www.lmgtfy.com/?q=bind+variables [lmgtfy.com] The positive side effect (again in Oracle) is that use of bind variables reduces the CPU cost of parsing SQL statements, so not only should you use bind variables, you should REALLY use bind variables.
      */ ...and most lazy programmers do not do proper sql injection verification on their websites, thinking that AJAX is what M$ proposes to help for post obfuscation, however you are completely right, someone with enough time on their hands could decrypt the encrypted ajax post from the hidden fields on the web page, and then reconstruct a sql injection attack that would pass no problem....however this would take some doing in cracking power, maybe a cluster of nvidia graphics cards running in parallel with that elcomsoft software for cracking...but then again, i know absolutely nothing when it comes to computers....

    63. Re:Wrong tag by godefroi · · Score: 1

      The only chunk of a "postback" (ASP.NET terminology, has nothing to do with AJAX) that is "encrypted" is the "viewstate" hidden field. This field generally contains information on what was in the rest of the form fields at the moment the page was rendered, and is generally used to tell what changed once the form is posted back to the server (the "postback"), as well as store information that for some reason the developer chose not to store in the server-side session state.

      This field could theoretically be posted along with the rest of a form through an AJAX operation, but is not always (never in any AJAX I've done with ASP.NET), and even if it was somehow altered on the client-side, the values contained within would not (in the normal case) be used to construct database queries. Queries would generally be constructed from the CURRENT values that would come from the normal, everyday, unencrypted form fields.

      Microsoft does not propose AJAX as a solution to SQL injection. In fact, they would only propose the solution that most everyone else in the entire world would propose, which is parameterized queries (or "bind variables" as they've been referred to). They wouldn't propose AJAX, because AJAX, as I've stated several times already, has nothing to do with databases and how database queries might be constructed.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    64. Re:Wrong tag by hesaigo999ca · · Score: 1

      >Karma: Poor (Mostly affected by lame karma-joke sigs)
      Or just never knowing when to give up....

    65. Re:Wrong tag by godefroi · · Score: 1

      Did you have actual arguments, or only ad hominem attacks?

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    66. Re:Wrong tag by hesaigo999ca · · Score: 1

      Need to have the last word???

  2. Sounds like by by+(1706743) · · Score: 5, Funny

    Bobby Tables strikes again.

    1. Re:Sounds like by Anonymous Coward · · Score: 0

      Nope, nothing like it at all. Take it you didn't read TFA? Or just trying to be the first to jump on the Bobby Tables meme without actually understanding what it means?

    2. Re:Sounds like by by+(1706743) · · Score: 5, Funny

      Take it you didn't read TFA?

      Nope.

      Or just trying to be the first to jump on the Bobby Tables meme...

      Yup.

      ...without actually understanding what it means?

      It means you shouldn't name your kid with SQL in his name?

    3. Re:Sounds like by Nohea · · Score: 4, Informative

      actually, if you read the actual description of the attack is IS a SQL Injection attack on a web script. More advanced than "bobby tables", but basically the same problem.

    4. Re:Sounds like by crow_t_robot · · Score: 1

      Pro-tip: Both relate to not sanitizing inputs before running them in your SQL database.

    5. Re:Sounds like by Anonymous Coward · · Score: 0

      fail. asshat. read up and read down. use parameters in queries. enjoy your 12yo programming skills. lul.

    6. Re:Sounds like by dfetter · · Score: 1

      Better pro tip: always use your SQL engine's parameterization rather than rely on "sanitizing" such inputs. Your engine's parameterizer is extremely well tested, even if it's an engine with relatively sloppy coding practices. Your "sanitizing" script can never be tested quite as well.

      --
      What part of "A well regulated militia" do you not understand?
  3. INJECT THIS !! by Anonymous Coward · · Score: 0

    DROP DA TABLE AND REACH FOR IT MISTER

    You are not logged i

    n. You can log in now using the convenient form below, or Create an Account, or post as Anonymous Coward.

  4. wow by pROCKrammer · · Score: 1

    how webserver could work with SQL? Maybe its scripts problem?

  5. Poor programing practices, NOT IIS or SQL at fault by CharlieHedlin · · Score: 4, Informative

    Anyone writing scripts that don't use parametrized stored procedures for the database or Linq needs to find a new line of work.

  6. I suspect.... by 8127972 · · Score: 0, Troll

    ... That the volume of Apache and PHP downloads are about to go up.

    --
    This is my opinion. To make sure you don't steal it, it's covered by the DMCA.
    1. Re:I suspect.... by Darkness404 · · Score: 1

      Not really because most of the people who use IIS use it either because they run an all MS shop/have support contracts or they don't know how to configure Apache/PHP.

      --
      Taxation is legalized theft, no more, no less.
    2. Re:I suspect.... by bsDaemon · · Score: 1, Insightful

      'cause, you know... no SQL injection has ever occurred in a LAMP environment before. If the problem is SQL-related, then the web server being used is pretty much irrelevant.

    3. Re:I suspect.... by Anonymous Coward · · Score: 0

      i can write shitty code in any language

    4. Re:I suspect.... by Yvan256 · · Score: 1

      That's why I use a LAXP setup. /duck

    5. Re:I suspect.... by Foofoobar · · Score: 1, Troll

      Honestly, no sql injection attack affecting THOUSANDS of sites and THOUSANDS of systems on Apache systems. Yes. Singular attacks by bonehead developer who don't know their head from a singularity. But Microsoft seems to have a record for allowing these things to continue to occur on THOUSANDS of system over and over (ie Code Red, Nimda, etc etc).

      While Apache (which is installed on nearly twice as many systems) still remains far more secure and you never hear of anything like this happening on Linux or Apache systems. So yes, I'd say Apache is pretty darn immune from not only this kind of attack but from your sarcasm as well.

      --
      This is my sig. There are many like it but this one is mine.
    6. Re:I suspect.... by Lord+Ender · · Score: 1

      From a security standpoint, PHP developers are the worst of the web app world. By far.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    7. Re:I suspect.... by bsDaemon · · Score: 1

      I've been a system admin at a fairly popular web hosting company before. Most of the attacks of this nature where not system-related at all, but were attacks against software such as WordPress, Joomla, etc: vulnerabilities in third party, cross-platform software that would have worked on Windows or Linux (We were using CentOS + cPanel). The issues weren't necessarily SQL injections, just software bugs. If this problem actually had anything to do with IIS, then perhaps mentioning it would be valid, but as the articles state, the issues are with non-sanitized input in the web apps, and they just happen to be running on an IIS server. If 12 drunk drives die in car accidents over a weekend and they're all driving Mustangs, do we blame Ford for that? No.

    8. Re:I suspect.... by Lou57 · · Score: 2, Interesting
      Technically, you are correct. But in this incident, the web server being used IS relevant.

      1. The payload is IIS/MSSQL specific. The author WANTS that platform.
      2. The method of injection normally doesn't work on mySQL. jameswilkes over at http://nsmjunkie.blogspot.com/2010/06/anatomy-of-latest-mass-iisasp-infection.html stated it quite well:

      "Also, the SQL contains multiple SQL statements. I use PHP and MySQL databases which by default will only execute one command. That makes it much harder to hack. So switching to PHP and MySQL might be a good security choice."

      --
      Lou
    9. Re:I suspect.... by Khyber · · Score: 1

      This is why I use a card catalog and filing cabinet.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    10. Re:I suspect.... by recoiledsnake · · Score: 1

      The SQL code may be MSSQL specific, but there's nothing stopping anyone from making a MySQL version of it. And it has absolutely nothing to do with IIS. Even Apache running on top of MSSQL would be vulnerable.

      And MySQL doesnt' seem to be reliably safer. http://www.google.com/search?hl=en&client=opera&hs=u5U&rls=en&q=mysql+sql+injection&revid=634420364&sa=X&ei=mowSTNjUJoT7lweXo-32Bw&ved=0CF8Q1QIoAw

      One has to balance the featureset as well before relying on PHP and MySQL.

      --
      This space for rent.
    11. Re:I suspect.... by Jazz-Masta · · Score: 1

      Technically, you are correct. But in this incident, the web server being used IS relevant.

      1. The payload is IIS/MSSQL specific. The author WANTS that platform.

      The platform should be more accurately described as Windows and MS SQL.

      IIS has nothing to do with it - other than IIS and MS SQL are commonly used together. The attack works on ANY website that utilizes MS SQL as a database. Since many smaller websites have both the web server and database server on the same machine, they use IIS and MS SQL. This will also work if you have Linux/Apache as your web server and a separate server with Windows/MS SQL for your database. It will also work if you have Windows/Apache/MS SQL on the same server.

      The tight integration between MS SQL, LINQ, ASP and IIS make that entire platform desirable to have together.

    12. Re:I suspect.... by butlerm · · Score: 1

      The SQL code may be MSSQL specific, but there's nothing stopping anyone from making a MySQL version of it.

      Not even close. MSSQL and Sybase are the only databases that are vulnerable to this form of SQL injection (in combination with sloppy programming).

      With most databases, an SQL injection attack may result in predicate modification leading to information disclosure, too many rows getting updated, or too many rows deleted. No other databases allow an SQL statement to be trivially injected in the middle of another one when the input isn't sanitized.

    13. Re:I suspect.... by Foofoobar · · Score: 1

      On the other side of the argument, how do you explain code red, nimda and the others whereas Linux and Apache has never had an event of such magnitude while having a greater server share (according to Steve Ballmer)? I work with dotnet developers and the way their inputs are cleaned but the framework is nonexistent. I can insert bad data a million different ways because they aren't cleansing it properly prior to insertion. I mentioned this and they looked at me clueless to what i was talking about but insisted that Microsoft musty have secured it or else they wouldn't have sold it. Hows that for logic?

      --
      This is my sig. There are many like it but this one is mine.
    14. Re:I suspect.... by Anonymous Coward · · Score: 0

      Yes, but unfortunately for you the web is full of PHP developers because it's so mindless and doesn't require any understanding of things like object orientation to hack code together. It doesn't require an understanding of data types, and algorithms, because you can guarantee there's somewhere on the web you can copy and paste from, if PHP's horribly jumbled mess of a standard library doesn't provide something for you that may or may not be deprecated next release.

      So expect to be raped for your comment, because there is such a mass of dumb PHP programmers out there who think they know how to program but are barely any better than the people who hacked together bad HTML in days gone by and called themselves web developers, although I suppose those people seem to be writing the HTML5 spec nowadays.

      The world of web development is a terrible, terrible, place. So many people who think they know how to program writing shit code, and PHP is the worst vehicle for it precisely because it does have such a low bar of entry.

      Still, I salute you sir for having the balls to stand up and point out how bad the world of PHP development is.

    15. Re:I suspect.... by Bungie · · Score: 1

      Code Red, Nimda, etc. weren't SQL injection attacks, Code Red was a buffer overflow and Nimda used an IIS traversal bug. They affected IIS4 and 5 which are ancient. Not only that, but Microsoft had the patches available for both issues months before the worms appeared, their spread was due to admin's not applying them. I remember having to patch some pretty critical Apache issues as well in those days.

      Both Apache and IIS have been incredibly secure for years now, and there hasn't been many exploits for either of them. Current web server exploits are usually all related to installed web applications (like forums, blogs or CMS software).

      Apache would be vulnerable to this kind of attack too, the only reason it isn't affected is because the web app uses ASP.NET.

      --
      The clash of honour calls, to stand when others fall.
    16. Re:I suspect.... by Kalriath · · Score: 1

      Oooor, they actually happen to like it. Quit acting like your preference is the only valid one.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    17. Re:I suspect.... by Kalriath · · Score: 1

      Those were dumbass network administrators, combined with a vulnerability in the server itself. The SQL port should never be open to the internet.

      I imagine if lots of stupid Linux admins exposed port 3306 to the internet, we'd see quite a few more MySQL vulns (until eventually they all get fixed).

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    18. Re:I suspect.... by Kalriath · · Score: 1

      Not even close. MSSQL and Sybase are the only databases that are vulnerable to this form of SQL injection (in combination with sloppy programming).

      Really? I didn't realise that MySQL and PostgreSQL weren't databases!

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    19. Re:I suspect.... by butlerm · · Score: 1

      As I mentioned elsewhere, MySQL can enable this dangerous behavior, but does not do it by default. You are correct that PostgreSQL is fully vulnerable to this problem. No option to turn it off either, apparently.

    20. Re:I suspect.... by Kalriath · · Score: 1

      Stop calling it a vulnerability. It's called the batch syntax, and it's supported by every RDBMS in existence.

      The vulnerability is shitty client code not sanitizing inputs.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    21. Re:I suspect.... by butlerm · · Score: 1

      Stop calling it a vulnerability

      If an operating system crashed every time an application attempted to dereference a NULL pointer, would that be a vulnerability or not?

      It's called the batch syntax, and it's supported by every RDBMS in existence.

      Not as part of a single client API prepare / bind / execute sequence.

      Oracle doesn't support it without block syntax, which means that the vast majority of all poorly programmed dynamic SQL statements are invulnerable on Oracle. MySQL doesn't have this behavior unless a client enables it.

      DB2 does not have this behavior. No support for preparing and executing multiple dynamic SQL statements in one go at all. You have to create and install a UDF or stored procedure instead.

      This is a simple problem to fix. All the databases that support this by default should make it an option, and disable the option by default in the next major version of the database. It is not rocket science, and would add a valuable layer of defense to any number of database applications.

    22. Re:I suspect.... by butlerm · · Score: 1

      "Invulnerable to complete SQL statement injection" on Oracle I should say. Such applications are clearly vulnerable to predicate injection regardless:

      SELECT * FROM table WHERE x = 5 OR 1 = 1

      for example.

    23. Re:I suspect.... by godefroi · · Score: 1

      This is a simple problem to fix. All the databases that support this by default should make it an option, and disable the option by default in the next major version of the database. It is not rocket science, and would add a valuable layer of defense to any number of database applications.

      You're right, this is a simple problem to fix. It doesn't even require changes to any of the database servers that are commonly used. Parameterize your queries. Bang, problem solved.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    24. Re:I suspect.... by butlerm · · Score: 1

      There is a simple fix to buffer overflows too. Check all array indexes and pointer calculations.

      After all, if you are so stupid as to install any actual third party software on your system, it is your fault, right? And that of the third party application developers, for being so careless in the first place.

      Since legitimate applications never have any vulnerabilities, there is no reason why operating systems need to have memory protection, right? Surely they would run a lot faster without MMUs, TLBs, user/kernel transitions, and so on. Such protections are a complete waste of time, because responsible application programmers never make such silly mistakes.

    25. Re:I suspect.... by Foofoobar · · Score: 1

      Yes... a vulnerability in the server that you would never see in Linux. Dumbass administrators by the THOUSANDS that are TYPICAL for Microsoft sys admins. Again, not typical for Linux sys admins. I work in a MS shop and the didn't even know what SSH was, how to set up LDAP for Java, what a FQDN was, etc. They are point and click admins and this is the norm; this is what Microsoft training cranks out and this is why these security horrors keep taking place; badly trained sys admins on subpar network tools and systems.

      --
      This is my sig. There are many like it but this one is mine.
    26. Re:I suspect.... by Kalriath · · Score: 1

      No, even Microsoft training doesn't spit out people that stupid. Bear in mind, MCSEs are trained to set up servers, not set up Firewalls. And if the people you deal with don't know what an FQDN is (one of the core important concepts of AD), then they aren't qualified.

      Your experience is not typical for properly trained MS admins either. Shitty admins can make any OS shitty. Stop blaming Windows.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    27. Re:I suspect.... by thousandinone · · Score: 1

      We may not blame Ford for that, but cops DO start looking out for Mustangs at sobriety checkpoints.

    28. Re:I suspect.... by Foofoobar · · Score: 1

      Then you should talk to people at the Java users group in Seattle. This IS typical for most peoples experiences when dealing with them. One guy talked about how a guy built an app in Dotnet and didn't even understand TCP which is what his app was using. Microsoft makes stupid admins and stupid developers. I have yet to meet the exception to the rule. I'm sure you are correct that there IS an exception but you will have to pass his business card along so I can show people that there is ONE person that Microsoft trained who isn't a complete moron.

      --
      This is my sig. There are many like it but this one is mine.
  7. malicious code writers should DIAF by Em+Emalb · · Score: 1

    With their families watching.

    I hate people. No, not you, but them. Over there. Next to the oranges.

    --
    Sent from your iPad.
  8. If it is platform independent by Presto+Vivace · · Score: 1

    why are only IIS sites affected?

    1. Re:If it is platform independent by $RANDOMLUSER · · Score: 1

      why are only IIS sites affected?

      Maybe one of the people with the imaginary friend can give us the chapter and verse about "building your house on sandy ground".

      --
      No folly is more costly than the folly of intolerant idealism. - Winston Churchill
    2. Re:If it is platform independent by toastar · · Score: 1

      why are only IIS sites affected?

      While this might not relate to the article.

      There are quite a few bugs that require case insensitivity, It wouldn't surprise me to see and bug that's 'only on IIS' actually cause problems on a server with mod_speling.

    3. Re:If it is platform independent by Yvan256 · · Score: 1

      That's still better than building your castle on top of a swamp!

    4. Re:If it is platform independent by jimicus · · Score: 1

      The parent only said it COULD be PHP. If only IIS sites are affected, I'd imagine it's probably a language that's exclusive to Windows.

    5. Re:If it is platform independent by Dragonslicer · · Score: 4, Insightful

      SQL injection is completely independent of web server, programming language, and database system. An idiot can write vulnerable code in any language, using any database system, and run it on any web server. My guess about why this is only targeting IIS is that the attack is against some specific ASP.NET code, so the vulnerability isn't in IIS, but the vulnerable code only runs on IIS.

    6. Re:If it is platform independent by capnchicken · · Score: 1

      It looks like, to me, that it is an attack on Google Analytics and MS SQL Server.

      So the target base HAS to have MS SQL (for the code that loops through the specific tables to find your table names to work) and you have to be running Google Analytics (could be wrong about that though) for this to work, IIS and ASP.NET might just be targeted because you are more likely to run into an MS SQL Server. My gut tells me that the attack could possibly be modified to attack other databases still using Google Analytics.

      --
      A libertarian shat on my carpet once. Claimed the free market would sort it out. -Ford Prefect(8777)
    7. Re:If it is platform independent by butlerm · · Score: 1

      why are only IIS sites affected?

      It is not an IIS problem. This particularly severe type of attack only works with MS SQL and Sybase applications, and MS SQL only runs on Windows servers, which typically run IIS.

      MS SQL in combination with Apache would be just as vulnerable, given the same sloppy programming practices. Other databases as well, just not to the same degree.

    8. Re:If it is platform independent by bit01 · · Score: 1

      SQL injection is completely independent of web server

      No it isn't

      And your general implication that "all code is equally vulnerable" is nonsense.

      A nonsense typically promulgated by unethical companies (such as M$, anti-virus companies, even PHP promoters to some extent) trying to cover up the fact that some programming systems are more vulnerable, and more likely to encourage, allow or cause security errors, than others. Any programming system that assumes programmers or users are superhuman and never make mistakes, security or otherwise, is a bad one.

      In other words some companies attempt to design and implement security in depth. Other companies just bullshit.

      ---

      Integrated software = marketing buzzword for "we own all the pieces" = we own you.

    9. Re:If it is platform independent by man_of_mr_e · · Score: 1

      The post you're referencing is BS. Most SQL databases support multiple statements seperated by semicolons, including MySQL and Postgres. The reason is simple, because batching statements into a single query is an optimization that improves performance.

      However, even if we ignore that obviously false claim, you seem to be misinterpreting the point. The point is not about PHP or ASP or anything else. The point is about applications written in those languages, if done poorly are vulnerable to this kind of attack. I don't know about Oracle, but virtually every other SQL database is.

    10. Re:If it is platform independent by butlerm · · Score: 1

      This particular type of SQL injection is something that only Sybase and MS SQL are vulnerable to. As in impossible to exploit on an application using the same sloppy programming practices on any other database.

      Of course that is not to say those applications can't be exploited in other, more generic ways (predicate injection mostly), regardless of database. But only MS SQL and Sybase allow attacks on such poorly written applications carte blanche over the entire database.

      It is not really their fault, but it is something they ought to fix. Given the literacy level in the ASP / PHP / ... programming world, this type of vulnerability will probably be with us for decades, and the MS SQL multi-statement syntax makes an exploit far worse than it needs to be.

      It is sort of like auto-upgrading a information disclosure vulnerability into a root exploit. It is that bad.

    11. Re:If it is platform independent by Bungie · · Score: 1

      In part of the exploit's header there's:

      GET /page.aspx utm_source=campaign&utm_medium=banner&utm_campaign=campaignid&utm_content=100×200;dEcLaRe%20@s%20vArChAr(8000)%20sEt%20@s=0x6445634C6152652040742076........

      The banner serving software uses "page.aspx" which is an ASP.NET file. I think ASP.NET is only available for IIS.

      --
      The clash of honour calls, to stand when others fall.
    12. Re:If it is platform independent by Bungie · · Score: 1

      Any script on any web server can fail to validate inputs and pass injected code to an SQL query. In this case IIS was affected because the banner software uses ASP.NET. You could easily have an Apache web server on Linux and it can pass injected SQL code to an MS SQL server or any other kind.

      The link you provided refers to MSSQL Server which is not a web server. The SQL injection code is built on the web server and could be modified to work with other SQL servers. The injection code is MSSQL specific because the semicolon command syntax.

      So yeah, SQL injection if fairly web server independant.

      --
      The clash of honour calls, to stand when others fall.
    13. Re:If it is platform independent by Dragonslicer · · Score: 1

      That link only refers to a specific style of injection attack, not SQL injection in general. I said nothing about "all code" being equally vulnerable, because well written code won't be vulnerable, no matter what language it's in. Poorly written code, however, will be vulnerable, no matter what language it's written in. The fact that you claim that the statement "SQL injection is completely independent of web server" is false demonstrates quite clearly that you don't know what you're talking about, since the web server is in no way involved in what queries are sent from the programming language to the database.

    14. Re:If it is platform independent by Kalriath · · Score: 1

      No, no it is not only MSSQL and Sybase. MySQL and PostgreSQL will also happily execute multiple commands in a query if you terminate the first with a semicolon. They always have done.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    15. Re:If it is platform independent by Kalriath · · Score: 1

      Databases don't use Google Analytics. Google Analytics is hosted by Google and served via Javascript to the browsers. It doesn't even know if you have a database.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    16. Re:If it is platform independent by butlerm · · Score: 1

      As I indicated earlier, MySQL has an option for this, but does not do it by default.

      I stand corrected on PostgreSQL. Apparently, the developers showed the same lack of foresight as the Sybase / MS SQL developers did. Or perhaps bad ideas are contagious.

      In any case, all the databases that support this behavior ought to deprecate and disable it, because in the real world, it is an invitation for severe problems. Sort of like opening root shell access to a random passersby by accident.

    17. Re:If it is platform independent by Thorwak · · Score: 1

      Any particular reason you linked to an older version of the documentation? :D

      http://dev.mysql.com/doc/refman/5.5/en/c-api-multiple-queries.html

      " As of MySQL 5.5.3, CLIENT_MULTI_RESULTS is enabled by default."

      Anyway, there are a million reasons to sanitize input before doing ANYTHING with it, SQL injection is only one of them. Ppl blaming the DBs for these kinds of things probably had a server or 50 FUBARed and really want to be somewhere else right now.

      --
      Connection closed by foreign host.
    18. Re:If it is platform independent by godefroi · · Score: 1

      MSSQL, Sybase, MySQL, PostgreSQL, SQLite.

      In fact, I've never used a database engine that DIDN'T allow multiple statements. Do you have one in mind that doesn't?

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    19. Re:If it is platform independent by godefroi · · Score: 1

      This is a bog-standard SQL injection attack, that basically every single database engine ever created is vulnerable to, when paired with a sufficiently brain-dead programmer.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    20. Re:If it is platform independent by butlerm · · Score: 1

      Good pull. Unfortunately, though, this is another reason for me to avoid third party developed MySQL applications, especially anything developed in (horror of horrors) PHP.

      Linking to an older version of the documentation was not intentional, by the way.

    21. Re:If it is platform independent by butlerm · · Score: 1

      Oracle allows multiple statements, but only with block syntax, which means poorly programmed ordinary statements are immune. DB2 does not allow multiple statements to be prepared and executed in one go at all, as far as I can tell, anyway.

      The fact that these other databases allow it without block syntax does not mean it is a good idea. On the contrary, an extraordinarily bad one, due to the prevalence of incompetent code monkeys out there.

    22. Re:If it is platform independent by butlerm · · Score: 1

      Oracle and DB2 are immune to this type of attack against an ordinary SQL statement, poorly programmed or otherwise. Perhaps both take in umpteen billion dollars for a reason. Like foresight in syntax design, perhaps.

    23. Re:If it is platform independent by godefroi · · Score: 1

      Because noone ever uses block statements in Oracle, amirite?

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    24. Re:If it is platform independent by godefroi · · Score: 1

      So poorly programmed ordinary statements are immune. What about poorly programmed block statements?

      Seriously, I get your point here. It's great, but it's not a cure-all. The cure-all is to disallow queries that use literals. If that's even possible. The practical answer, is "don't program stupid". Unfortunately, that's unrealistic, so rest assured we'll get to have this discussion over and over for the foreseeable future :)

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
  9. Here let me fix that for you by DaveV1.0 · · Score: 1

    its not 'sql'. its not IIS. sql accepts any query given to it by the program. its the script's job not to let in any malicious queries. its a scripter's fault.

    --
    There is no "-1 offended" or "-1 you don't agree with me" mod options for a reason.
  10. But... by MrEricSir · · Score: 1

    But I thought platform independence was a good thing!

    --
    There's no -1 for "I don't get it."
  11. Re:Poor programing practices, NOT IIS or SQL at fa by ComaVN · · Score: 3, Interesting

    What is wrong with using regular parameterized queries instead of SPs?

    --
    Be wary of any facts that confirm your opinion.
  12. more info on malware? by Anonymous Coward · · Score: 0

    The threatpost article says "which then installs malware on the victims' machines" -- anyone have info as to what malware they're referring to? Is it known? Detected?

  13. graceful by MagicMerlin · · Score: 5, Funny

    It was nice of them to deallocate the cursor when done. Thanks!

  14. Re:in b4 by wygit · · Score: 1

    from the article:

    "What do all these sites have in common? They are all hosted on IIS servers and using ASP.net. This is the output of our scanner against www.intljobs.org:"

  15. utm query parameters? by the_one_wesp · · Score: 1

    Reading through the Sucuri article, the script piggy backed on a utm_content query parameter. Aren't these used in metrics tracking like Google Analytics? Has anyone mentioned a name of the 3rd party that let this one slip?

    1. Re:utm query parameters? by Anonymous Coward · · Score: 0

      This is a generic MS-SQL injection and is NOT targeted at any specific 3rd party app/module. I have sample attempts against parameters other then utm_* that are completely custom. In the past the speculation has been that they just harvest URLs from google looking for .asp/.aspx and parameters. This is a good indicator of a MS-SQL backend. Once you have this list you just spray n' pray.

      http://nsmjunkie.blogspot.com/2010/06/anatomy-of-latest-mass-iisasp-infection.html

  16. So... it is really due to CPU's? Re:Wrong tag by Fubari · · Score: 3, Insightful

    it is due to sql...

    Huh? It happened because they use sql?
    Following that line of thought,
    isn't it really due to the use
    of CPU's in those servers?

    1. Re:So... it is really due to CPU's? Re:Wrong tag by ashridah · · Score: 1

      So it's Silicon's fault? Clearly this means we need to ban sand immediately.

      That's it! No Sand In The Datacenter!

    2. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1

      if your front door had a lock that could be opened by anyone pushing a button clearly marked on the outside, and a robber pushed the button and came in, would you consider that a fault of the lock, the door, or the house?

    3. Re:So... it is really due to CPU's? Re:Wrong tag by AndrewNeo · · Score: 1

      You don't even have to go that far down. Technically, the script was doing as it was told! Just because the injection wasn't what you wanted, didn't mean the script didn't let it do it, just like the SQL server, and just like the CPU.

    4. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1
      most scripts use query parametrization libraries on top of SQL... so when the script author chose to not use a more secure way of utilizing SQL it suddenly becomes an exploit of something else?

      on 9/11 was the airplane exploited, or the gasoline? everyone is to blame, and protecting a method of instructing a server to do something that doesn't inherently protect against malicious user input serves nothing.

    5. Re:So... it is really due to CPU's? Re:Wrong tag by Anonymous Coward · · Score: 0

      the answer is house right?

    6. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1

      you're not even sure what you yourself consider?

    7. Re:So... it is really due to CPU's? Re:Wrong tag by squiggleslash · · Score: 5, Informative

      Geez guys. There's more finger pointing in here than a meeting between BP, Transocean, and Haliburton.

      It's not a flaw in any of the technologies used, it's a flaw in how they were used together. The programmers who wrote the scripts didn't properly validate incoming data. That's all there is too it.

      Yes, aspects of SQL probably didn't help, but quite honestly, it was a programming decision to use SQL in the first place.

      Either way, fix it!

      --
      You are not alone. This is not normal. None of this is normal.
    8. Re:So... it is really due to CPU's? Re:Wrong tag by drachenstern · · Score: 1

      Obviously I would blame the federal government :p

      Ok, that was too easy, I'm gonna stand back and watch the flame war grow right off the very trail of this post :p

      No, wait, I blame the robber. He should've set the Evil Bit and then I would've known to deny him entry...

      No wait, I blame the lock, because

      Hold on, I should probably blame myself, for having anything I considered my own ...

      Oh wait, now we're back to blaming the federal gov't...

      Oh, I give up! Take it all!!!

      (Que mods who don't recognize a joke and que trolls who don't recognize this is not a troll-starting-post)

      --
      2^3 * 31 * 647
    9. Re:So... it is really due to CPU's? Re:Wrong tag by panda · · Score: 1

      None of the above. It's the fault of the owner for having such a thing installed and/or not replacing/fixing it so it does not work that way.

      "SQL Injection Attacks" are not the fault of SQL, but of programmers who don't realize that people will either deliberately or accidentally submit bad data, and that data might even include executable code.

      There are many, very simple ways to avoid SQL injection attacks. If your web programming environment doesn't help you avoid them, then you are doing something wrong, very wrong.

      --
      Just be sure to wear the gold uniform when you beam down -- you know what happens when you wear the red one.
    10. Re:So... it is really due to CPU's? Re:Wrong tag by DaTroof · · Score: 2, Insightful

      How about we try an analogy that's a little closer to the original topic? Let's say the exploit injected system commands instead of SQL commands. The fault wouldn't lie with the operating system, even though that's what was ultimately compromised. It would lie with the script that failed to sanitize input properly.

      Same thing with SQL. The problem isn't the query language itself. The problem is how the script executes queries.

    11. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1

      the line of thought is that SQL is the last place that malicious input penetrated in this attack.... SQL's inherent non-use of variable parametrization was exploited. SQL was exploited.

    12. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1
      so the thing that requires "replacing/fixing" in this example is direct use of SQL, but the user is to blame for the exploit?

      why is "microsoft" and "internet" still keywords, but now "sql" has now been removed after a few people wrongly complained? you're basically saying using SQL on it's own is very wrong, but SQL is not to blame.

    13. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1

      if the database server required queries to use parametrized variables, there would be no room for injection exploits.

    14. Re:So... it is really due to CPU's? Re:Wrong tag by Tolkien · · Score: 1

      Geez guys. There's more finger pointing in here than a meeting between BP, Transocean, and Haliburton.

      Yeah. Stop pointing the finger, people!

      It's not a flaw in any of the technologies used, it's a flaw in how they were used together. The programmers who wrote the scripts didn't properly validate incoming data. That's all there is too it.

      Yes, aspects of SQL probably didn't help, but quite honestly, it was a programming decision to use SQL in the first place.

      Either way, fix it!

      Um.. wait. Now you've done it too. :P

    15. Re:So... it is really due to CPU's? Re:Wrong tag by DaTroof · · Score: 1

      Agreed, but that's a function of the interface that connects to the database, not the query language itself.

    16. Re:So... it is really due to CPU's? Re:Wrong tag by Unordained · · Score: 1

      Your response interestingly demonstrates the cognitive dissonance required by the question. In the first paragraph, you blame the owner. In the second, the programmer. That's like saying on the one hand it's the property owner's fault for having a bad lock, and on the other it's the fault of the contractor he hired to build/install it. Both are true, from a certain point of view (Luke). The general public, cops, insurance company and the wife blame the guy who hired the contractor; the guy blames the contractor (and the contractor blames the manufacturer.) For the purposes of the discussion, when assigning blame, we should clearly define who is doing the assigning -- the guest users of the sites, the paying users, the ones who get data stolen, the site maintainers, ... ?

    17. Re:So... it is really due to CPU's? Re:Wrong tag by tc3driver · · Score: 1

      if your front door had a lock that could be opened by anyone pushing a button clearly marked on the outside, and a robber pushed the button and came in, would you consider that a fault of the lock, the door, or the house?

      Answer is none of the above, I would fault the owner :) On topic, the script should catch these sorts of things before processing.

      --
      42 69 6C 6C 20 47 61 74 65 73 20 69 73 20 61 20 77 68 6F 72 65 21
    18. Re:So... it is really due to CPU's? Re:Wrong tag by mweather · · Score: 1

      I'd blame the lock, the lock being the script that allows access to the SQL database (which would be the house).

    19. Re:So... it is really due to CPU's? Re:Wrong tag by mweather · · Score: 1

      you're basically saying using SQL on it's own is very wrong, but SQL is not to blame.

      SQL isn't to blame, is the script that doesn't use it properly (and the person who wrote it) that are to blame. If I accidentally shot you, would you blame the gun or the idiot using the gun improperly?

    20. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1
      i wouldn't claim that the gun had no role in my being shot, or that guns without a safety aren't prone to more accidents.

      my point isn't that SQL is bad or SQL without forced variable parametrization is bad... my point is that it is wrong to claim "SQL was not exploited", as the original poster claimed, when it clearly was. any language that mixes user input as string variables in with string commands, all interpreted together, is prone to injection exploits. this includes most shell command line interfaces... that isn't necessarily a bad thing, but don't claim it isn't exploitable.

    21. Re:So... it is really due to CPU's? Re:Wrong tag by ffreeloader · · Score: 1

      f your front door had a lock that could be opened by anyone pushing a button clearly marked on the outside, and a robber pushed the button and came in, would you consider that a fault of the lock, the door, or the house?

      You failed to give the correct option. The correct answer is: the idiot that installed such a lock.

      Seems to me that this is a validation problem.

      --
      "while democracy seeks equality in liberty, socialism seeks equality in restraint and servitude." de Tocqueville
    22. Re:So... it is really due to CPU's? Re:Wrong tag by Anonymous Coward · · Score: 0

      are you calling yourself an idiot?

    23. Re:So... it is really due to CPU's? Re:Wrong tag by tattood · · Score: 1

      You're saying that the scripting language should sanitize the inputs given to the query language.
      He's saying if the query language had been written differently, it would not require the scripting language to sanitize inputs.

      --
      WTB [sig], PST!!!
    24. Re:So... it is really due to CPU's? Re:Wrong tag by Mordac+the+Preventer · · Score: 1

      if your front door had a lock that could be opened by anyone pushing a button clearly marked on the outside, and a robber pushed the button and came in, would you consider that a fault of the lock, the door, or the house?

      It would be the fault of the eejit that set it up like that. Locks, doors and houses have no free will - it's not "the door's fault" that it works as designed.

      --
      SteveB.
    25. Re:So... it is really due to CPU's? Re:Wrong tag by Anonymous Coward · · Score: 0

      he was just asking everyone to consider him as an idiot... strangely, i was able to do it seemingly instantaneously. quantum imagination?

    26. Re:So... it is really due to CPU's? Re:Wrong tag by Anonymous Coward · · Score: 0

      was the door exploited? was the lock exploited? was the house exploited?

    27. Re:So... it is really due to CPU's? Re:Wrong tag by butlerm · · Score: 1, Informative

      Yes, aspects of SQL probably didn't help

      More accurately, aspects of MS SQL didn't help. No other database (other than Sybase) is even remotely as vulnerable as MS SQL is (in the presence of bad programming) due to way it lets you combine multiple statements.

      Other databases that let you combine multiple statements have a block syntax that makes it impossible to inject one statement in the middle of another one. That MS SQL "feature" is practically designed to make poorly written applications vulnerable to attacks in the worst possible way. If Microsoft has a clue, they will deprecate it, provide an option to turn it off, and require some sort of block syntax to do the same thing.

    28. Re:So... it is really due to CPU's? Re:Wrong tag by Bungie · · Score: 1

      If the author chose to use a less secure way then it is an exploit in his script.

      If I copy an unchecked buffer in C and cause a buffer overflow exploit to be in my program, it's not an exploit in C or the Standard C Library, it's an exploit in my program only.

      There's no way you could even correct C to somehow save you when you do something like that because it negates a primary function of the language. If it did it would no longer be the same language and would become something like C# instead.

      In the 9/11 example, Gasoline can only provide a low level function: it burns. It can't be modified to prevent hijacking or to not burn in certain situations. The airplane flies, it also cannot decide who is pilot and who is hijacker. Those concerns are left to airline/airport security, who would be to blame.

      --
      The clash of honour calls, to stand when others fall.
    29. Re:So... it is really due to CPU's? Re:Wrong tag by tuomoks · · Score: 1

      A cheap way out, blame the slave, worker, whatever who was instructed to do the work! You mean that the lowest layer in chain has to fix the problems caused from top? And you don't call that finger pointing?

      As you say - whoever made the decision to use for ex. SQL scripts fed from unchecked sources to unprotected environment is to blame, not SQL itself. It's as "Mordac the Preventer (36096)" a little earlier says, "It would be the fault of the eejit that set it up like that. Locks, doors and houses have no free will - it's not "the door's fault" that it works as designed."

      Programmers, developers, administrators and ilk don't make these decisions - managers, CIOs, CTOs, etc make those decision! Maybe instead of "root cause" we should start looking "tree top" problems?

      Yes, of course any and all environments can be made safe and secure (technically), some are just much easier and less costly than others. But even IIS, Windows, etc can be made very safe but it will cost (a lot) and needs knowledge (a lot), not just some paper "certified" people and marketing manuals. And keeping those environments safe without security architecture will be a nightmare, probably impossible on long run!

    30. Re:So... it is really due to CPU's? Re:Wrong tag by Kalriath · · Score: 1

      Oh bullshit. You can just as easily block multiple statements in MySQL. I've done it before (exploited SQL injection in software on my own server to execute a query the software didn't want to let me). If you're doing it properly (using parameterised queries) then this sort of issue doesn't happen in any RDMS. I'm not certain on PHP, but .NET most definitely allows parameterised queries, and goes to some effort to make it obvious that's what you should be doing)

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    31. Re:So... it is really due to CPU's? Re:Wrong tag by butlerm · · Score: 1

      You can do it, yes. But it an option you have to turn on. The MySQL developers are not yet so clueless as to enable it by default.

      See http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html

    32. Re:So... it is really due to CPU's? Re:Wrong tag by Kalriath · · Score: 1

      That's not a MySQL setting, that's a client library setting. So, like everyone's been telling you, the client is responsible for preventing bad stuff happing, not the server.

      Interestingly, whoever wrote the MySQL/Net client library did leave support for it in.

      And besides, it's still your fault if software you write gets hit with an SQL injection. Use parameters, it's what they're for.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    33. Re:So... it is really due to CPU's? Re:Wrong tag by Michael+Kristopeit · · Score: 1
      the author could have chosen to use a database query language that REQUIRED variable parametrization... then string injection would not be an exploit attack pathway.

      i am not talking about assigning fault to anything, as the rest of you are clearly obsessed with. i am simply pointing out that it is patently false to claim SQL wasn't exploited. it was.

    34. Re:So... it is really due to CPU's? Re:Wrong tag by butlerm · · Score: 1

      The MySQL client library is the interface that all (non-internal) SQL access to the MySQL server goes through. The defaults that it sets are the ones that will be picked up by all MySQL client applications by default. And the default is OFF. You can verify that by reading the documentation.

      The MySQL client library is the only way for an external application to talk to the database. As a rule, it is the only way for most internal (MySQL developed) applications to talk to the database. Database wire protocols tend to be proprietary, database specific, and poorly documented. They are always changing as new features are added, because they must support every database specific feature. As a consequence the client libraries are almost invariably developed by the database server developers and maintainers. This is true of every proprietary database, and MySQL and PostgreSQL as well. It is not an accident that the documentation for these libraries is part of the database documentation on the primary website for each.

      I don't write code, by the way, that is subject to SQL injection. But that doesn't mean I have time to review the coding practices of the developers of every application I install on systems I am responsible for. That is why every database should make this an option at best, and support block syntax so that application developers have no reason to turn it on.

      Otherwise it is like saying, I don't need fire insurance, because I never start any fires.

  17. It's Sloppy Development by a Sloppy Developer by BSDetector · · Score: 1

    If it is a SQL Injection attack - then it's sloppy development by a sloppy developer. Platform/DB... independent!

  18. talk about forgetting/pretending. by Anonymous Coward · · Score: 0

    http://dealbook.blogs.nytimes.com/2010/06/11/morgan-stanley-jpmorgan-to-take-lead-on-a-g-m-i-p-o/?hpw

    george orwell taught these guys well. everything will be doublegood soon?

  19. We Got Hit By This by Anonymous Coward · · Score: 5, Informative

    I run a site that got hit by this. It's hosted by Rackspace Cloud, so one presumes that IIS and MSSQL were patched up. We aren't using any kind of ad network, so I think the attackers were just looking for ASP sites that used queries. We got hit because we failed to sanitize inputs in one spot.

    We were lucky, though. Since the attack blasts the script code into every column of every table it can get its hands on, it actually broke the SQL queries that pull up the page content, so users just saw an error message instead of page content + malware.

    1. Re:We Got Hit By This by lgw · · Score: 1

      Somone please mod parent AC up - first useful information in this discussion!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:We Got Hit By This by Anonymous Coward · · Score: 0, Offtopic

      Don't be absurd, /. isn't about being informative. It's about dropping memes in at every available opportunity and making puns based on something unrelated. If you want information on the issue RTFA and comment there!

      Naturally your post has been modded up more than the top one just for amusement.

    3. Re:We Got Hit By This by MisterZimbu · · Score: 4, Informative

      Just as a followup to this, it's not actually a fault or exploit in MSSQL or IIS; just that the SQL being injected is specific to MSSQL and completely valid. This can and will happen in any future version of IIS or MSSQL unless specific action is taken by Microsoft to prevent the underlying technique used to do it, which is unlikely as it will break a large percentage of perfectly legitimate applications.

      The same attack could probably be modified to hit Oracle, MySQL, or other DBMSes with minimal effort. I don't even really know why IIS is even mentioned as the actual server software is irrelevant. This attack would just as easily hit MSSQL databases with website front ends hosted on Apache or pretty much anything else, no code changes needed. This isn't even the first time this has happened. A couple years pretty much the exact same script was used to deface sites on about the same scale as this one did.

      The blame should be placed on the developers of the poorly written 3rd party software that doesn't sanitize its inputs or (preferably) use parameterized queries and stored procedures.

    4. Re:We Got Hit By This by Arthur+Grumbine · · Score: 1

      Don't be absurd, /. isn't about being informative. It's about dropping memes in at every available opportunity and making puns based on something unrelated.

      Your injection of antagonism iis not contributing to everyone else's enjoyment of this site. What does this help us see? Quell humor and all you end up with is a dry, boring forum. Natalie Portman. :-P

      --
      Now that I think about it, I'm pretty sure everything I just said is completely wrong.
    5. Re:We Got Hit By This by gbrayut · · Score: 5, Informative

      Here is a great overview of the technique that was used:

      http://www.virusbtn.com/pdf/conference_slides/2009/Maciejak-Lovet-VB2009.pdf

      While they are targeting IIS and MSSQL the real issue is developers that don't sanitize the parameters that get sent to the database. The SQL is encoded in at least 2 different layers, so the only keywords that appear in the URL are ;dEcLaRe%20@s%20vArChAr(8000) and ;EXEC%20(@S); and It would be pretty difficult for Microsoft to block those without affecting legitimate usage. If you are using LINQ, Stored Procedures, or Parameterized Queries based on SqlCommand then this wouldn't work against your site or library. Mainly queries created as raw text strings have this vulnerability, and in this case it appears that some library or module used by a number of sites used raw SQL strings instead of the best practices recommended by Microsoft and every other SQL and web server vendor.

    6. Re:We Got Hit By This by butlerm · · Score: 4, Informative

      it's not actually a fault or exploit in MSSQL

      Actually, it is. Or rather MS SQL Server is much more susceptible to these kind of attacks (in combination with poorly written code) than virtually any other database.

      The reason why is because in SQL Server is perfectly legal to include more than one SQL statement at a time separated by semicolons. So if you have an incompetent programmer who doesn't bind variables or sanitize input properly, an attacker can trivially inject any SQL he wants.

      Other databases are vulnerable to SQL injection attacks to a degree. but in a much more limited fashion because an attacker *cannot* start an entirely new SQL statement in the middle of another one.

      Other databases (notably Oracle) that support multiple statement execution require you to wrap the whole thing in "begin"/"end" blocks so they are not vulnerable to the particularly severe form of this attack that SQL Server is vulnerable to. That is why if an SQL injection attack is in the news, it is inevitably an attack on a poorly written MS SQL application.

    7. Re:We Got Hit By This by lonecrow · · Score: 1

      Get real. This is a case of poor development practices poor and simply.

      I can think of a half dozen ways the developers could have prevented this from happening and they didn't do it because of lack of knowledge or laziness.

      If someone uses a wrench as a hammer and break it is it the fault or the wrench maker? I would say it was the fault of the worker who doesn't know how to use his tools.

    8. Re:We Got Hit By This by butlerm · · Score: 1

      Ever heard of defense in depth?

    9. Re:We Got Hit By This by Kalriath · · Score: 1

      Bullshit. I just opened MySQL console and did the exact same thing. How about you open it up sometime and enter the query

      "SHOW databases;SHOW tables;"

      Strangely enough, it executes both queries. Your post isn't informative, it's the same kind of FUD your kind lambasts Microsoft for.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    10. Re:We Got Hit By This by Kalriath · · Score: 1

      Other databases (notably Oracle) that support multiple statement execution require you to wrap the whole thing in "begin"/"end" blocks so they are not vulnerable to the particularly severe form of this attack that SQL Server is vulnerable to. That is why if an SQL injection attack is in the news, it is inevitably an attack on a poorly written MS SQL application.

      Neither MySQL nor PostgreSQL do.

      And in fact most SQL injection is reported on badly written PHP applications - presumably since noone could be bothered writing something as gigantic as this SQL injection code. Shitty code is shitty code in any language.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    11. Re:We Got Hit By This by butlerm · · Score: 1

      And in fact most SQL injection is reported on badly written PHP applications - presumably since noone could be bothered writing something as gigantic as this SQL injection code

      After an unseemly incident with some Joomla plugins, I try to avoid PHP applications as a matter of principle. That is not to say they can't be done well, but historically it seems to be more the exception than the rule.

    12. Re:We Got Hit By This by butlerm · · Score: 1

      The fact that a command line interface executes multiple queries in series with nothing but semicolons is not evidence that the database executes the same syntax with one prepare / bind / execute sequence. Big difference.

      I have nothing against MS SQL, I would like to see them (and the PostgreSQL people, and the Sybase people, and (partially) the MySQL people mitigate this problem. Due to the number of semi-competent developers out there, support for syntax like this at a low level is borderline unconscionable, especially because the fix is trivial. Just do what Oracle does - require block syntax to execute multiple statements.

      Every database that supports stored procedures already supports some form of block syntax, perhaps the developers should consider requiring people to use it. It is not that hard. A few characters at the beginning, a few at the end. That is all there is to it. Vulnerability to complete SQL statement injection eliminated.

  20. Copy and pasted story? by Anonymous Coward · · Score: 0

    I think I recall reading the *exact* same story in 1996 and 1998 or so. And... about once a year every other year too.

  21. Re:Poor programing practices, NOT IIS or SQL at fa by D+Ninja · · Score: 1

    A Stackoverflow answer explains the advantages very nicely.

  22. Re:Poor programing practices, NOT IIS or SQL at fa by slifox · · Score: 1

    Generating SQL statements in a script is fine...

    Here's a more accurate version: Anyone writing code that doesn't validate input needs to find a new line of work.

  23. Back to Basics by achbed · · Score: 3, Informative

    http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet

    How many times do we need to say the same thing before people start listening? Oh, that's why we still have STDs. Because people don't take basic steps to reduce risk by orders of magnitude.

    1. Re:Back to Basics by Anonymous Coward · · Score: 0

      To be fair, sex without a condom feels about a million times better than sanitizing input. That only leaves us a few orders of magnitude of pleasure over risk.

    2. Re:Back to Basics by burnin1965 · · Score: 1

      http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet

      How many times do we need to say the same thing before people start listening?

      Nice cheat sheet but I was a bit surprised to see "* Also Enforce: Least Privilege" listed under "Additional Defenses". Perhaps it is just my opinion but it seems least privilege should be very high on the list as has the potential to negate many application code and query instances where a developer may make a mistake or is simply lax in their methods.

      When I had a PHPBB website hit by an SQL Injection attack I not only stopped using PHPBB but I started an open source project with the idea of creating components to be used in the design of a database backed web application that could rely on the least privilege principle at the database engine rather than having absolute faith in the web application code itself to enforce security.

      It is not a perfect solution but it has the potential to stop many SQL injection attacks even in cases where the web application has some bad code.

  24. Today's crapptacular news media by Anonymous Coward · · Score: 0

    This is SQL injection, and they play it out as though it is a fault of IIS. If today's news media knew anything about security they would know its just poorly written websites that are at fault.

    They make out as though this is a vulnerability that will affect everyone running IIS - without some level of competence, the average reader would deduce that "CRAPPY MS SOFTWARE FUHFUHFUH!"

    Not a day goes by where a popular online news outlet gets the whole story ass-backwards. This is the second one today (the first was a "Zero-day" five-day vulnerability on computerworld).

    Seriously, when are we going to get people that actually know what they are talking about writing the news??? Or at the very least, slashdot mods, stop linking to the retards

    </rant>

  25. Re:in b4 by Lunix+Nutcase · · Score: 1

    Of which you then leave out:

    So it looks like a SQL injection attack against a third party ad management script.

  26. Re:Poor programing practices, NOT IIS or SQL at fa by Galestar · · Score: 4, Insightful

    Here's a more accurate version: Anyone writing code that doesn't sanitize input needs to find a new line of work.

    Fixed that for you

    --
    AccountKiller
  27. Re:WHY by GordonBX · · Score: 1

    Someone please mod parent clueless rather than insightful. Neither IIS nor SQL are at fault in this case, it is a third party add-on that is being exploited. There is nothing here that uniquely makes IIS or SQL more or less vulnerable than, say, Apache and MySQL. It is perfectly possible to code a LAMP application that is equally vulnerable, and recent attacks on applications such as Wordpress prove this is true. The article IMHO is being needlessly attacking towards IIS. It's like saying 'Mass SQL injection attack hits x86 servers' therefore somehow implying that servers running on Arm would be secure.

  28. It's Happened Before... by neorush · · Score: 1

    I was in my first week or so on the job with a firm about 2 years ago when this same thing happened. The IIS servers they ran were getting hit with a few thousand attempts / sec. There were a bunch of old coldfusion sites with SELECT * FROM table WHERE id=#url.id# floating around and many sites were compromised. Getting rid of the IIS header and the .cfm extension got rid of the bots attempts as we added filters to coldfusion. It was one of the worst weeks ever, I don't work there any more. There was even a slashdot post about the massive attack then to.

    --
    neorush
  29. Re:Poor programing practices, NOT IIS or SQL at fa by Anonymous Coward · · Score: 1, Informative

    IBM seems to think that "validate input" is an appropriate term for this
    http://www.ibm.com/developerworks/library/l-sp2.html

  30. Re:Poor programing practices, NOT IIS or SQL at fa by PolyDwarf · · Score: 2, Informative

    I think he was more asking about a parameterized-SP vs parameterized-TSQL, not a SP vs LINQ debate (which is what you linked)

  31. Anonymous Coward by Anonymous Coward · · Score: 0

    WSJ runs Apache, this article is probably bogus.

  32. Re:Poor programing practices, NOT IIS or SQL at fa by barzok · · Score: 1

    Or at least Prepared Statements (if your DBA is a PITA and won't let you go heavy on the Stored Procedures).

  33. Re:Poor programing practices, NOT IIS or SQL at fa by StuartHankins · · Score: 1

    Sp's provide a significantly higher degree of control over allowed values without having to resort to app-level scrubbing. They also tend to perform a little bit quicker.

    That said, things like multiple optional parameters will cause you to tear your hair out as a bad execution plan can be chosen. You have dynamic SQL inside sp's but there's no way I would use that on a public-facing site. Maybe 2008 solves some of this; I am anxious to try it out after skipping the mess that was 2005.

  34. Don't you mean... by the_one_wesp · · Score: 1

    Slashdot is about:

    1) dropping memes in at every available opportunity.
    2) making puns based on something unrelated
    3) ???
    4) PROFIT!!

    1. Re:Don't you mean... by msclrhd · · Score: 1

      Clippy meme?

      I see you are trying to do a SQL injection attack. Do you want to:
          1/ find out what a SQL injection is?
          2/ find out how to stop SQL injections?
          3/ let me show you how to do the SQL injection properly?

  35. holy shit. by unity100 · · Score: 1

    you dont know what you are talking about. there is no 'rogue' query here. the query that is passed in in a sql injection attack has NO difference from the queries that are put in by the script itself. ie, UPDATE users SET group = admin WHERE user_id = X. this is an example of a possible VALID query that passes in by the system when an admin decides to make someone admin.

    IF, you find a hole in the script, and are able to break the script code, and insert this query with your own userid and send it to sql, IT IS NOT SQL'S PROBLEM. sql is just doing what it is given to it, properly. it is the script's fault for allowing you to be able to break the script, and run a query that was limited to only admins.

    1. Re:holy shit. by Khyber · · Score: 0

      "You don't know what you are talking about."

      As someone that exploits these attacks for testing my business site DAILY, *YOU* don't know what you are talking about.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    2. Re:holy shit. by unity100 · · Score: 1

      yeah, blaming sql for executing a proper query it was given to, unauthorized. whose job was it to authorize the query again ? yes. the script's.

    3. Re:holy shit. by Anonymous Coward · · Score: 0
      this isn't about putting in your own userid in a query like "UPDATE users SET group = admin WHERE user_id = X"... this is about putting something like "5; DELETE FROM users" in as a userid.

      SQL is one giant string command, even though it is inherently dealing with variables that are also strings. most people that utilize SQL realize this and also utilize a variable parametrization layer on top of SQL... when user input is involved, the variable string should never coexist with the command string. that is the inherent flaw of SQL that was exploited.

    4. Re:holy shit. by unity100 · · Score: 1

      does NOT differ anything. DELETE FROM users is STILL a valid sql query. the guy allowed it for that particular sql user in the database so that its script would be able to do delete operations, his/her script failed authorization and passed a delete query that was unauthorized to sql. sql, seeing that that db user was allowed delete queries, performed the query. everything is LEGIT.

    5. Re:holy shit. by omni123 · · Score: 2, Insightful

      Perhaps someone should describe variable parametrization to you? A language that implemented it would take a variable in place of the 'userid' statement from the DELETE FROM users WHERE userid = userid; this variable would not allow any escape characters to be a part of it and therefore destroy injection possibilities.

      When was the last time C had injection (buffer overflows are another story!)? It doesn't. Because if you have void func(int arg) you can't call func(1; exit(1)). This is a fundamental flaw in SQL and technologies that use ORM (i.e. a variable parametrization layer on top) do not regularly deal with issues like this.

  36. Re:Poor programing practices, NOT IIS or SQL at fa by Alien1024 · · Score: 1

    Why? If my postcode is " ' ; DROP DATABASE master; " I should be perfectly able to enter it.

  37. Re:Poor programing practices, NOT IIS or SQL at fa by capnchicken · · Score: 1

    Way to open up a techno religious debate. You might as well have said what's wrong with using Linux over BSD or Vi over Emacs or vice versa.

    --
    A libertarian shat on my carpet once. Claimed the free market would sort it out. -Ford Prefect(8777)
  38. Re:Poor programing practices, NOT IIS or SQL at fa by Kjella · · Score: 1

    Here's a more accurate version: Anyone writing code that doesn't validate input needs to find a new line of work.

    How often does this happen in a one-developer situation (outside newbie projects)? The problem is that there's supposed to be exactly one sanitizing layer, for example if you percent encode or HTML encode or whatever twice, you often get a wrong result like "Barnes &amp; Noble" instead of what you expected. Every function validating everything is likely to be both a performance killer and the results being plain wrong. On the drawing board it's easy, draw a big line and say dirty strings on this side, clean strings on the other and a sanitizing layer in the middle. But in practice nobody notices if you don't, a string is a string is a string because someone forgot or took a shortcut, in many cases being completely oblivious to the problem. In an application with heavy user interaction, I'd almost be tempted to have a dirty string and clean string subclass. But I figure someone will just cast it to a clean string to make it work anyway.

    --
    Live today, because you never know what tomorrow brings
  39. Defiantone64 by DefiantOne64 · · Score: 0, Troll

    why is anybody running IIS anyway... Is this not another outdated technology from mickey$oft.

  40. Re:WHY by Anonymous Coward · · Score: 0

    Called it,
    http://news.slashdot.org/comments.pl?sid=1683322&cid=32538476

    enjoy being a freetard.

  41. No 3rd party script by cjjjer · · Score: 1

    What this attack is doing is hitting sites that may utilize Google's' email campaign tracking features. They are probably taking advantage of sloppy developers who are storing the parameter values from the campaign locally for their own analytics, probably by building dynamic SQL. Now there could be some form of Open Source HttpModule code out there that actually does this auto-magically, which might account for why it's such a specific attack vector. So in reality it could affect MS SQL Server or MySQL, it's just so far they are just calling pages that have aspx on the end.

  42. getting tired of this by ILuvRamen · · Score: 0

    I'm getting REALLY sick of website mass hacks. I've removed different versions of that stupid fake antivirus crap and the last couple I've seen seem to have had the TDSS rootkit piggybacked on it too. Now that they're using java and reader as entry points, I can't just tell people to use firefox. I can't tell them use ____ antivirus because it still stop it because nothing will right now. At this rate, I'm going to have to tell people to just not randomly surf the web period. They either need to disconnect certain countries from the internet entirely or get their shit together and stop leaving gaping holes in software that millions of people run.

    --
    Google's Super Secret Search Algorithm: SELECT @search_results FROM internet WHERE @search_results = 'good'
  43. It has nothing to do whit IIS or ASP by hviniciusg · · Score: 1

    "The SQL injection attacks that allow the systems to be compromised are occurring due to vulnerabilities in third-party web applications and do not demonstrate vulnerabilities in Microsoft software," Bryant told McMillan.

    1. Re:It has nothing to do whit IIS or ASP by hviniciusg · · Score: 1

      Microsoft's Jerry Bryant told Bob McMillan :D

  44. Headline just totally wrong by MobyDisk · · Score: 1

    SQL injections don't target SQL servers or web servers. They target poorly written scripts. This does not "target Web servers running Microsoft's IIS software" as the summary says. It targets some stupid advertising script that all the sites had in common. Look at the analysis of the attack. It does s GET on /page.aspx and passes it utm_content which contains an escaped SQL statement.

    A quick Google search shows that utm_content is part of Google Analytics. Does this mean it is a bug in Google Analytics?

    1. Re:Headline just totally wrong by butlerm · · Score: 1

      SQL injections don't target SQL servers or web servers.

      This particularly severe type of attack only affects poorly written MS SQL and Sybase applications, due to the way those two database allow SQL statements to be combined.

      Other databases are vulnerable in combination with poorly written applications too, just not nearly as badly.

    2. Re:Headline just totally wrong by Kalriath · · Score: 1

      Really? I didn't realise that MySQL and PostgreSQL weren't databases!

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    3. Re:Headline just totally wrong by butlerm · · Score: 1

      MySQL has this as a (non-default) option. PostgreSQL (you are correct) is vulnerable in a way that cannot be turned off.

      After the spate of MS SQL incidents using semicolons, all these database server developers really ought to look up the meaning of "defense in depth". Just require block syntax like Oracle, and the particularly severe "command line equivalent" form of this vulnerability goes away.

      The problem is too many organizations have large code bases with some number of lazy / not quite competent programmers and insufficient review practices. No reason to make such vulnerabilities much worse than they already are.

  45. Could be worse I suppose... by internetdarwin · · Score: 1

    Wow, Imagine if the payload included a .js file exploited this as well: http://tech.slashdot.org/story/10/06/11/0143255/Google-Researcher-Issues-How-To-On-Attacking-XP Talk about a worst-case scenario, that could potentially 0wn a LOT of xp machines really fast.

  46. So malware authors DO target lesser used systems.. by Graham+J+-+XVI · · Score: 1

    Remember this next time you assert that Windows only has more malware than linux/osx due to its popularity.

  47. Urchin? Google Analytics? by Anonymous Coward · · Score: 0

    From the "analysis", it appears to be a request parameter injection at the end of an Urchin parameter (utm_content). From my reading it appears that it is either an older version of Urchin or they manually set the database as SQL server. Can anyone who was hit by this verify they are running Urchin 6 or manually pointed it to SQL Server?

    1. Re:Urchin? Google Analytics? by Kalriath · · Score: 1

      Urchin doesn't support SQL server. I run Urchin and it works with either Postgre or MySQL from what I see.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  48. AGAIN! AGAIN! by Ashcrow · · Score: 2, Informative
  49. Re:I suspect....Commander Taco by Anonymous Coward · · Score: 0

    From a security standpoint, PHP developers are the worst of the web app world. By far.

    The problem is doing web security diagnosis on /. and the fact that it was written by someone stoned on PHP in the first place.

  50. No fucking wonder by Anonymous Coward · · Score: 0

    If most people on Slashdot can't even tell how a fucking SQL injection works, no fucking wonder there are so many vulnerable websites.

    I mean, what the Christ, people?

    You have a webserver. Any webserver.
    The webserver hosts a script. Any script.
    The script takes input. Any input.
    The script passes the input to a database. Any database.

    SQL INJECTION.

    The right way to do it, is this:

    You have a webserver. Any webserver.
    The webserver hosts a script. Any script.
    The script takes input. Any input.
    THE INPUT IS CLEANED UP BY THE SCRIPT.
    The script passes the CLEANED UP input to a database. Any database.

    Has nothing to do with IIS. Has nothing to do with ASP. Has nothing to do with .NET. Has nothing to do with MSSQL. Has nothing to do with Microsoft.

    Stupid fucking morons. Pull that stick out of your ass and move along now.

  51. Re:Poor programing practices, NOT IIS or SQL at fa by blhack · · Score: 1

    How can you even possibly *not* sanitize the inputs? Python's mysql module, for instance, does the work for you:

    cursor.execute("select grade from grades where student = %s", ("bobby; drop table grages"))

    would be completely fine.

    --
    NewslilySocial News. No lolcats allowed.
  52. Re:Poor programing practices, NOT IIS or SQL at fa by Anonymous Coward · · Score: 0

    Validation also protects you from your own stupidity.

  53. How exactly? by SmallFurryCreature · · Score: 1

    As far as I know using Google Analytics is nothing more then including a strong on your html output that instructs the browser to get some javascript from google to record the traffic. The server itself never executes anything from google, it would be the same as if you included the google logo on your pages. Your server ain't involved.

    For a 3rd party script to have an effect it somehow needs to be run or the server or have at a minimal its values parsed. Google Analytics (at least for small customers, don't know about big ones) is not installed on the server. I could not call their script on any of my servers despite all my sites use it because it is not there. Not only is there no connection to my database, there is no script. You can't call any URL on my site that even handles "utm_content". Unhandled variables just get ignored. Try it with slashdot. Add "&slashdotters=weenies" to the url and nothing whatsoever will happen.

    What is most likely is that this is some ADVERTISING script (GA isn't used for advertising but tracking for the site owner) that is used and that has its own installation including database access for some reason or at least can be made to access the database. Websites ain't magic. I can't just replace "op=reply" in the slashdot url with an SQL command and expect a result. It must be a variable that is used in a query. GRANTED, it could be the case where every query is logged into a database straight without sanitation (did you remember to think of this oh you mighty logger of all data?) but that is silly (and very common).

    A bug in Google Analytics would affect Google but not endusers.

    A bug in an other script that you have to install COULD affect you. Doubleclick (owned by Google) might work that way.

    Remember, javascript rarely runs on the server and therefor can't affect the server.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:How exactly? by MobyDisk · · Score: 1

      Websites ain't magic. I can't just replace "op=reply" in the slashdot url with an SQL command and expect a result. It must be a variable that is used in a query.

      That's exactly my point. The summary says that this effects IIS and SQL server. That is wrong. It affects whatever script it was intended to target.

  54. Not IIS (directly) ... could it happen to anybody? by erroneus · · Score: 1, Insightful

    Well yes... yes it could. I read the article completely. It is caused by a weakness in some ad placement code... ad placement code that runs on IIS through ASP or something like that. It sounds as if this could just as easily happen to a LAMP server if the same shoddy code were inserted into a Linux/Apache/MySQL/PHP stack. But why hasn't it happened?

    The article doesn't go into what ad company put the code out there or if that company also supports LAMP servers. I think those bits would be good to know. But as many others, I am inclined to blame Microsoft for this somehow.

    Let's face the fact, though, that Microsoft didn't have a direct hand in this. SQL did what it was told to do. IIS did what it was told to do. The script did what it does... and without specific details, I have no way to know if the scripting language itself was compromised or of it is the script itself that enabled this. But I can say that Microsoft has developed a culture that enables all of this.

    What do I mean by that? "Visual X programming" and other RAD tools are designed to get code written and published as quickly as possible. What is the problem with that? I gotta say, if code is to be generated quickly, it will likely receive less QA review... if any at all. So if that programming language doesn't come with seat belts and air bags, then it is just begging to be exploited in this way.

    PHP and many other languages that are typically used in LAMP stacks are edited with a text editor most of the time. Fancy IDEs exist but many people prefer the text editor. It's fast and simple. Hard to beat fast and simple... and programming with clippy at your side is nothing that any coder I know would be interested in.

    Microsoft breeds a culture of sloppy coding practices. This is a large part of the problem and it started with DOS when people started writing directly to the display because using BIOS hooks were too slow. But then it got worse when advanced processors emerged... you know, those i386 processors? They were DESIGNED to make virtual machines. What happened? You know what happened. We could have been using some awesome virtualization technologies decades before now and a lot easier than now. Once again, programmers who don't follow the rules and don't use good practices and procedures strike again. Third parties who have felt the need to insert "virtual device drivers" in order to access more system resources or some such thing, bypassing the OS for whatever reason. They bring instability to Microsoft Windows without question. But who bred the culture in the first place? Who added "compatibility with bad applications" support into their operating systems? That'd be "Developers! Developers! Developers!" Microsoft. They don't care of the developers are good developers. Only that there are a lot of them.

  55. Re:Poor programing practices, NOT IIS or SQL at fa by ranton · · Score: 1

    Here's a more accurate version: Anyone writing code that doesn't validate input needs to find a new line of work.

    How often does this happen in a one-developer situation (outside newbie projects)?

    I have worked on multiple e-commerce sites written by other original authors, and developers allowing unvalidated text into SQL queries is more common than I would like to admit. Plenty of small companies pay inexperienced web developer peanuts to put up their websites, and they sure get what they pay for.

    I would agree that it doesnt happen often outside of inexperienced web developers, but far too many sites are written by them for it to be discounted as a rare phenomenon.

    --
    -- All that is necessary for the triumph of evil is that good men do nothing. -- Edmund Burke
  56. Didn't they get errors when testing? by Anonymous Coward · · Score: 0

    A very simple script I wrote many years ago in PHP and served me well:

    function dbValidString($dbString, $dbTransaction = "Store") {
     
        if ($dbTransaction == "Store") {
            $dbString = str_replace(array('\'','`','"','<','>','\\'), array('&#39;','&acute;','&quot;','&lt;','&gt;','&#92;'), $dbString);
        } else {
            $dbString = str_replace(array('&#39;','&acute;','&quot;','&lt;','&gt;','&#92;'), array('\'','`','"','<','>','\\'), $dbString);
        }
     
        return $dbString;
     
    }

    Just force-feed values through it (it was written long before OO PHP) before they go to a db and you're fine. I wasn't even thinking of SQL injection, I just didn't want userspace values to cause errors.

  57. list of vulnerable apps? by humankind · · Score: 1

    So my impression is that the script isn't targeting specific apps but ASP-based servers and trying to do generic SQL-injection?

    The question is, can people identify which apps have been exploited by the attack vector?

  58. Hm... by Georgh · · Score: 1

    Here too there is good article about hacking: http://www.cybernova.ru/publ/83-1-0-16

  59. Re:in b4 by Anonymous Coward · · Score: 0

    http://nsmjunkie.blogspot.com/2010/06/anatomy-of-latest-mass-iisasp-infection.html
    Seems Like it's not third party scripts after all

  60. Re:Poor programing practices, NOT IIS or SQL at fa by Anonymous Coward · · Score: 0

    PHP makes it really easy to sanitize inputs because it has a feature called magic quotes that makes it impossible to put bad data in to the database. If they just used that, they'd be...

    Oh hang on, my boss is asking me why our Web 2.0 cloud computering click-and-mortar e-commerce web site is serving some "goat see" thing. brb.

  61. Use a Web application firewall by yorktown · · Score: 1

    Another way to prevent SQL injection attacks is to use a Web application firewall. The advantage to using an application firewall is that it solves the problem without having to verify every one of the (possibly many) scripts running on the server.

  62. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    Parameterized queries provide the exact same level of control without any app-level scrubbing. Performance is almost always nearly identical.

    Dynamic SQL inside sp's defeats the entire point of sp's. The only difference is that you have to do data sanitization with T-SQL instead of a language that has evolved since the 1980s.

  63. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    I just found out the guy who works in the office next to me has never heard of the practice of parameterizing database statements to avoid SQL injection. He has about five years of development experience at several major US companies. This was the first project that I worked with him on that he wrote data access code. Apparently a lot of people still don't get the point. I recommended that he be "quarantined and trained" to my boss, but I'm sure he'll go right on writing code.

    95% or the people I talk to think that as long as they use stored procedures, they'll be fine, even if they don't parameterize the call. It takes all the breath I have to convice these people that it's the parameterization that matters, not the use of stored procedures. Even after demonstrations, sometimes they still don't believe me.

  64. Re:Not IIS (directly) ... could it happen to anybo by QuietObserver · · Score: 1

    I don't see how anyone could think this is flamebait. My personal analysis of your comments indicates you are making a well reasoned argument about the culture Microsoft has created, which may have been the cause of this difficulty, and that is valid, and not intended to draw flames (though it would clearly do so from some readers). If I had points, I'd counter the disparagement, but I figure this is an adequate response.

    I've learned to write code with the assumption that my bugs would not get caught by the programming language, so I'd better make sure I catch them, or at least know what they are so I can publish them (in the event I cannot be bothered to write code to catch the bug, as in my FP128 converter for the C=64). I've also never understood the logic behind structuring program memory with the heap, code, stack model; that puts the code above the heap, which grows from the bottom, and below the stack, which grows from the top, thus making buffer overflows easy. I'd rather build an application so the stack is below the program and the heap is above. I also never consider myself finished with anything I haven't thoroughly tested and found all the reasonable bugs in (I don't release code because I'm not a programmer, I just dabble from time to time).

    Anyway, I commend you for having the courage to make such a comment, even in an environment that is becoming increasingly hostile toward those who speak the truth.

  65. Re:Not IIS (directly) ... could it happen to anybo by erroneus · · Score: 1

    Thanks for that. But it seems my rant was pointless and irrelevant. Turns out this is, in fact, just another MS SQL injection exploit after all.

    http://nsmjunkie.blogspot.com/2010/06/anatomy-of-latest-mass-iisasp-infection.html

    The analysis is very good and even I could follow it -- and believe me, I'm not all that good at following things like that. And discussion also spells out why this wouldn't likely happen in a LAMP scenario -- no multiple query commands by default. It would seem to me that Microsoft could put out a patch that does the same thing, but they would break the code of nearly every site using their technology in the process. Once again, they created the culture that created the mess and now they are in no position to set the cultural problem straight.

    And as humorously pointed out here:

    http://xkcd.com/327/

    The idea of cleansing and verifying input before sending it out into a database would seem like a simple and fundamental thing to do. Where I grew up, input was always validated. I used to write input functions that were designed to input only that which the program expected. For example, numbers... only numeric characters were allowed... words... only text allowed... phone numbers, only specific lengths and formats were framed. To me, it was both normal and a hallmark of a really good, slick and solid program. Seems to me, that particular fundamental was forgotten and brushed aside as "old fashioned" and yet here we are with unvalidated input being used to corrupt other data and such. Is it HARD to write a routine to cleanse data? No. Pretty simple in my view -- no complex math, usually a simple loop structure at most, a table lookup or some sort of prohibited characters scanning. "Oh, but it would just slow the program down!" So?! What's worse? Slow or INFECTED?

    Okay, so maybe my rant wasn't so irrelevant after all. It's still about sloppy programming and the culture created by Microsoft.

    I still can't get over how lessons in data validation have escaped people who write code for a profession?! To me a professional is supposed to be an expert in the field who has a firm grasp in fundamental concepts. Didn't everyone's second program after "hello world" go like this?

    What's your name? *CurseWord*
    Hello, *CurseWord*! How are you today?

    To me, that was the key lesson in input validation. Why? As you can see, I can submit a curse word instead of my name in there and have the program return a curse word instead of proper input. How embarrassing that I could write code to enable this type of behavior?! Lesson learned! I guess the people with SQL injection troubles haven't learned that basic lesson now have they?

  66. Re:Poor programing practices, NOT IIS or SQL at fa by tsm_sf · · Score: 1

    If your coworker thinks he's writing secure code, you have a problem.

    If you think you're writing secure code, you have two problems.

    --
    Literalism isn't a form of humor, it's you being irritating.
  67. Re:Poor programing practices, NOT IIS or SQL at fa by porkThreeWays · · Score: 1

    I was able to generate some errors by putting carefully crafted data into a website form once. I notified the company that made the software and their two programmers were such arrogant jackasses. "Oh well they are stored procedures so it's not a problem." I was so annoyed at their arrogance I got permission to attempt to crack the website and basically got full access to the box and all the data and a lot of data on their network through windows file sharing (sql server had some stored procedures to execute files if I remember correct, this was like 3 years ago) in about 20 minutes. Oh yeah, this software stored all of my company's employee medical records and as it was hosted stored all their other clients medical records as well.

    The moral is that security is a very complex beast. They kept asking what product they could buy to fix this and I just laughed. They bought some McAfee product in the end that only masked the problem. Input needs to be completely sanitized and relying on tricks like stored procedures for security is a band aid. McAfee products don't protect against security holes due to logic mistakes.

    --
    If an officer ever threatens to taze you, say you have a pacemaker.
  68. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    You too need a demonstration. BTW, I don't need stored procedures to handle permissions because all of my applications are three tier and frond end users can't even log in to the database server.

  69. Re:Poor programing practices, NOT IIS or SQL at fa by revlayle · · Score: 1

    I really think the only advantage of a parameterized sproc would be less network traffic to send the query, and the query plan is already determined and cached on the server, no guarantee that would happen with a parameterized T-SQL. However, both are probably pretty safe to use as long as the T-SQL is a constant-like string and never dynamic.

  70. excuse me but are you stupid ? by unity100 · · Score: 1

    what you are saying is about the scripting LANGUAGE. NOT sql.

    1. Re:excuse me but are you stupid ? by omni123 · · Score: 1

      Did you miss what the SQL acronym is? Look it up and get back to me.

    2. Re:excuse me but are you stupid ? by unity100 · · Score: 1

      oh geee. why dont we make up for the potential security leaks and issues of the server that sql runs on, by sql, then ? its only logical.

    3. Re:excuse me but are you stupid ? by omni123 · · Score: 1

      Uh, that's what everyone has been telling you and you have been giving incredibly rude and childish responses to.

      If the language itself (i.e. SQL) was to enforce variable parametrization this would not be the problem that it is today. Has this entire thing from your side been a misunderstanding on what SQL actually stands for?

      Jesus.

    4. Re:excuse me but are you stupid ? by unity100 · · Score: 1

      jesus yourself idiot. im asking you, with that moronic logic, why dont we hold the database query language, the database responsible for making up for the deficits of the software of the SERVER that it is running on, ie, solaris, linux, iis. after all, if its up to DATABASE QUERY LANGUAGE to make up for scripting, application language's deficiency, why making up for the SERVER SYSTEM software's deficiencies shouldnt be its responsibility too ?

    5. Re:excuse me but are you stupid ? by uninformedLuddite · · Score: 1

      Can't we all get with the times and use MS-Access

      --
      The new right fascists are bilingual. They speak English and Bullshit.
  71. Re:Poor programing practices, NOT IIS or SQL at fa by Anonymous Coward · · Score: 0

    No, it's not. Seriously. Of course you should validate and sanitize input, but constructing queries as strings with user-supplied values is bad. You're not perfect (nobody is), and WILL get it wrong.

    Of course we know that arrogance and hubris are two of the three virtues any programmer must possess (the last being laziness, which also seems like a good reason to not use parametrized queries), but seriously, if you have a tool to protect you against certain classes of failures, use it.

    It's just like saying "oh, I'll be careful, I don't need to wear gloves while handling this acid". Sure, you WILL be careful. Yes, most of the time nothing will happen. In fact, it may well be that nothing will happen to you at all, ever. But wearing gloves is still a good idea, and you should make it a habit to always put them on.

    The same goes for parametrized queries. No matter how much you believe that YOU are perfect and that YOU will always get it right (unlike everyone else who came before you) - they're a tool that provides extra security pretty much for free, so you'd be braindead to not use it.

  72. IIS is the most secure Server by devent · · Score: 1

    Mod me down I don't care. So it's the 1454355436 time that the IIS server is hacked, while all the other servers are save and sound. Is it because the IIS server is the most used one? Last time I checked Apache is running 70% of all web servers.

    Maybe next time you should not listen to the MS drones and the "get the facts" FUD sites and set up a nice Apache+Linux or *BSD web server. There are not only cheaper, easier so maintain, and they will not be hacked every week.

    --
    http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    1. Re:IIS is the most secure Server by Anonymous Coward · · Score: 0

      For the 1454355436th time, no IIS server was hacked at all. A third party script allowed an SQL injection. Maybe you should "get the facts" from TFA first.

    2. Re:IIS is the most secure Server by toadlife · · Score: 1

      Morons like you give open source a bad name.

      --
      I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    3. Re:IIS is the most secure Server by godefroi · · Score: 1

      Yeah. Seriously, people. When will you all learn?

      I mean, noone ever got fired for buying IBM, and noone ever wrote insecure software on open source platforms. Like PHP.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
  73. Re:Poor programing practices, NOT IIS or SQL at fa by buchner.johannes · · Score: 1

    How can you even possibly *not* sanitize the inputs? Python's mysql module, for instance, does the work for you:

    cursor.execute("select grade from grades where student = " + "bobby; drop table grades")

    This is how.

    Also, you have a bug in your SQL injection.

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
  74. Re:Poor programing practices, NOT IIS or SQL at fa by ComaVN · · Score: 1

    It was a completely honest question. I can see there might be a (small) performance gain by using SPs, but in terms of security (which was the subject under discussion) they're identical IMO.

    --
    Be wary of any facts that confirm your opinion.
  75. Re:Poor programing practices, NOT IIS or SQL at fa by StuartHankins · · Score: 1

    Dynamic SQL inside sp's defeats the entire point of sp's.

    I disagree. In MS SQL Server 2000 there are many times when Dynamic SQL is the least bad method to do something. The benefits include storing logic in the DB instead of in various apps where it can't be tracked for schema changes. Forcing a procedure NOT to use a stored execution plan -- which can hobble queries with any decent amount of data.

    The only difference is that you have to do data sanitization with T-SQL instead of a language that has evolved since the 1980s.

    I hope you're not trying to tell me your DBA trusts your app writers to sanitize everything? The final level for security and scrubbing IS the DB, and skipping over that to run some code NOT designed to best work in a DB environment is silly. I have no idea what language you're suggesting, but again in your scenario the DBA loses control over what really happens. You as a programmer need a recompile or recode to fix a simple business logic change, and heaven help you if it's overly complicated.

    Step back and let the DBA's do their job. That means egress / ingress over all apps which want to use the DB. Concentrate on programming-level tasks such as maintaining your UI and using the retrieved data efficiently. There is no way you will create more efficient DB code than a competent DBA, and you should not have to worry about the hinting / indexes / partitioned views etc that DBA's consider when making sure your stuff runs well.

    What you could do is create a log of all requests, with the parameters used, for chunks of your application and use that to both establish a baseline for performance as well as an indicator of lagging performance. This benefits both you and the DBA and I'm sure they would help you accomplish this task.

  76. Re:Not IIS (directly) ... could it happen to anybo by Bungie · · Score: 1

    It sounds as if this could just as easily happen to a LAMP server if the same shoddy code were inserted into a Linux/Apache/MySQL/PHP stack. But why hasn't it happened?

    What are you talking about? SQL injection happens on LAMP stacks all the time. PHP programmers are just as bad at sanitizing input as ASP programmers. This specific exploit uses ASP.NET which is why it doesn't directly affect LAMP.

    ... and without specific details, I have no way to know if the scripting language itself was compromised or of it is the script itself that enabled this.

    There are specific details. I've never even heard of an entire scripting language being compromized. Obviously an SQL injection would occur because of a script not sanitizing inputs properly.

    What do I mean by that? "Visual X programming" and other RAD tools are designed to get code written and published as quickly as possible. What is the problem with that? I gotta say, if code is to be generated quickly, it will likely receive less QA review... if any at all.

    Code generation and QA review have no relation. Just because I can generate code fast doesn't mean people won't take the same amount of time checking it for problems.

    PHP and many other languages that are typically used in LAMP stacks are edited with a text editor most of the time. Fancy IDEs exist but many people prefer the text editor. It's fast and simple. Hard to beat fast and simple... and programming with clippy at your side is nothing that any coder I know would be interested in.

    Any real programmer would understand the advantages of an IDE over a text editor. It's much faster and simpler when the IDE can autocomplete things for you or display their syntax details inline. It also increases code accuracy and organization. Clippy hasn't been around since Office 2000 and was never in Visual Studio so you'll be ok.

    But then it got worse when advanced processors emerged... you know, those i386 processors? They were DESIGNED to make virtual machines. What happened? You know what happened. We could have been using some awesome virtualization technologies decades before now and a lot easier than now.

    i386 had nothing to do with making virtual machines at all except for Virtual 8086 mode which only virtualizes 16-bit real mode processes in 32-bit protected mode. Virtualizing the 32-bit end of the i386 is a whole different thing altogether. Virtual Device Drivers were made to help transition from MS-DOS to 32-bit Windows and were a terrible idea which never helped virtualization at all.

    --
    The clash of honour calls, to stand when others fall.
  77. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    Step back and let the DBA's do their job. That means egress / ingress over all apps which want to use the DB.

    Unfortunately, that means that a significant portion of the business logic will end up in the database. Since the middle tier is now embedded in the database, it is impossible to ever create a three tier application.

    I have 15 years experience with Microsoft SQL Server, and I have trained half of the DBAs in my geographic area (seriously, I have). Please don't talk to me like only a DBA could ever build a data access layer that works. It is perfectly valid to build a data access layer that happens to live one step physically removed from the database. It is still distinct from the application, so there is no risk of a lack of abstraction, only it exists somewhere other than in stored procedures. T-SQL is an old language. There are at least twenty languages that can do many tasks better than T-SQL. I can do just about anything in my data access layer, and much of it is impossible with stored procedures. As an example... if I had a system that stored sensitive pictures in a database as BLOBs, and my requirement changed so that all returned pictures should be watermarked so we could track any information leaks. I could simply go into my C# data access layer and add a handful of lines of code that would dynamically watermark the image as it is being retreived from the database. A data access layer written in T-SQL could never do this. T-SQL is a weak language.

    Forcing stored procedures has costs. Modern technologies like LINQ to SQL don't work. Old curmudgeonly people known as DBAs constantly force you to restate all of your requirements and then say no to half of them because they don't have the talent to pull it off. Applications break after a change because it is assumed that the DBA knows who is calling a stored procedure, but that is a pure fallicy that can only be handled by manual documentation - the sort of documentation that us application developers are also good at (my development tool can do a dependency analysis with the click of a button).

    Our old stored procedure based development architecture is fragile and breaks all the time on changes because it is so complicated to figure out what is being accessed. Our new non-stored procedure based architecture has been rock solid for five years and many updates. I'm not saying that stored procedures caused the problems in the old architecture, but I am saying that stored procedures were not sufficient to prevent data layer fragility. You are using the worst possible argument for stored procedures, "DBAs are smart and developers are stupid".

    There is no way you will create more efficient DB code than a competent DBA, and you should not have to worry about the hinting / indexes / partitioned views etc that DBA's consider when making sure your stuff runs well.

    The two cannot work in isolation. How would you create a covering index if a developer demanded all columns of a table be returned, but he didn't really need them? How do you performance tune an application that requests the details for 10,000 customers by calling the customer profile retreival procedure 10 thousand times? Unless everybody participates, it won't work well.

    I hope you're not trying to tell me your DBA trusts your app writers to sanitize everything?

    They better. Procedure calls are just as vulnerable to SQL injection as ad-hoc SQL. The only person is a position to stop SQL injection is the application developer. The damage has been done before the DBA's code is even called.

    ... the DBA loses control ...

    That is your real fear. You simply want to be involved in every project to jusify your existence and refuse to admit that there is any other way to write applications, because those other ways reduce your value to the organization. I understa

  78. Re:Not IIS (directly) ... could it happen to anybo by erroneus · · Score: 1

    Seems you missed my follow-up retraction post... http://slashdot.org/comments.pl?sid=1683322&cid=32544976

  79. Re:in b4 by Kalriath · · Score: 1

    Yes it's fucking third party scripts. That's what the blog post you reference says. It's a mass SQL injection (something possible with any RDBMS and programming language when put in the hands of a crappy enough developer), nothing to do with IIS, ASP.NET, or MSSQL server. It's the crappy applications built on it that are the problem (and they must be some pretty crappy applications, ASP.NET makes it fucking easy to use parameters to stored procedures. There's no excuse for the use of dynamic queries).

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  80. Re:Poor programing practices, NOT IIS or SQL at fa by Kalriath · · Score: 1

    Unless "bobby" is another column, so do you.

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  81. Re:Not IIS (directly) ... could it happen to anybo by Kalriath · · Score: 1

    And discussion also spells out why this wouldn't likely happen in a LAMP scenario -- no multiple query commands by default.

    This statement is not entirely true. If you see MySQL and PostgreSQL documentation you'll see that both support the same sort of technique. Different frameworks may try mitigate (some versions of PHP may take a dim view to multiple statements in a single query for MySQL as an example, but the PHP docs for Postgre say that PgSQL will in fact run every statement you include in your query).

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  82. Re:Not IIS (directly) ... could it happen to anybo by Kalriath · · Score: 1

    Your retraction post is incorrect.

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  83. Re:Not IIS (directly) ... could it happen to anybo by erroneus · · Score: 1

    Available but disabled by default from what I hear. Enabled by default in MS SQL.

  84. Re:So malware authors DO target lesser used system by toadlife · · Score: 1

    I'll be sure and remember it. I'll also keep in mind that drawing a conclusion regarding complex topics based on one data point is not a good way to find the truth of the matter.

    --
    I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
  85. Re:Not IIS (directly) ... could it happen to anybo by Kalriath · · Score: 1

    No, it is most assuredly not disabled by default, or even a setting you can disable. As mentioned though, I think many versions of the PHP MySQL extension prevent it themselves - but MySQL certainly isn't responsible for that.

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  86. Re:Not IIS (directly) ... could it happen to anybo by Kalriath · · Score: 1

    Sorry erroneous, it appears that it is an option for MySQL client libraries. Not server side, and some MySQL client libraries don't implement the "default block multi-statements" behaviour.

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  87. Re:Poor programing practices, NOT IIS or SQL at fa by StuartHankins · · Score: 1
    15 years of experience with SQL Server is similar to me, excluding my experience with other enterprise DB's (Oracle and Informix mostly but also some DB/2). I began using SQL Server with 6.5 and at one point had DBA responsibilities for 6.5, 7 and 2000 concurrently.

    Since the middle tier is now embedded in the database, it is impossible to ever create a three tier application.

    Not only is it possible, but by placing the logic in the sp's it is immediately searchable for the DBA. Migrating data is made considerably simpler also. You can still use your middle tier language / platform of choice, but the end result is more structured.

    I could simply go into my C# data access layer and add a handful of lines of code that would dynamically watermark the image as it is being retreived [sic] from the database. A data access layer written in T-SQL could never do this.

    Well, first of all you're storing BLOB's in the DB, which is inefficient both in backup strategy as well as in retrieval and long-term archival. Filesystems are good at what filesystems do, so let them do it. You're going to be pointing to an index of an index and the end result will be like accessing data on a very fragmented hard drive. And conversely your DBA has no idea that you're doing this, he/she only knows that I/O is poor and cache misses are high. (Even with FILESTREAM in 2008 this is still true, store them outside the DB!)

    How would you create a covering index if a developer demanded all columns of a table be returned, but he didn't really need them? How do you performance tune an application that requests the details for 10,000 customers by calling the customer profile retreival procedure 10 thousand times?

    The way I do part of this is take snapshots of something similar to sp_help2 results every x minutes to a DB, and the top scoring queries past a certain level get reviewed. If I see something out of the ordinary, such as seeing a drop in performance (or the help desk reporting an issue), I walk down the hall or call the developer into my office and we take care of the issue. It's a learning experience for the developer. If it's severe enough I disconnect the query and/or service making the requests. We can't have a coder's shortcuts taking down servers or making them available. This only has to happen a couple of times before the programmer learns to speak with me / work with me prior to implementing something they suspect might be bad. If it keeps happening, the developer is let go.

    How would you create a covering index if a developer demanded all columns of a table be returned, but he didn't really need them?

    During my interview process, we discuss that we're a small crew and everyone is expected to do their best. I always have time for questions and would rather handle things before they are implemented and cause issues. Nevertheless I have had a couple of developers who had to be let go because of things like this. Really, I don't have time to babysit. You're either at a professional level or you're not.

    The only person is a position to stop SQL injection is the application developer. The damage has been done before the DBA's code is even called.

    What? I'm not talking about someone substituting a value in a query with another (legal) value. I'm talking about people trying to insert clauses etc. Random ad-hoc SQL is heavily discouraged; practically everything goes through SP's. Not only does that allow me to migrate data as needed without breaking things, but it also allows me to add logging / troubleshooting code to the sp when there's a problem. It has reaped many rewards for my employers over the years.

    I understand that you will never back any development model that will eliminate your job...

    First of all, you've got some balls, which I admire, but you're too stupid to know when to shut up and you've needlessly

  88. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    First of all, you've got some balls, which I admire, but you're too stupid to know when to shut up and you've needlessly crossed the line with me with this comment.

    That was made with as assumption that you were like the previous ten thousand DBAs I've had this discussion with. Sorry if it was improperly directed at you, but it does apply to a lot of the readers of slashdot.

    Back to my point. I've never claimed that going the "all data access goes through stored procedures" philosophy won't work. Your experience shows that it does. My claim is that it isn't the only way to skin this cat. Not using stored procedures has, for me, produced a more maintainable result. Everything you claim you get as a benefit from stored procedures, I also have in my data access layer. If two thing exhibit the same property, then that property is not unique to either of those things. Therefore, none of your positive experiences are reasons to choose stored procedures, unless those experiences aren't universal across all common solutions. For example, if you claimed that you must drive a Corvette to go 0-60 in under 5 seconds, you'd be wrong. All the evidence that a Corvette goes 0-60 in under 5 seconds wouldn't make you right. One shred of evidience that there is another way to go 0-60 in under 5 seconds proves the original statement false. I have evidence that all of those benefits that are enjoyed by stored procedure fans are also enjoyed by those employing a distinct non-SP data access layer.

    Our discussion really boils down to two sides; your side claims that stored procedures are the only way to do it right, my side claims that there are many ways to do it right. I can't see how anyone could ever claim that there is no other way to do what they do. You'd have to have knowledge of every technology to make that claim.

    Every claim you make, from control to logging, to performance tuning, to identifying issues and talking to those responsible to fix them, I can do. Only, I can do them better because I have better tools. Sure, sp_help2 works, but a .Net application profiler is a thousand times better.

    I also like the handwaiving of the BLOB issue. Since you don't have a technical argument (because T-SQL is literally not equipped to solve the problem), you simply suggest that it isn't a data-layer issue. I could change the argument to something like custom encryption, but I refuse to make the same point twice. I'll take the dodge as a win in my column unless you address it.

  89. Re:Poor programing practices, NOT IIS or SQL at fa by Jaime2 · · Score: 1

    What? I'm not talking about someone substituting a value in a query with another (legal) value. I'm talking about people trying to insert clauses etc. Random ad-hoc SQL is heavily discouraged

    Straw man argument. Stupid code is stupid. Stored procedures don't magically fix stupid code. I inherited a system where your exact example is done with a stored procedure. The idiots I took over from actually have a parameter in a stored procedure named @where_clause. It does exactly what it sounds like it does. So, the solution is actually code review and turning your brain on, not using stored procedures. Just because you happen to write good code by using stored procedures doesn't mean that using stored procedures contributed in any way to your writing good code.

    By your logic, I could claim that stored procedures are a bad idea because they can be used to create dynamic SQL atrocities.

  90. Re:in b4 by Anonymous Coward · · Score: 0

    How does it feel to be a freetard?