AJAX May Be Considered Harmful
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."
Isn't this the thing that forced the redesign of Greasemonkey a while back?
The roots of education are bitter, but the fruit is sweet.
--Aristotle
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.
Ruby Neural Evolution of Augmenting Topologies
I'm scared of numbers that can't be written as a fraction. It's an irrational fear.
Except that when you visit site B, the browser discards all JS from site A before going to site B. Site B never sees any JS objects from A anyway. Think of the browser-supplied things (e.g. the XMLHttpRequest constructor) as a template; if you modify it you just get a copy of the template for yourself.
:)
If touching prototypes of built-in objects would persist across sites there simply could not have been more than one JS framework system. And nobody would have had scripting enabled...
Stupidity is like nuclear power, it can be used for good or evil. And you don't want to get any on you.
those 'gigantic problems' aren't problems with Ajax. There exist good solutions for both. The solutions, however, are nontrivial and are typically ignored by developers for whatever reasons.
there is no need to sign your posts. this isn't usenet. your username is right there above your post. stop it.
That's just stupid. A well designed AJAX app is faster to use than a regular one. Page reloads suck for applications. Have you seen Google Mail, with embedded Talk client, or maybe Calendar, or even the DHTML beta of slashdot's comments (barely AJAX, but still)? Those kick ass compared to older versions. A well designed AJAX app is great. Most AJAX apps suck, but it's not AJAX fault. And yes, it's sort of a hack. So what? So is every standards compliant site that looks good.
My english is sow-sow. Sowhat?
I'm in the middle of writing a fairly complex application in which the UI is ajax based. The calls to the back end are all done via these ajax calls.
At the end of the day, I verify the data I accept from the application before storing it. I don't trust anything coming from the client side. Just because it's ajax and I "think" I'm in control of the application doesn't mean that I am.
Big deal.
You still can send me options as selected if the options aren't in the list I offered you -- because I check. You can't send me invalid data because I check it for validity. That's my responsibility.
You can get me to send you something you don't have access to, because the agents that retrieve the data are running under your authority -- not as a system admin. If you don't have access to them, the data won't exist for you.
Again -- security happens at the back end. The front end is always to be considered hostile.
The problem with quotes on the internet, is that nobody bothers to check their veracity. -- Abraham Lincoln
Further, the slashdot summary suggests that Prototyping is a design flaw in JavaScript/ECMAScript. This wrong for two reasons:
- The article doesn't mention this.
- 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.