Slashdot Mirror


Cross-Site Scripting Hits Major Sites

An anonymous reader writes "Dark Reading and SC Magazine covered a story about hackers posting cross-site scripting (XSS) vulnerabilies en mass on dozens of high profile websites including Dell, MSN, HP, Apple, Myspace, YouTube, MSN, Cingular, etc. The media coverage drew the hacker's attention to the publication's websites where they got a taste first-hand. On message board wall-of-shame is PC World, MacWorld, Fox News, the Independent, and ZDNet UK. "...not only did we get the "scoop" on the XSS site problems, but we also got the message loud and clear: Don't assume you're immune to XSS vulnerabilities. They're everywhere." The news comes shortly after Mitre (CVE) released statistics showing XSS has become the most popular exploit. Unfortunately new XSS attacks are growing increasingly severe and scanners are unable to find many of the issues on modern websites."

17 of 161 comments (clear)

  1. Re:Scanners not able to find XSS by Tackhead · · Score: 2, Insightful
    > The reason most vuln scanners can't find XSS vulns on modern sites is because of the increased amount of JavaScript and Flash (with ActionScript) that's in use.

    Which is why I'm so happy that the currently-in-demonstration phase of the new Slashdot discussion system presumes/requires that Javascript be active.

  2. Re:Why? by RevDobbs · · Score: 2, Insightful
    For most contracts, if you aren't paying experienced developers, there should still be money in the budget for a pro to give the code the once over and do a sign-off.

    Have you ever read poorly-written, newbish code?

    For anything non-trivial, it would probably be quicker and cheaper to have the "pro" write the code in the first place than to pay him for his time to read, understand, and correct a steaming pile of turd spaghetti.

  3. Re:I don't get XSS by Anonymous Coward · · Score: 1, Insightful

    I've taught programming on and off for about 30 years at one of the best schools in the country, and I have never heard anyone even mention checking user input for something malicious. I have never seen it in a text book. This sort of thing isn't addressed by Knuth. It never comes up since in the recent past all development was done for trusted users. For example, you wouldn't care if a user on an isolated computer running Microsoft Word attempted an exploit. You don't need to check user input when teaching algorithms.

    That simply isn't CS 101. It isn't CS anything. It's only covered if you have a low-level web development class at a pitiful tech school.

  4. Re:scanners by From+A+Far+Away+Land · · Score: 2, Insightful

    "Draw you own conclusions from there..."

    You're using logic, while security software marketers are using damage control.

  5. Web 2.0 anyone? by griffon666 · · Score: 2, Insightful

    Web 1.0: Simple fishing scam
    Web 2.0: Cross-Site Scripting

    1. Re:Web 2.0 anyone? by blowdart · · Score: 4, Insightful

      Bad assumption. If you're assuming everything is coming down correctly encoded you're a fool, all it takes is a bit of javascript that submits to your back end without encoding and *bang*

  6. JavaScript/browser design flaw by oohshiny · · Score: 4, Insightful

    Before web designers blame themselves for this, the existence of XSS is really a fundamental design flaw in the way JavaScript and browsers work. It should have been obvious as soon as JavaScript came out that these kinds of attacks would become a major issue over time, but the "ooh shiny" attitude of the computer industry meant that people adopted JavaScript without knowing what the implications were. In fact, the other big security hole and productivity drain of the industry, C/C++, got adopted in a similar way.

    Writing any substantial piece of software in C, C++, or JavaScript without creating safety or security issues is extremely expensive and beyond the ability or resources of most developers. For C and C++, there are alternatives you can choose today. For JavaScript, you just have to minimize its use or simply not worry about it and let the client fix it with tools like NoScript.

    1. Re:JavaScript/browser design flaw by julesh · · Score: 2, Insightful

      The point is, though, that browser developers could have made script filtering substantially easier. If you want to accept HTML-formatted input to a web application, you have little choice but to try to filter out any scripts a malicious user may have inserted. And doing so is hard, because there are so many different ways scripts can be inserted into HTML. Script tags, event handler attributes, any attribute that can take a URL (e.g. src, href in many different elements), style attributes, style tags, ...

      And it *is* a fairly common requirement, because of the existence of technlogies like 'contenteditable' and 'designmode' that allows sites to embed WYSIWYG HTML editors into a web browser, and the lack of alternatives that produce non-HTML results.

      But forget that for a second: even if all you want to do is accept a URL and create a link to it, you need to do non-trivial filtering. Basically, you can either require that the URL is in a known good scheme (i.e. it begins with a substring from a list of good ones like "http:", "https:", "ftp:", "gopher:", "magnet:", etc.) or you can try to filter out URLs that invoke javascript. Start with anything that looks like "javascript:". Make it case insenstive. Now account for the fact that you can encode a URL with HTML entities for some or any characters (e.g. javscript), and that some browsers are rather permissivie with what they accept, and will accept embedded whitespace or null characters inside the javascript URL scheme.

      Basically, the javascript URL scheme was a mistake that never should have been made. It has made filtering javascript out of HTML source code a nightmare. It has turned otherwise safe tags (like A and IMG) and attributes (style) into something that you *must* strip or examine closely to determine if there is a security issue.

  7. Re:Why? by Schraegstrichpunkt · · Score: 3, Insightful
    What we have is total morons passing themselves off as web developers, just like we have thousands of "web designers" who don't know the meaning of the word "design".

    "Web design" is for aesthetics and graphics people, like "interior design". Of course you run into problems when you have a web designer doing development work!

    As for "No web developer has written XSS vulnerable code since 2002", I refer you to The Daily WTF.

  8. I do my duty and report them. . . by Hero+Zzyzzx · · Score: 5, Insightful

    but it's probably pointless. Not enough developers care about their craft.

    There's a prominent "popular science" website out there (no, it's not this one that I'm thinking of) that has ENORMOUS XSS vulnerabilities in its image gallery. They pass captions and img src in URL encoded query string parameters. Yuck.

    I noticed this about a year ago and reported it to the development team, with a demonstration link that put in a (sorta not nice) image and caption. No response, and when I checked six months ago the vulnerability was still there. So much for being a nice guy.

  9. Re:I don't get XSS by CastrTroy · · Score: 2, Insightful
    You've said it. I've found that school teaches very little about programming in the real world. Sure you get some security courses, adn they are great, but I think there should be a class on the common problems that show up in programming. Things that should really be taugh are:
    1. Always use parameterized queries and never construct your own queries by concatenating strings. This will not only speed up the application, it will make sql injection attacks a non-issue
    2. Always verity the users input. You never know what the user is going to try to do with bad input.
    3. When programming in languages like C, always check to ensure that the user can't perform a buffer overflow attack.
    I'm sure there's a lot of other things that people could add to this list. There's a lot of mistakes that happen over and over again. And I don't think that it's because people don't care, or aren't smart enough, but simply because they don't know the problem exists.
    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  10. You get what you pay for with developers... by queenb**ch · · Score: 3, Insightful

    The biggest problem is farming everything in the world out to $8/hr guys in some foreign country. If you pay $8/hr, you're going to get an $8/hr guy. Keep in mind that Wal-Mart starts at $9/hr. Given these two statements, I fail to see why it's surprising that such simply fixed vulnerabilities continue to plague software.

    2 cents,

    QueenB

    --
    HDGary secures my bank :/
  11. Re:I don't get XSS by Anonymous Coward · · Score: 1, Insightful

    I've taught programming on and off for about 30 years at one of the best schools in the country, and I have never heard anyone even mention checking user input for something malicious. I have never seen it in a text book. This sort of thing isn't addressed by Knuth. It never comes up since in the recent past all development was done for trusted users. For example, you wouldn't care if a user on an isolated computer running Microsoft Word attempted an exploit. You don't need to check user input when teaching algorithms.

    That simply isn't CS 101. It isn't CS anything. It's only covered if you have a low-level web development class at a pitiful tech school.

     
    Best.... Troll... Evah!

  12. Re:Move on... by profplump · · Score: 2, Insightful

    A) It's just as simple to prevent an SQL injection attack. Failing to clean your input is just a stupid mistake, regardless of the input method. Mistakes happen, but let's not pretend that input validation is complicated.

    B) The reason people like to build web interfaces is that the client, server, and transfer mechanism already exist. Writing a new one for each project is much, much more work.

  13. Validate, Validate AND Validate by Joe+U · · Score: 5, Insightful

    I'm a web developer and I've said this dozens of times.

    VALIDATE ALL INPUT EVERYWHERE.

    Validate on the client. (For bandwidth reduction)
    Validate at the APP Tier (For security)
    Validate at the Data Tier(For security and integrity)

    If you accept input from a web page, scrub it, and that doesn't mean stripping brackets or quotes, it means putting in a list of valid characters and tossing or replacing absolutely everything else.

    Yes, you might wind up validating something that doesn't need to be validated or scrubbing something that doesn't need to be, the performance hit is worth it.

    Also, Stored Procedures are a great resource, if you design them properly you add an extra layer of security that can actually improve your application performance. (All my recent projects have Stored Procedure execute only rights.

    If your db code has select * from table in it, you're doing it wrong.

    Ok, enough ranting from me.

  14. XSS is Common Because Our Tools Are Broken by Dom2 · · Score: 2, Insightful

    How many "web" templating systems do you know that automatically escape HTML unless told otherwise? I know of one that can be made to do so: Mason. Even then, you have to enable it, as it's not turned on by default.

    What about PHP, ASP, JSP and so on? Will they ever grow up and automatically escape HTML by default? I doubt it very much.

    In the meantime, there's always mod_security if you're willing to invest the time configuring it. But it's no guarantee...

    -Dom

  15. Re:I don't get XSS by TheAJofOZ · · Score: 2, Insightful

    The problem isn't that they didn't validate the user input, so much as that validating user input is really, really hard. RSS aggregators are discovering the problems with validating that HTML is safe. See http://www.feedparser.org/docs/html-sanitization.h tml
    The trouble is that an approach like that limits what you can do too much: http://www.symphonious.net/2006/09/10/stripping-st yles-as-part-of-sanitation/
    Any site that wants to support formatted comments, like Slashdot, has to deal with this. The plus side when it's just comments is that you can have very draconian limitations to what's accepted without it getting in the way (like Slashdot does).