Yesterday I published a blind analysis of the so called "Clickjacking protection" included in IE8 RC1. "Blind" because, hype aside, there was no technical documentation available, even if the feature was targeted to web developers who -- in order to protect their users -- should modify the way their pages are served.

After a while, Microsoft's David Ross sent me an email confirming that my wild guesses about IE8's approach, its scope and its limitations were indeed correct. The only information obviously missing from my "prophetic" description was the real name of the "X-I-Do-Not-Want-To-Be-Framed-Across-Domains" HTTP header to be sent before the sensible pages, and today this little mystery has been finally unveiled by Eric Lawrence on the IE Blog:

Web developers can send a HTTP response header named X-FRAME-OPTIONS with HTML pages to restrict how the page may be framed. If the X-FRAME-OPTIONS value contains the token DENY, IE8 will prevent the page from rendering if it will be contained within a frame. If the value contains the token SAMEORIGIN, IE will block rendering only if the origin of the top level-browsing-context is different than the origin of the content containing the X-FRAME-OPTIONS directive. For instance, if http://shop.example.com/confirm.asp contains a DENY directive, that page will not render in a subframe, no matter where the parent frame is located. In contrast, if the X-FRAME-OPTIONS directive contains the SAMEORIGIN token, the page may be framed by any page from the exact http://shop.example.com origin.

As I had anticipated, IE8's "clickjacking protection" is just an alternate scriptless way to perform frame busting, a well known and simple technique to prevent a page from being "framed" in another page and therefore becoming an easy UI Redressing target. Microsoft had to follow its own special path because the traditional JavaScript implementation can be easily circumvented on IE, e.g. by loading the targeted page inside an <IFRAME SECURITY=restricted> element. But the other major browsers are equally "protected" (if we can call "browser protection" something relying on the good will and education of web authors) by "standard" frame busting. Therefore, slogans like " the first browser to counter this type of threat " (James Pratt, Microsoft senior product manager) were marketspeak at its best. Furthermore, this approach is useless against Clickjacking in its original "historical" meaning, i.e. those attacks involving Flash applets and other kinds of plugin embeddings which led Robert "RSnake" Hansen and Jeremiah Grossman to invent the successful buzzword.

However in my post I had also written that having such a scriptless alternative as a cross-browser option would be nice:

I do believe that a declarative approach to control subdocument requests is an excellent idea: otherwise I wouldn't have included the SUB pseudo-method in ABE Rules Specification (pdf). Moreover, as soon as I've got some less blurry info (David Ross, I know you're listening, why don't you drop me a line?), I'll be happy to immediately implement a compatible feature in NoScript and lobby Mozilla for inclusion in Firefox 3.1.

David kindly answered

I think this would be fantastic and itâ€™s a great place to start building some bridges.

I agree, in facts I've filed an enhancement request for Firefox, and I'm already working to release a NoScript development build featuring X-FRAME-OPTIONS support: that's relatively easy, since I can hook in the work I'm already doing for the ABE module. (Update 2009-29-01: I just released NoScript 1.8.9.9 development build, featuring full experimental X-FRAME-OPTIONS compatibility support).

It's worth noticing, though, that this is just a cross-browser compatibility effort: neither Firefox nor NoScript really need this feature. Traditional JavaScript-based frame busting works fine in Firefox, giving it the same degree of (modest) "protection" as IE8. NoScript users, on the other hand, are already fully protected, because ClearClick is the one and only countermeasure which works against any type of Clickjacking (frame or embed based), no matter if web sites cooperate or not.

Speaking of NoScript, I've got a small but important correction to the otherwise excellent article Robert McMillan wrote for PC World (IDG News) yesterday:

Because clickjacking requires scripting, the attack doesn't work when NoScript is enabled.

This statement is wrong twice:

Clickjacking does not require scripting: JavaScript might make the attacker's life easier, but it's not indispensable to throw an attack. NoScript does not need scripting to be disabled in order to protect its users against Clickjacking: its exclusive ClearClick anti-Clickjacking technology works independently from script blocking.

That's why NoScript can be recommended to anyone, even to grandma who's not inclined to block JavaScript: albeit I do not encourage using NoScript's "Allow Scripts Globally" command because the default deny policy is your best first-line defense, many additional protection features such as Anti-XSS filters and ClearClick still remain active even when JavaScript is enabled, providing the safest web experience available in any browser.