Update

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.

This entry was posted on Saturday, September 27th, 2008 at 3:35 am and is filed under Clickjacking, Flash, Mozilla, Security, NoScript. You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.

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.

@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.

@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.

[...] 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, [...]

@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.

[...] 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? [...]

[...] 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, [...]

[...] 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, [...]

[...] 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, [...]

@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.

[...] 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 [...]

[...] 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, [...]

[...] 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. [...]

[...] 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 [...]