Cross-Site Scripting Hits Major Sites 161
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."
The Cross Site Scripting FAQ (Score:5, Informative)
The Cross Site Scripting FAQ [cgisecurity.com]
Re:The Cross Site Scripting FAQ (Score:5, Interesting)
I particularly like this example [dlitz.net].
Here's the spoiler [dlitz.net].
Re: (Score:1)
The url is simply a redirect (HTTP/1.0 302) to http://www.google.com/setprefs?hl=ga&submit2=Save% 20Preferences%20&prev=http://www.google.com/search ?q=poodles&q=&submit=Save%20Preferences%20 [google.com] so it should work regardless of the browser or OS.
Re: (Score:2)
Re: (Score:2)
If you'd followed the second link I posted, you would have found a similar solution.
-- Your friend, "this idiot".
Re: (Score:2)
Re: (Score:2)
I don't get XSS (Score:1)
I'm sorry, I really don't grok Cross-Site Scripting issues...
Are there really that many web "programmers" out there that don't check their user-supplied inputs? I mean, that shit is CS 101...
Re:I don't get XSS (Score:4, Interesting)
Re: (Score:3, Interesting)
Maybe I lucked out with a particularly cluefull teacher, but input validation was beaten into me learning Basic on an Apple II(e?) in high school: everyone fails the first round of the Craps game assignment when the teacher asks "what happens when I bet a negative amount?".
Re: (Score:3, Insightful)
You get what you pay for with developers... (Score:4, Insightful)
2 cents,
QueenB
Re: (Score:2)
Re: (Score:2)
2 more cents,
QueenB
Re: (Score:2)
Re: (Score:2)
That's easy to fix, just pay $1600 per hour and you get a $1600/hr guy! My god, how good he must be.
Hint: Your logic has a flaw.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Re: (Score:1, Insightful)
Re: (Score:2)
Re: (Score:1, Insightful)
Re:I don't get XSS (Score:4, Informative)
Re:I don't get XSS (Score:4, Interesting)
I say this because people need to be aware that links are not the only vector. My favorite one I've seen so far is <bgsound src='javascript:bad_code()'>. If you choose poorly and are trying to filter out bad tags (instead of what you should be doing, specifying only exactly what tags and attributes are allowed and forbidding anything else that looks like a tag), did you remember to block out the BGSOUND tag? If not, that auto-executes; it doesn't even need to be clicked. (IE may have closed that; I saw this in the IE 4 era.)
Re: (Score:2)
For example, I'm developing a myspace-like system, with which I am presently grappling with these issues.
Ideally, I'd like to give users perfect creative freedom to do whatever they want on their profiles and online community pages. After all, they should be able to express themselves, no?
So before these attacks became well-known, it was a perfectly reasonable stance to say that we should NOT filter user i
Re: (Score:2)
In other words, it wasn't a mistake; He just had a better understanding of the threat than
Re: (Score:2)
I think my basic point stands, that we have to be much more paranoid now than we did then, and that on a personal level I think it really stinks.
D
Re: (Score:2)
Re: (Score:2)
As you know, at this very moment, YouTube is going bust in bandwidth bills hosting all that video, unless someone buys them out for US$1.5 billion first.
I don't want to host video. I want to let people point to their videos whereever they might be, so your idea won't work.
D
Re: (Score:2)
Re: (Score:3, Insightful)
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/ [symphonious.net]
Any site that wants to support formatted comments, like Slashdot, has to deal with this. The plus s
Firefox plugins: (Score:2)
To help safeguard from scripting attacks, I also use NoScript extension [mozilla.org].
The CookieSafe extension [mozilla.org] will block and help you manage cookies better than Firefox's built-in manager.
Stealther (prevents recording of history and blocks ReferentHeader)
Tor anonymizer + Foxyproxy extension
ImgLikeOpera can switch image prefs with ease
Flashblock (stops flash a
Re: (Score:2)
Can any web Guru's tell me if No-Script protects against what is outlined in the OP?
Re:The Cross Site Scripting FAQ (Score:5, Informative)
Now an evil hax0r manages to insert an XSS attack on slashdot what would happen is the attack would be embedded in a normal slashdot page, as a block. So the source would be from slashdot.org, and noscript would view it as being allowed.
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:3, Informative)
Re: (Score:2)
Re: (Score:2)
Referer checks are not robust enough.
Converting the controller to accept POST only (no GET) or adding a signature / nonce to the form would fix it.
Re: (Score:2)
Why wouldn't a referer check be enough?
It would have to be a nonce, and probably one that's tied to a particular user, and can't be generated by third parties for that user. Otherwise, I can just copy the form to my website, modify it, and use some Javascript to auto-submit it.
Re: (Score:2)
You can't count on it.
@nonce: Of course. I just sketched the normal approach to securing sites from Cross Site Request Forgery.
Re: (Score:2)
You are missing the point. Think of NoScript as a firewall. Instead of accepting Java
Re: (Score:2)
I'm afraid I might not fully understand the nature of XSS and how it works. I've read the FAQ linked to in the original comment of this thread. I've also read the Wikipedia entry on XSS. It seems that in all instances some form of browser-based scripting is required to execute the payload. Let's forget NoScript for a moment and assume
Re: (Score:2)
Scripting? (Score:3, Funny)
Finally (Score:2)
Scanners not able to find XSS (Score:3, Informative)
Re: (Score:3, Insightful)
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.
Move on... (Score:2, Informative)
So would it be technically possible at this point to move away from the web application and back to the client server app? Here's a path example:
* Java Client
* Servlet Interface for the client
* Java webstart deployment
* Java plugin on the clients
For this path the questions would surround authenticating the client and the hassle of installing the java plugin.
Rinse and repeat for the obligatory Microsoft solution.
I've never been a fan of web applications and form given the simplicity of creating an SQL inject
Re: (Score:2)
Re: (Score:1)
First off let me preface by agreeing with you that a slightly thicker client model makes sense over the web application model.
That said, however, I don't think that will necessarily solve the problem. Most HTML form based code is already being intercepted by Java servlets and processed by Java, meaning the developers are taking the form fields and dumping them straight into SQL (for SQL injection issues). So moving to a different client isn't going to change that problem, the fields will just be captu
Re: (Score:2)
Re: (Score:2)
And seeing as the idiot programmers are multiplying...
Re: (Score:2, Insightful)
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.
Re: (Score:2)
In soviet russia.. (Score:4, Funny)
scanners (Score:3, Interesting)
Draw you own conclusions from there...
Re: (Score:3, Insightful)
You're using logic, while security software marketers are using damage control.
But of course Slashdot... (Score:4, Funny)
...remains unaffec... FOJSF{09fiE*EU90av['vlwIOA934MAwadpskf[aepfkfa[-09 u9a
Re:But of course Slashdot... (Score:5, Interesting)
A while ago, someone posted a link to a webpage that, when clicked, caused their post to be moderated up. Their post was at +5 for quite a while until enough replies got moderated up pointing out that the link wasn't what it claimed to be.
So, in a sense, Slashdot has already been hit by a cross-site scripting vulnerability. The fix for XSS vulnerabilities like that involves requiring a secret token to be sent to take user actions, to prevent people from creating forms off-site and submitting them as the user. I suppose checking the referrer may work too, but I wouldn't count on it.
Re: But of course Slashdot... (Score:2, Interesting)
http://cyberai.com/inputfilter/index.php [cyberai.com]
Come on (Score:2)
Please?
Re: (Score:2, Funny)
Web 2.0 anyone? (Score:2, Insightful)
Web 2.0: Cross-Site Scripting
Re: (Score:1)
What I do find worrying is that when I talk about this (and I do now and again, because I am a presenting whore) is that some people who are implementing ajax suddenly think because they're getting xml from an environment they set
Re: (Score:2)
I've been working with JsOrb [jsorb.org] (which lets you call your Java interfaces from Javascript) and one of the nice things about it is that when used correctly it makes XSS vulnerabilities go away. Since the data is encoded inside XML messages, the browser takes care of properly escaping all those goofy characters into & for you.
Re:Web 2.0 anyone? (Score:4, Insightful)
Re: (Score:2)
I'd be a fool if I received HTML fragments from the appserver, and those fragments were partially user-generated content, and those were unescaped. Bu
Re: (Score:2)
Re: (Score:2)
The flaw that gives rise to XSS is the idea that pasting user-submitted content into a text serialisation of a web page is a good idea. You can fix it by using an API that doesn't do that,
JavaScript/browser design flaw (Score:5, Insightful)
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.
Re: (Score:2)
Re: (Score:3, Insightful)
Re: (Score:2)
Yes, and that's a bad assumption.
By not validation user input and just dumping that junk out as markup, the website is making a big mistake.
Indeed. But the web browser is making an even bigger mistake by not validating input from the web site and screwing the user. Why is it doing that? Because that's what the web standards say it should do.
A standard is bad if (1) real developers have a propensity of making
I do my duty and report them. . . (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 [popularscience.com] 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.
But they don't care... (Score:2, Interesting)
Re: (Score:1, Interesting)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
If you don't see that the hole is closed quickly you could be on the receiving end of a lawsuit fro
Too Lazy? (Score:2, Informative)
Experienced this firsthand. (Score:2, Interesting)
Aren't there any laws against these attacks? (Score:1)
I'm sure there are ways to know who the hacker is, so why don't they use the information to catch the criminals and put them on trial?
Useful PHP Script (Score:1)
Validate, Validate AND Validate (Score:5, Insightful)
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.
Re: (Score:2)
Bravo!
XSS attempts I've noticed (Score:5, Interesting)
XSS is Common Because Our Tools Are Broken (Score:3, 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 [masonhq.com]. 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 [modsecurity.org] if you're willing to invest the time configuring it. But it's no guarantee...
-Dom
Re: (Score:2)
Good for you! Now what about the 99% of developers who don't?
Looks lovely. Now how are you going to get that installed into the existing browser base?
I was under the impression that you could tackle CSRF [wikipedia.org] on the server side by doing enough valida
Major vector: $PHP_SELF (Score:2)
I think this is a major XSS vector, because this is unknown (really now, wouldn't you expect a $_SERVER variable to be safe?)
For example:
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="get">
<input type="
Re: (Score:2, Insightful)
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.
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
I do think that most any code especially high-profile code that has the potential to affect personal data (of large numbers of usres) should be reviewed by "pros" and third-party's. I want the largest number of eyes to review my code, and someone wanting a review shouldn't be taken as not "trusting" or whatever...it just makes sense.
Re: (Score:2)
That site is the biggest turd ever foisted on this earth since the mammoth stopped taking dumps in Siberia.
Been there, done that. (Score:3, Interesting)
If you pay me enough money, I'll write new code and claim that what I did was correct the old codebase.
You could probably take a random blob of ones and zeros, run multiple instances of it as an executable image while randomly tweaking bits until you evolved a real executable, far faster than y
Re:Why? (Score:4, Insightful)
"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 [thedailywtf.com].
Re: (Score:2)
People who only browse trusted sites and are suddenly having their IE installations exploited via those 0-days because somebody used an XSS attack to insert them into those sites.
Re: (Score:2)