The Underappreciated X-Frame-Options Header

While in San Francisco last week for the 2013 RSA Conference, some of us made the trek to B-Sides to catch a few talks since we arrived a bit early. To our delight, Mike Shema was speaking about  JavaScript Security & HTML5 and we were eager to see his presentation. Mike also gave another talk at RSA about using HTML5 WebSockets securely, which was equally informative and engaging (however, I preferred the ambiance of the DNA Lounge for the first presentation).

 

Back to B-Sides. It didn’t take long for Mike to mention the HTML5 Iframe tag and the sandbox attribute. Quite a timely mention, given that we’d spent the better part of the last few months studying Cross-Frame Scripting (XFS) and Clickjacking attacks for our contribution to the HP 2012 Cyber Risk Report. Immediately following this discussion was the mention of the X-Frame-Options header and how it effectively discourages Clickjacking attacks. Where Mike stopped short, however, is answering the question we posed at the beginning of our research project, “Just how many developers are using the X-Frame-Options header?”

 

Disappointingly, even in the face of stout remediation measures such as the X-Frame-Options header, XFS continues to exist and has enabled other, more popular vulnerabilities such as Clickjacking to take root and flourish. One of the most surprising findings we uncovered throughout our research was the sheer number of websites that didn’t even attempt to set the X-Frame-Options header, which could just be because they don’t need it. Or do they?

 

As a test, we figured we’d create a simple script to passively examine top level requests for information worth protecting – so we decided to look for HTTP responses that contained password fields as an initial gauge to pages that actually had a reason to protect something sensitive. The HP 2012 Cyber Risk Report contains the details of our findings, but a quick spoiler alert will tell you that less than a tenth of a percent of our sample included proper use of the X-Frame-Options header.

 

It’s difficult to explain the grounds for why there’s such a wicked absence of websites incorporating the X-Frame-Options header.  Could it be that developers don’t understand the threat of Clickjacking or the X-Frame-Options header just hasn’t been properly evangelized enough for developers to take it seriously? Either way, the X-Frame-Options header is indeed an effective deterrent to Clickjacking, but only if it’s used!

 

One common misconception is that client-side frame-busting JavaScript takes care of XFS. While a few “frame-buster-buster” iterations went around for a few years, the HTML5 IFrame tag coupled with a sandbox attribute that neglects to specify the “allow-top-navigation” permission in its value effectively disables this protection…so it’s even more imperative to use the X-Frame-Options header now more than ever.

 

There are several helpful resources on how and why you should incorporate the X-Frame-Options response header in your applications, here are a few:

 

  1. OWASP: https://www.owasp.org/index.php/Clickjacking
  2. For IIS: http://support.microsoft.com/kb/2694329
  3. For Apache, nginx: https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
  4. Busting Frame Busting: A Study of Clickjacking Vulnerabilities on Popular Sites http://cdn.ly.tl/publications/busting-frame-busting-a-study-of-clickjacking-vulnerabilities-on-popul...
  5. X-Frame-Options IETF Draft: http://tools.ietf.org/html/draft-ietf-websec-x-frame-options-01

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Search
Showing results for 
Search instead for 
Do you mean 
About the Author


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation