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!
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:
- OWASP: https://www.owasp.org/index.php/Clickjacking
- For IIS: http://support.microsoft.com/kb/2694329
- For Apache, nginx: https://developer.mozilla.org/en-US/docs/HTTP/X-Fr
- Busting Frame Busting: A Study of Clickjacking Vulnerabilities on Popular Sites http://cdn.ly.tl/publications/busting-frame-bustin
- X-Frame-Options IETF Draft: http://tools.ietf.org/html/draft-ietf-websec-x-fra