Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

AJAX May Be Considered Harmful

Posted by Zonk on Sat Jan 06, 2007 04:19 PM
from the web-20-needs-vitamins dept.
87C751 writes "Security lists are abuzz about a presentation from the 23C3 conference, which details a fundamental design flaw in Javascript. The technique, called Prototype Hijacking, allows an attacker to redefine any feature of Javascript. The paper is called 'Subverting AJAX' (pdf), and outlines a possible Web Worm that lives in the very fabric of Web 2.0 and could kill the Web as we know it."

Related Stories

[+] Experts Say Ajax Not Inherently Insecure 82 comments
An anonymous reader writes "Jeremiah Grossman (CTO of WhiteHat Security) has published Myth-Busting - an article dismissing the hyped-up claims that AJAX is insecure. He says: 'The hype surrounding AJAX and security risks is hard to miss. Supposedly, this hot new technology responsible for compelling web-based applications like Gmail and Google Maps harbors a dark secret that opens the door to malicious hackers. Not exactly true ... Word on the cyber-street is that AJAX is the harbinger of larger attack surfaces, increased complexity, fake requests, denial of service, deadly cross-site scripting (XSS) , reliance on client-side security, and more. In reality, these issues existed well before AJAX. And, the recommended security best practices remain unchanged.'"
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • first post (Score:5, Funny)

    by Anonymous Coward on Saturday January 06 2007, @04:21PM (#17491204)
    So can I hijack slashdot to always get the first post?
    • Re:first post by spion666 (Score:1) Saturday January 06 2007, @10:18PM
    • You might - if you can find an available XSS vulnerability to use as a vector. TFA assumes this blithely for the sake of demonstration, but it's a big assumption.

      Further, the slashdot summary suggests that Prototyping is a design flaw in JavaScript/ECMAScript. This wrong for two reasons:
      1. The article doesn't mention this.
      2. Prototyping is not a design flaw.
      Prototyping is a very useful language feature that can be used to do all sorts of things that would otherwise be cumbersome or impossible. Ruby is a prototyped language - a feature which is responsible for much of the 'magic' of Rails.

      The article does outline a number of Ajax related vulnerabilities, but like most vulnerabilities, they can be mitigated or avoided entirely if paid attention to - much like the SQL injections of old.

      Arguing that Prototyping or Ajax makes JavaScript unsafe is fud. These are powerful language features that (like any powerful feature) can be used for evil if an injection mechanism is available.
      [ Parent ]
      • Re: first post (Score:5, Insightful)

        by Crayon Kid (700279) on Sunday January 07 2007, @08:03AM (#17496950)
        [..]if an injection mechanism is available.
        Therein lies the cruft of the issue. XSS is the culprit, not Ajax, not prototyping, not JavaScript itself. It all comes down to incompetent developers allowing visitors to inject JavaScript that other visitors will execute. Period. Once custom JS is executed all bets are off, assume the worst.

        This is an extremely basic point in security of any kind: once the attacker is executing code inside your system, that's bad. Nevermind that fact that other limiting factors will mitigate the range of the attack (browser-only for JavaScript, account-permissions-only for other attacks). Most efforts should be made to prevent intrusion, not to limit damage after the attacker is "in".
        [ Parent ]
        • Re: first post by moro_666 (Score:2) Sunday January 07 2007, @03:06PM
        • Re: first post by phaggood (Score:1) Sunday January 07 2007, @08:14PM
        • 1 reply beneath your current threshold.
      • Re: first post by SporkLand (Score:1) Sunday January 07 2007, @10:34AM
  • by mobby_6kl (668092) on Saturday January 06 2007, @04:21PM (#17491208)
    Not surprising considering that slashdot is slowly trying to AJAXify itself...
  • The sky is falling! (Score:2, Funny)

    by udderly (890305) * on Saturday January 06 2007, @04:22PM (#17491212)
    Haven't RTFA yet, but I doubt it will live up to the hype.
    • by Anonymous Coward on Saturday January 06 2007, @05:14PM (#17491660)
      I haven't read it either, but from experience, I'd imagine it hold up very well.

      AJAX applications just aren't solid or stable, for the most part. We tried to integrate a number of them into our network here, and frankly each attempt went terribly. I'd like to think it was just one application vendor or AJAX toolkit that was problematic, but that wasn't the case.

      We found a number of common problems with every AJAX application we tried. Just for the record, the applications included three CMS systems, a Web-based email system, two groupware systems, and three Web forums.

      The first major problem with one of resource usage, on both the client-side and the server-side. Client-side, many AJAX applications consume far too much CPU time. From our investigation, it was due to the use of poor JavaScript algorithms that'd consume 100% of the CPU in some cases, for minutes on end. The applications "worked", in that they'd provide the correct result. It'd just take them far too long to get it done.

      On the server-side, they'd again result in excessive CPU and RAM consumption. For one of the Webmail systems, we could only handle a fifth (yes, 20%) of what our old Perl-based system could. And that was on a quad-core Opteron system with 8 GB of RAM! The Perl-based system was on a couple of 200 MHz Pentium systems, each with 128 MB of RAM. Even after assistance from the AJAX-based Webmail system's vendor, we were only able to handle roughly 90% of the number of transactions of our older system.

      The second major problem is that of usability. Many of the AJAX apps we tried didn't play well with browser tabs, for instance. Some even fucked around with text input areas, resulting in copy-and-pasting no longer working. One application even prevented the text within a text field from being highlighted! We thought these problems may be browser-specific incompatibilities, be we ran into this same problem with Firefox, Safari, Opera, and even IE6! After talking with the vendor, they admitted these were known problems, and no solutions were presently available.

      The third major problem is a lack of quality. Many AJAX applications are poorly coded and poorly designed. I think the main reason for that is because it's such an unstructured technology. Even competent software developers run into problems that cannot be solved easily, and thus must resort to hackish techniques to overcome these inherent problems.

      The fourth major problem was that the users hated the systems. Of the few systems we managed to roll out successfully, the users absolutely hated them. Their complaints were a combination of the above three factors. The AJAX applications would not do what the user wanted. The AJAX applications did not conform to common practices (eg. copy-and-paste, textbox text selection, etc.). The AJAX applications ran far too slowly, even on fast client machines. The AJAX applications just plain didn't work!

      All of our AJAX trials were abysmal failures. That's why we're sticking with the existing Perl- and Java-based systems that we currently use. They perform far better on much fewer resources, actually do what the users want, avoid violating the most common of conventions, and they do what they're supposed to. I'm sorry to say it, but AJAX might just be the worst technology I have ever had to deal with.

      [ Parent ]
    • Re:The sky is falling! (Score:4, Funny)

      by Tablizer (95088) on Saturday January 06 2007, @05:14PM (#17491664)
      (http://www.geocities.com/tablizer | Last Journal: Saturday March 15 2003, @01:22PM)
      Haven't RTFA yet, but I doubt it will live up to the hype.

      Which hype, AJAX itself or AJAX ending the world?

      Does Al Gore know anything about this?
               
      [ Parent ]
    • you're correct, and I did read the article by sethawoolley (Score:1) Saturday January 06 2007, @07:07PM
    • 1 reply beneath your current threshold.
  • "Considered Harmful" (Score:5, Insightful)

    by JoshJ (1009085) on Saturday January 06 2007, @04:22PM (#17491216)
    Javascript vulnerabilities will stop people from using AJAX just like Word vulnerabilities will stop people from using Microsoft Office.
  • Web 2.0.1 (Score:5, Funny)

    by ticklish2day (575989) on Saturday January 06 2007, @04:23PM (#17491226)
    Patch the hole and release Web 2.0.1. Good thing there's already a Web 3.0 [alistapart.com] in the works.
    • Re:Web 2.0.1 by The Bubble (Score:3) Saturday January 06 2007, @04:55PM
    • Re:Web 2.0.1 by pkaral (Score:2) Saturday January 06 2007, @06:06PM
  • Greasemonkey? (Score:2, Interesting)

    by Mitchell Mebane (594797) on Saturday January 06 2007, @04:27PM (#17491254)
    (http://whattheboat.com/ | Last Journal: Monday January 03 2005, @09:14PM)
    Isn't this the thing that forced the redesign of Greasemonkey a while back?
    • Re:Greasemonkey? (Score:4, Informative)

      by JackHoffman (1033824) on Saturday January 06 2007, @04:49PM (#17491444)
      No, Greasemonkey exposed security sensitive functions to websites. They were meant to be used by Greasemonkey scripts but websites had access too.

      This is about the way Javascript implements object oriented programming: In Javascript you don't define classes from which objects are instantiated. In a nutshell, you create prototype objects and new objects are copies of the prototypes. The "attack" is to change existing prototypes. For example, you can add a new function to the String prototype or replace an existing function with your own implementation. Every String object then gets the new function. There is one problem with this: Cross site checks don't apply. A script from one site can't simply communicate with another site, but it can modify the prototypes that the scripts from the other site use and subvert the communication of the other script with its host.
      [ Parent ]
      • Re:Greasemonkey? by gkhan1 (Score:2) Saturday January 06 2007, @07:53PM
      • Re:Greasemonkey? (Score:5, Insightful)

        by suv4x4 (956391) on Saturday January 06 2007, @08:09PM (#17493150)
        There is one problem with this: Cross site checks don't apply.

        You didn't test that and just assumed it's true I guess. But if they applied, and each page context runs in its own sandbox with its own version of String, Number, and so on, you'd sound pretty stupid right?

        Try it yourself, the prototypes are NOT shared. They are not shared even among two page tabs on the same domain.

        In fact not shared even among two instances of the SAME PAGE.

        Embarassing, I guess, for all modded 5+ claiming this on this article.
        [ Parent ]
      • FEATURE is a bug? Wake me up when.. by bussdriver (Score:2) Saturday January 06 2007, @11:04PM
  • A bit over the top... (Score:4, Insightful)

    by Sloan47 (977340) on Saturday January 06 2007, @04:27PM (#17491262)
    "...and could kill the Web as we know it." Oh come on! Isn't that exaggerating a tad? Obviously with some browser patches and more secure server code, the problem is solved. Gotta love sensationalism!
  • notabug (Score:3, Insightful)

    by QuoteMstr (55051) on Saturday January 06 2007, @04:31PM (#17491290)
    This paper is absolutely ridiculous, and its author is scaremongering --- if you have access to a site's scripting system via some cross-site vulnerability, then you don't _need_ to subvert an object's prototype to change its behavior. If you're relying on client-side code of any sort, be it written in Javascript or C, for security, you're up a creek without a paddle anyway. Oh nooes, man in the middle proxy attacks! Oh noes, browser bugs allowing javascript to leak outside its security context! There is no security vulnerability in this paper that hasn't been known and worked around for years. I'm wondering what kind of agenda the author has in writing this, actually.
    • Re:notabug by kfg (Score:2) Saturday January 06 2007, @04:40PM
    • Re:notabug (Score:5, Informative)

      by coma_bug (830669) on Saturday January 06 2007, @04:56PM (#17491476)
      I'm wondering what kind of agenda the author has in writing this, actually.

      page 3
      This technique has been found by S. Di Paola and is called Prototype
      Hijacking
      . It represents the state of the art in hijacking
      techniques applied to the Javascript language.

      page 6
      This new kind of attack has been called AICS and has been thought by S.
      Di Paola and G. Fedon and developed by S. Di Paola.

      page 8
      Stefano Di Paola. Senior Security Engineer of proved experience, works
      since many years as an IT consultant for private and public companies.
      He teaches Database Programming and Information Security at the
      University of Florence. Since 1997 is a well known security expert; he
      found many of the most dangerous vulnerabilities in recent releases of
      MySQL and PHP. From 2004 his researches focused mainly on Web security.
      Actually he is part of OWASP (Open Web Application Security Project)
      team and he's the focal point of Ajax security for the Italian Chapter.

      He is the creator of http://www.wisec.it/ [wisec.it]

      Giorgio Fedon. Currently employed as senior security consultant and
      penetration tester at Emaze Networks S.p.a, delivers code auditing,
      Forensic and Log analysis, Malware Analysis and complex Penetration
      Testing services to some of the most important Companies, Banks and
      Public Agencies in Italy. He participated as speaker in many national
      and international events talking mainly about web security and malware
      obfuscation techniques. During his past job he was employed at IBM
      System & Technology Group in Dublin (Ireland).

      Actually he is part of Owasp (Open Web Application Security Project)
      Italian Chapter.
      [ Parent ]
      • Re:notabug by achacha (Score:2) Saturday January 06 2007, @08:11PM
        • Re:notabug by pboulang (Score:3) Sunday January 07 2007, @02:03AM
    • by KalvinB (205500) on Saturday January 06 2007, @05:04PM (#17491554)
      (http://www.icarusindie.com/)
      JavaScript S on Domain A needs to access the server side script on Domain B. All S has to do is AJAX to a local bridging script which forwards the request using CURL,LWP, etc to B. The bridge then feeds the response to S. S has no idea that the AJAX request went to another domain. As far as B knows, A is just a web visitor.

      Since AJAX runs on the client side it's not possible to whitelist IPs and Referers can be spoofed.

      As with every client/server app the client can never be trusted.
      [ Parent ]
    • Re:notabug (Score:5, Informative)

      This paper is absolutely ridiculous, and its author is scaremongering

      Try reading the paper before lambasting it. The stuff you saw in the slashdot article isn't in the paper. The author of the paper says things like "innovative new attack" and "next generation of server side injection." The stuff about end of the web as we know it is from the slashdot poster. The paper is quite insightful, and the author is almost blase about the whole thing. It's quite clear that he simply believes he's unearthed a new form of attack, and he's in fact quite correct.

      Please get off of your soapbox. You're wrong.
      [ Parent ]
      • Re:notabug by suv4x4 (Score:1) Saturday January 06 2007, @05:20PM
        • Re:notabug (Score:5, Insightful)

          Would you let me know what's new in XSS? All the paper describes are pedestrian ways to sniff info out of a site via existing XSS exploit.

          The thing which is novel in this paper is the delivery mechanism, specifically by fundamentally replacing parts of javascript to carry attacks in what would otherwise be quite clean and legitimate code. The only parallel I can think of is the embedded-in-compiler attack that was referred to by the Guy Steele era TNHD as "the greatest hack ever," wherein the foreign code installed itself into anything compiled by said compiler, including new iterations of said compiler. (By the by, I can think of several hacks I think are better; I just mentioned the phrase because most people know to what that refers.)

          And XSS is by no means new, or "fundamental flaw" of JS.

          I'm not sure why you keep talking about XSS. XSS prototype overloading attacks are just his first example of something you could deploy over his new attack vector. The paper isn't about the XSS attack at all. It's not the payload he's talking about, it's the delivery mechanism. You might consider re-reading. I mean, come on, he even cites someone named "S. Di Paola" (near the top of the second column on page three of the PDF) as the person who came up with the XSS attack he uses as an example, and the XSS attack starts right after the header "advanced example". Why are you suggesting he claimed that was new?

          As far as whether prototype overloading is a fundamental flaw of javascript, from the security perspective the current implementation most certainly is. There is no mechanism to identify whether a fundamental library feature has been replaced, or whose implementation you're using. There is not yet an existing mechanism by which an application can defend itself from this kind of attack; this must be defended against by the runtime environment instead, and there are not currently any runtime environments which defend against this sort of thing. Indeed, some of the JavaScript libraries I use rely on that those features are replacable (specifically prototype, moofx, behaviour and dojo, though I know of quite a few other libraries which do it too.) MooFX adds a ton of new features to fundamental things like Objects, Arrays and Strings that I use all the time.

          The same mechanism Moo uses to extend things could be used to extend bad things into place. The XSS attack is just an example. It's the extension he's talking about. It wouldn't be hard to "extend" a "logging" mechanism into XMLHttpRequest; indeed I did that once as a debugging tool. What if said logging mechanism logged to a foreign server? There are a million ways to exploit this.

          When XSS can occur, it's an implementation flaw of the browser and/or site, and by no means "fundamental" as it's usually fixed in the next point release or site update.

          You seem to have entirely missed the point. The thing this paper describes is an attack mounted by a malicious site against later sites in the user's browsing path, not an attack mounted against a site with a flaw. This attack leverages a flaw in current browser implementations of JavaScript in such a way that there need not be a flaw in the remote site, and it is neither possible for a remote site to detect or resist such attacks.

          The fundamental flaw is not in Javscript. It's in current implementations of Javascript. You are confusing mechanisms and targets. Yes, the target of this attack is other sites, but the mechanism has nothing to do with the target, and there's nothing the target can do. It's a browser-side attack.

          Fundamental would mean it can't be fixed

          Yes and no. It's fundamental *to* *current* *implementations* of the language, not the language itself. So yes, it cannot be fixed, *in* *current* *implementations*; it requires a minor new implementation strategy on the part of browser vendors. This will end up requiring a security patch to all browsers (and proba
          [ Parent ]
          • Re:notabug (Score:4, Insightful)

            by suv4x4 (956391) on Saturday January 06 2007, @07:52PM (#17493008)
            As far as whether prototype overloading is a fundamental flaw of javascript, from the security perspective the current implementation most certainly is. There is no mechanism to identify whether a fundamental library feature has been replaced, or whose implementation you're using.

            Repeat after me: client-side, interpreted language.

            You're loading SOURCE CODE on a machine you DO NOT CONTROL.

            In other words, the fact you can "hijack" prototype methods is not a major discovery, since you can actually modify the actual *source code* itself, the classes instantiated can be replaced with other classes, variables can be read and written, instances can be destroyed and replaced.

            This is what "scripting" is about. If you don't like it and you're juggling with sensitive info on the client side, there's only one option: not allow XSS by carefully validating scenarios where this may occur (such as displaying poorly sanitized customer data on public pages).

            I guess some people still have some difficulty comprehending that anything in JS is subject to change on the client side.
            [ Parent ]
            • Re:notabug (Score:4, Insightful)

              I guess some people still have some difficulty comprehending that anything in JS is subject to change on the client side.

              A good example is writing your own proxy to fetch a site, then inject your own scripts into it before feeding it to your browser. Block ads, replace the body.onLoad() that calls a bunch of popups, rewrite all the urls, etc.

              Gee, maybe I should write up a fancy paper on how I did it, say its the "latest attack vector" or some other nonsense, and pimp myself as some 133t s3cur1ty xp3rt.

              [ Parent ]
          • prototype overloading is not special by sethawoolley (Score:2) Saturday January 06 2007, @08:14PM
          • Re:notabug by Anonymous Coward (Score:2) Saturday January 06 2007, @08:30PM
          • Re:notabug by smallpaul (Score:2) Saturday January 06 2007, @11:46PM
          • Re:notabug by An Onerous Coward (Score:2) Sunday January 07 2007, @08:06PM
      • Re:notabug by coma_bug (Score:2) Saturday January 06 2007, @05:23PM
        • Re:notabug by dodobh (Score:2) Sunday January 07 2007, @11:00AM
      • Re:notabug by Anonymous Coward (Score:1) Saturday January 06 2007, @06:01PM
      • Re:notabug by ubernostrum (Score:2) Saturday January 06 2007, @06:23PM
      • Re:notabug by netsharc (Score:2) Saturday January 06 2007, @11:26PM
      • Re:notabug by julesh (Score:2) Sunday January 07 2007, @08:56AM
    • A well-travelled road by ishmalius (Score:2) Saturday January 06 2007, @05:12PM
    • Re:notabug by radtea (Score:1) Saturday January 06 2007, @05:25PM
      • Re:notabug by Myen (Score:3) Saturday January 06 2007, @05:49PM
        • Re:notabug by radtea (Score:2) Saturday January 06 2007, @10:00PM
    • 1 reply beneath your current threshold.
  • Summary completely overhyped (Score:5, Informative)

    by levell (538346) on Saturday January 06 2007, @04:35PM (#17491322)
    (http://www.coralbark.net/)

    Having skim read the article, it outlines how *if* you can execute malicious javascript for a website you can subvert the AJAX communication so that you can have man in the middle attacks etc.

    However once an attacker can execute malicious javascript in the scope of the target website you're toast whether you are using AJAX or not.

    I'll make a bold prediction and say that is not going to "kill the Web as we know it" contrary to what the /. article says.

  • FUD? (Score:2)

    by ArcherB (796902) * on Saturday January 06 2007, @04:35PM (#17491328)
    (Last Journal: Monday April 30 2007, @10:21PM)
    a possible Web Worm that lives in the very fabric of Web 2.0 and could kill the Web as we know it.

    This statement has FUD written all over it. (or was it written in FUD?)

    • Re:FUD? (Score:5, Funny)

      by ednopantz (467288) on Saturday January 06 2007, @04:43PM (#17491394)
      >(or was it written in FUD?)

      Ok, I propose we create a new programming language called FUD. Variables will be assumed to have their most sinister values and be impossible to verify.
      [ Parent ]
      • Already been done by Anonymous Coward (Score:1) Saturday January 06 2007, @04:57PM
      • Re:FUD? by Mr. Underbridge (Score:3) Saturday January 06 2007, @04:58PM
        • Re:FUD? by alphamugwump (Score:1) Saturday January 06 2007, @08:50PM
      • Re:FUD? by kirun (Score:1) Saturday January 06 2007, @05:01PM
    • Re:FUD? (Score:5, Funny)

      by monoqlith (610041) on Saturday January 06 2007, @04:46PM (#17491418)
      . (or was it written in FUD?)

      Sadly, no. The FUD compiler was written in Javascript, and was hijacked.
      [ Parent ]
    • Re:FUD? by wasted (Score:2) Saturday January 06 2007, @05:08PM
    • Re:FUD? by hobo sapiens (Score:1) Sunday January 07 2007, @02:18AM
    • 1 reply beneath your current threshold.
  • by MajorDick (735308) on Saturday January 06 2007, @04:38PM (#17491346)
    I hate JS, it Had potential, 8-9 years ago. What we are seeing now is a push way beyond its original intended scope. The truth is, it would have had much less potential for vunerability if it had not been neglected for so long. Every time I have to get down and dirty with it I think of that. Its Ok, and somethings are nice from a shorthand perspective if youre used to other lll, but for GODS Sake , Revise the spec and put some effort into it, OH Wait, but thats been part of the problem all along, MS puts this in, NS/Moz (Used to) and what do we have , something no one entity controls, or even standards of. Whats wrong with putting a friggin python interpreter in a browser ? Ms is running that way with IronPython (Yea Proof of concept I know) but Read Scott G, and Paul W. aticles on dynamic languages theyre a fan. Oh well, back to ajaxifying the planet because my boss dosent like the flash when he clicks buttons on the web ( Oh wait I quit that job 4 months ago....)
  • Crying "Wolf" (Score:3, Interesting)

    by flajann (658201) on Saturday January 06 2007, @04:41PM (#17491372)
    (http://www.justblamefred.com/ | Last Journal: Tuesday October 18 2005, @11:34PM)

    Do they ever learn? All of this scaremongering is numbing the uninitiated, and when there is a real threat no one will be prepared.

    Well, my BS meter pings off the scale when I see alarmist claims like "shutting down the web." How many of those claims have we all seen over the past years?

    I suppose it's the 21st-century equivalent of "The World is Comming to an End!"

    I consider that anyone who makes such outlandish claims should be remembered, indexed, marked, and noted. When their claims fails to come true, then we can all stand around and laugh at them and grant them Idiot Awards.

  • by Chineseyes (691744) on Saturday January 06 2007, @04:44PM (#17491400)
    A Worm that lives in the very fabric of Web 2.0 and could kill the Web as we know it lurks is the deep dark recesses of the javascript
    Who is this masked man known as the worm?
    Why does he hate Web 2.0 so much?
    Will this worm try to make us revert to Web 1.0?
    And does this worm have anything to do