Clickjacking and NoScript
Posted by: Giorgio in Clickjacking, Flash, Mozilla, Security, NoScriptUpdate
If you did not yet, you should upgrade to NoScript 1.8.2.1 or above, because of the new ClearClick technology, the most effective anti-Clickjacking protection available.
Looks like Clickjacking is the web-security buzzword of the week (month?), since Robert "RSnake" Hansen and Jeremiah Grossman decided to cancel their OWASP talk, drawing an aura of mystery around the whole issue and its magnitudo.
Nevertheless some info and speculations have been percolating, and even if the precise details of the attacks proposed by those two researchers are still embargoed, especially because of the serious and not necessarily obvious implications worrying Adobe, a certain awareness about the general technique and the possible countermeasures does circulate now. In Jeremiah's and RSnake's words:
Think of any button on any Web site, internal or external, that you can get to appear between the browser walls, wire transfers on banks, Digg buttons, CPC advertising banners, Netflix queue, etc. The list is virtually endless and these are relatively harmless examples. Next, consider that an attack can invisibly hover these buttons below the users’ mouse, so that when they click on something they visually see, they actually are clicking on something the attacker wants them to. [...]
Say you have a home wireless router that you had authenticated prior to going to a [malicious] web site. [The web site] could place a tag under your mouse that frames in a single button an order to the router to, for example, delete all firewall rules.
In other words, the attack is thrown by a malicious web page embedding objects, possibly from a different site, such as framed documents or plugin content (Flash, Silverlight, Java...) which may lead to unwanted results if clicked by the current user (e.g. a "Delete all messages" button in your webmail or an advertisement banner in a click fraud scheme). Using DHTML, and especially CSS, the attacker can disguise or hide the click target in several ways which go completely undetected by the user, who's easily tricked into clicking it in a more or less blind way.
JavaScript increases the effectiveness of these attacks hugely, because it can make our invisible target constantly follow the mouse pointer, intercepting user's first click with no failure. We can however imagine a few less effective but still feasible scriptless scenarios, e.g. covering the whole window with hidden duplicates of the target or overlaying an attractive element of the page, likely to be clicked (e.g. a game or a porn image link), with a transparent target instance.
Nevertheless, as RSnake puts it,
[...] the best defense against clickjacking attacks is to use Firefox with the NoScript add-on installed. Users running that combination will be safe, said Hansen, against “a very good chunk of the issues, 99.99 percent at this point.â€
That's true because attacking from an untrusted page not allowed to run JavaScript is highly impractical, but also because NoScript by default prevents Java, Silverlight and especially Flash content, which seem so far the most dangerous clickjacking targets, from being embedded on non-whitelisted pages.
But what about that damned 0.01%? That's given by framed documents, most notably IFRAMEs. For a live and benign example of what you can do with IFRAME-based clickjacking, look at NoScript's "install now!" widget, which gets dynamically overlayed by the addons.mozilla.org install page: they're positioned so that if you click on the orange button you automatically install from AMO, skipping the security notification bar you would get on any other site. This "clickjacking" of mine has been there for a long time (since AMO V3, IIRC), and it heavily relies on JavaScript.
But even if an IFRAME-based attack was carefully crafted to work without JavaScript, NoScript would still provide effective protection, scoring a perfect 100% by RSnake's standards. You just need to enable the Plugins|Forbid <IFRAME> option, and cross-site IFRAMEs will be blocked by default on untrusted pages: they will need a confirmation to be activated, therefore "blind clicks" become impossible. Zone 365 and Hardware Forums created a short video tutorial about this setting. If you want to be protected even against unlikely attacks thrown from a trusted site included in your whitelist, check Plugins|Apply these restriction to trusted sites as well: embedded objects (plugin content and frames) get blocked on every site, but you can enable any of them on the fly by clicking on its placeholder.
A final recommendation is reading this Michal Zalewski's contribution, which covers the IFRAME case only but is very generous with mitigation proposals, both for web developers and browser vendors: by the way, his browser fix proposal #4 is almost identical to current NoScript's Forbid <IFRAME> option, and simpler variants of proposal #3 are being explored as default features in NoScript development builds since version 1.8.1.7.
September 27th, 2008 at 5:23 am
Just install noscript and noticed that
Options -> Plugins -> Forbid <IFRAME>
is unchecked ?
Is it my something that I've done during installation or your advised default to set IFRAME loose :)
September 27th, 2008 at 5:41 am
Perhaps you should create a NoBrowser extension. I'm pretty sure that would be impenetrable.
September 27th, 2008 at 6:55 am
Disabling third-party IFRAMEs (and OBJECTs?) seems like overkill compared to disabling third-party cookies.
September 27th, 2008 at 8:13 am
That's pretty sneaky with the transparent iframe, I wonder if that's all clickjacking is. Of course it breaks if you use middle click button to activate the autoscroll feature, as the iframe contents scrolls and the fake link is no longer aligned.
September 27th, 2008 at 8:17 am
Also, a pretty easy way to prevent it would be to block people with an unknown referrer HTTP header. Then the only people at risk would be those who block the referrer header.
September 27th, 2008 at 10:03 am
[...] Product Security Incident Response Team (PSIRT) Clickjacking: ¿un secreto a voces? Clickjacking Clickjacking and NoScript Tags: Click • Clickjacking • Fraude • Navegadores • Vulnerabilidad Si [...]
September 27th, 2008 at 11:02 am
@Mic:
Forbid <IFRAME> is not checked by default, as the FAQ and should be clear from my statement "You just need to enable..." and the linked video explaining how to enable it.
@Jesse Ruderman:
cookies are not the only mean to authenticate, and you can do pretty nasty thing also without "authentication", as Adobe will tell you.
RequestRodeo is a nice concept, though, even if kuza55 found some ways to abuse it, and I'm working to something similar too.
Furthermore, NoScript blocks 3rd party objects embedded on untrusted sites or originating from untrusted sites, providing an easy mean to enable them individually (click on placeholder) or as a whole (Blocked Objects menu). Even if you check Apply these restrictions to trusted sites as well, it works much like FlashBlock, but more reliably.
Finally, as I said development builds are exploring mitigation measures which don't require object blocking, such as forcing opacization of 3rd party objects or disabling clicks on obstructed/transparent embeddings.
@James:
it doesn't break if the attacker doesn't want it to break and can use JavaScript. "Blocking people with an unknown referrer HTTP header" is does not help at all here: the referrer for the nasty action is the one of the page where the legitimate trigger is placed.
September 27th, 2008 at 1:19 pm
hackademix.net » Clickjacking and NoScript
Συμπλήρωμα στο αποκάτω
September 28th, 2008 at 1:15 pm
[...] una vez habiendo visto como se explota esta vulnerabilidad, (viene a calificarla como devastadora) deja una opinión en su blog nada [...]
September 28th, 2008 at 11:57 pm
[...] de mucha especulacin, slo tenemos, como informacin destacable, la opinin de Zalewski y la del creador de NoScript (que parece no ayudar en este caso). Hay ms opiniones y noticias a lo largo y ancho de la [...]
September 29th, 2008 at 11:54 am
Giorgio: If the security option is disabled by default - it will never be enabled.
The same goes for HTTPS SECURE cookies protection.
September 29th, 2008 at 12:07 pm
@Hugo:
you're right about Forbid IFRAME, and that's why I tried to give it as much publicity as possible.
That said, current NoScript dev builds already contain specific anti-clickjacking countermeasures which work by default, no matter what you do with IFRAMEs.
Since it's a work in progress which is planned to go in a stable release by the end of this week, I'm gonna write a post with juicy technical details when this is done.
Regarding Automatic Secure Cookies Management, I'm leaving that disabled for the time being because of the Ebay debacle of its 1st version, but I can tell you current implementation (1.8.1.5 and above) is working very well (with no show-stopper side effects) for people who are testing it, therefore I'm pretty confident it can be re-enabled by default in version 1.9 or sooner.
September 29th, 2008 at 7:42 pm
[...] that researchers have dubbed "clickjacking." To understand it, start with Giorgio Maone's post, Clickjacking and NoScript. Giorgio is the author of the popular NoScript extension for Firefox. In its default configuration, [...]
September 29th, 2008 at 10:17 pm
Would it be possible to write a greasemonkey extention that could disable iframes on non-whitelisted sites, too? by, say, deleting the src attribute?
September 29th, 2008 at 10:21 pm
[...] Clickjacking and NoScript [...]
September 29th, 2008 at 10:46 pm
@Tom:
Yes, using GreaseMonkey to disable IFRAMEs would be possible, but quite unreliable and very impractical because you wouldn't have an easy mean to selectively enable them back if needed, as you have in NoScript instead (just click on their placeholders).
By the way, the NoScript Options|Plugins|Apply these restrictions to trusted sites as well is made exactly for this.
September 29th, 2008 at 11:59 pm
[...] During the past few days I’ve been repeatedly asked the same question: Is there anything that users of IE, Chrome and other browsers (who cannot use NoScript) can do to protect themselves from clickjacking? [...]
September 30th, 2008 at 2:47 pm
[...] have dubbed “clickjacking.” To understand it, start with Giorgio Maone’s post, Clickjacking and NoScript. Giorgio is the author of the popular NoScript extension for Firefox. In its default configuration, [...]
September 30th, 2008 at 5:08 pm
[...] have dubbed “clickjacking.” To understand it, start with Giorgio Maone’s post, Clickjacking and NoScript. Giorgio is the author of the popular NoScript extension for Firefox. In its default configuration, [...]
October 1st, 2008 at 1:42 am
[...] Clickjacking, clickjacking, and more clickjacking. [...]
October 1st, 2008 at 4:37 am
[...] - Clickjacking hackademix.net - Clickjacking and NoScript hackademix.net - Clickjacking and Other [...]
October 1st, 2008 at 5:52 am
[...] have dubbed “clickjacking.” To understand it, start with Giorgio Maone’s post, Clickjacking and NoScript. Giorgio is the author of the popular NoScript extension for Firefox. In its default configuration, [...]
October 1st, 2008 at 12:40 pm
[...] skilaboð eru fengið lánuð frá hackadmix.net síðunni og þar er hægt að lesa alla greinina sem fylgir þessum [...]
October 2nd, 2008 at 11:22 am
Hi Giorgio,
what do you think about this: http://www.0x000000.com/index.php?i=316 ?
October 2nd, 2008 at 11:45 am
@Paolo:
as I said here, latest NoScript development builds do not depend on frames being disabled for providing clickjacking protection. Embedded objects, including "generic incusions" through the OBJECT element are forcibly made opaque on untrusted sites, therefore you can't click them by accident.
This protection, already effective, is being improved to prevent any form of user interaction with embedded documents which are partially obstructed, i.e. Zalewski proposal #4, and will go in a stable release (1.8.2, temptatively) by the end of this week.
October 2nd, 2008 at 12:33 pm
OK, thanks for explanation
PS
sei il migliore!
October 2nd, 2008 at 12:55 pm
@Paolo:
I just published a post dealing with Ronald's finding and explaining the new specific anti-clickjacking features, you may be interested.
PS
grazie, mi fai arrossire! :)
October 2nd, 2008 at 7:58 pm
[...] Hackademix y [...]
October 2nd, 2008 at 11:55 pm
My spouse is a dye in the wool IE user, are there any protections for this application?
October 3rd, 2008 at 1:52 am
@Tom:
Your spouse is out of luck :(
October 8th, 2008 at 12:43 am
[...] you already know if you read my first clickjacking article, an old and benign clickjacking example is NoScript’s “Install Now” orange [...]
October 8th, 2008 at 11:24 pm
[...] Users of Firefox should in the meantime consider use of the NoScript plug-in and set it to forbid iframe content. More details on configuring NoScript to block this attack can be found here [...]
October 11th, 2008 at 12:21 am
[...] que he podido leer, lo mejor me ha parecido este mail de Michal Zalewsk, los artículos del web de Giorgo Maone, autor de la única vacuna conocida para navegadores Firefox (”ClearScript“) y este [...]
October 11th, 2008 at 2:02 am
[...] it to forbid IFrame content. More details on configuring NoScript to block this attack can be found here. Additional US-CERT tips for securing other browsers can be found [...]
October 11th, 2008 at 5:40 am
[...] it to forbid IFrame content. More details on configuring NoScript to block this attack can be found here. Additional US-CERT tips for securing other browsers can be found [...]
October 11th, 2008 at 10:28 am
[...] it to forbid IFrame content. More details on configuring NoScript to block this attack can be found here. Additional US-CERT tips for securing other browsers can be found here. Tags: Adobe Flash, [...]
October 12th, 2008 at 1:17 pm
[...] you already know if you read my first clickjacking article, an old and benign clickjacking example is NoScript’s “Install Now” orange button, which [...]
October 18th, 2008 at 6:15 am
[...] “Rsnake” Hansen, the co-revealer of clickjacking also recommends to set browser’s configuration to “Plugins|Forbid IFRAME” and to install NoScript [...]
October 22nd, 2008 at 5:26 am
[...] “Rsnake” Hansen, the co-revealer of clickjacking also recommends to set browser’s configuration to “Plugins|Forbid IFRAME” and to install NoScript [...]
October 31st, 2008 at 11:41 am
[...] To complicate matters, clickjacking is also a really cool, potentially effective user design tool. For an example of a benign case of clickjacking, consider the NoScript website, which uses the technique for positive ends. [...]
November 23rd, 2008 at 6:29 pm
[...] it to forbid IFrame content. More details on configuring NoScript to block this attack can be found here. Additional US-CERT tips for securing other browsers can be found [...]
April 29th, 2009 at 11:54 pm
Firefox-Addon NoScript
Ständig wird man durch Layer oder irgendwelche herumfliegenden Objekte belästigt. Man kann sich jetzt auch ganz langweilig verhalten und jegliche Scripte blocken. Das verhindert zwar einiges an Werbung, blockt aber sogar das auf JavaScript basierte A...
January 20th, 2010 at 8:54 pm
[...] also ban plugins and IFRAMEs on trusted sites as needed, says Giorgio Maone, a security expert who wrote NoScript. It basically lets the user click to enable these features on trusted sites and then [...]