Combating Self-XSS
What is Self-XSS?
Dr. Evil has several options for getting his script to execute in the page of another site. Generically we call this XSS. Self-XSS involves using social engineering to coerce a user into manually executing JavaScript using the location bar or developer tools. For more, see socially-engineered XSS attacks.
The recent Facebook attack signals that something needs to be done, but knowing the right response is tricky.
What is Mozilla doing about it?
We're proposing adding a directive to CSP that says 'Please disallow user supplied JavaScript in the context of this resource'.
It will probably look something like this:
X-Content-Security-Policy: no-user-js
We're also going to add a way for developers to opt out of this protection. Effectively saying 'I can take care of the JavaScript that I ask my browser to execute'.
How does this affect other Firefox developer tools?
It doesn't. The Highligher, Style Inspector, Style Editor and Tilt are all unaffected. This is only about JavaScript executed via the Web Console and Scratchpad.
How does this affect users?
User | Is a developer? | ||
---|---|---|---|
No | Yes | ||
Can recognize Self-XSS attack? | No | Added Self-XSS attacks protection. | Warned about Self-XSS, may benefit from protection. |
Yes | Unchanged | Minor inconvenience of having to set a preference (one time only) to enable user JavaScript on sites using this Self-XSS protection. |
I think this is a fairly clear net win: Minor, one time only, inconvenience to a sub-set of web developers, vs. full-time protection for the many that wouldn't recognize a self-xss attack.
Objections: This is a user problem
The goal of educating 7 billion people about what JavaScript can do is lofty, grandiose, ambitious and utterly unattainable. There has to be another solution.
Objections: This is a Facebook problem
While it's true that allowing untrusted, unvetted, third party, dynamic content onto your site is something to avoid, I don't think that fixing this either is going to happen, or would fix the problem. The attack could easily forward you to another site to see the clipboard injecting flash, before returning you to the original site for the 'paste' step.
Objections: This is a Flash problem
While it's true that Adobe's clipboard policies are more relaxed than those of major web browsers, we've seen people caught by instructions that ask people to select/copy their own attack script. We think that the level of pain caused to developers by the CSP solution is low enough that we can justify the additional protection.
Translation
Пост доступен на сайте softdroid.net: Что такое Self-XSS, или межсайтовый скриптинг.
Comments
Unfortunately Firefox is becoming more and more uncomfortable for developers and power users with every security-related downgrade (because there's no way to call them updates), specially because the development team never provides a way to get the old behavior back "for the sake of security".
Educating 7 billion users is virtually never a practical option.
2. Run attack
Only way around this is to make the disable option something like a compilation option, but then it goes from a minor inconvenience/pain to a major.
I find this so easy to engineer around, that i think it adds more pain then it adds protection, and a better solution should be looked at.
- Why do you forget javascript from bookmarklets, and from javascript: URLs in the address bar ?
- And why doing things differently for the sites which don't have "X-Content-Security-Policy: no-user-js" ?
javascript:URLs - Firefox already block javascript URLs. My understanding is that Webkit based browsers will be doing the same soon.
Why are we ignoring sites that don't have 'X-Content-Security-Policy: no-user-js'. Because we want to disrupt the web as little as possible, and because most sites don't need it. Currently this is overwhelmingly a problem for very large social networks.
Comments have been turned off on old posts