draft-ietf-websec-x-frame-options-07.txt   draft-ietf-websec-x-frame-options-08.txt 
WEBSEC D. Ross WEBSEC D. Ross
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Informational T. Gondrom Intended status: Informational T. Gondrom
Expires: January 30, 2014 Thames Stanley Expires: February 12, 2014 Thames Stanley
July 29, 2013 August 11, 2013
HTTP Header Field X-Frame-Options HTTP Header Field X-Frame-Options
draft-ietf-websec-x-frame-options-07 draft-ietf-websec-x-frame-options-08
Abstract Abstract
To improve the protection of web applications against Clickjacking, To improve the protection of web applications against Clickjacking,
this specification describes the X-Frame-Options HTTP response header this definition describes the X-Frame-Options HTTP response header
field that declares a policy communicated from the server to the field that declares a policy communicated from the server to the
client browser on whether the browser may display the transmitted client browser on whether the browser may display the transmitted
content in frames that are part of other web pages. This content in frames that are part of other web pages. This
informational document serves to document the existing use and informational document serves to document the existing use and
specification of this X-Frame-Options HTTP response header field. specification of this X-Frame-Options HTTP response header field.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 37 skipping to change at page 1, line 37
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 30, 2014. This Internet-Draft will expire on February 12, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 29 skipping to change at page 2, line 29
2.3.2.1. Violation of X-Frame-Options . . . . . . . . . . 6 2.3.2.1. Violation of X-Frame-Options . . . . . . . . . . 6
2.3.2.2. Variation in current browser behaviour . . . . . 6 2.3.2.2. Variation in current browser behaviour . . . . . 6
2.3.2.3. Usage design pattern and example scenario for the 2.3.2.3. Usage design pattern and example scenario for the
ALLOW-FROM parameter . . . . . . . . . . . . . . 7 ALLOW-FROM parameter . . . . . . . . . . . . . . 7
3. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 3. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
4.1. Registration Template . . . . . . . . . . . . . . . . . . 7 4.1. Registration Template . . . . . . . . . . . . . . . . . . 7
5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8
5.1. Privacy Considreations . . . . . . . . . . . . . . . . . 8 5.1. Privacy Considreations . . . . . . . . . . . . . . . . . 8
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.1. Normative References . . . . . . . . . . . . . . . . . . 8 6.1. Normative References . . . . . . . . . . . . . . . . . . 9
6.2. Informative References . . . . . . . . . . . . . . . . . 9 6.2. Informative References . . . . . . . . . . . . . . . . . 9
Appendix A. Browsers that support X-Frame-Options . . . . . . . 10 Appendix A. Browsers that support X-Frame-Options . . . . . . . 10
Appendix B. Description of a Clickjacking attack . . . . . . . . 10 Appendix B. Description of a Clickjacking attack . . . . . . . . 10
B.1. Shop . . . . . . . . . . . . . . . . . . . . . . . . . . 10 B.1. Shop . . . . . . . . . . . . . . . . . . . . . . . . . . 11
B.2. Online Shop Confirm Purchase Page . . . . . . . . . . . . 10 B.2. Online Shop Confirm Purchase Page . . . . . . . . . . . . 11
B.3. Flash Configuration . . . . . . . . . . . . . . . . . . . 11 B.3. Flash Configuration . . . . . . . . . . . . . . . . . . . 11
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11
1. Introduction 1. Introduction
In 2009 and 2010 many browser vendors ([Microsoft-X-Frame-Options], In 2009 and 2010 many browser vendors ([Microsoft-X-Frame-Options],
[CLICK-DEFENSE-BLOG], [Mozilla-X-Frame-Options]) introduced the use [CLICK-DEFENSE-BLOG], [Mozilla-X-Frame-Options]) introduced the use
of a non-standard HTTP [RFC2616] header field "X-Frame-Options" to of a non-standard HTTP [RFC2616] header field "X-Frame-Options" to
protect against Clickjacking [Clickjacking]. HTML-based web protect against Clickjacking [Clickjacking]. HTML-based web
applications can embed or "frame" other web pages. Clickjacking is a applications can embed or "frame" other web pages. Clickjacking is a
skipping to change at page 3, line 27 skipping to change at page 3, line 27
have weaknesses so that their protection can be circumvented as a have weaknesses so that their protection can be circumvented as a
study [FRAME-BUSTING] demonstrated. study [FRAME-BUSTING] demonstrated.
Short of configuring the browser to disable frames and script Short of configuring the browser to disable frames and script
entirely, which massively impairs browser utility, browser users are entirely, which massively impairs browser utility, browser users are
vulnerable to this type of attack. vulnerable to this type of attack.
"X-Frame-Options" allows a secure web page from host B to declare "X-Frame-Options" allows a secure web page from host B to declare
that its content (for example a button, links, text, etc.) must not that its content (for example a button, links, text, etc.) must not
be displayed in a frame (<frame> or <iframe>) of another page (e.g. be displayed in a frame (<frame> or <iframe>) of another page (e.g.
from host A). In principle this is done by a policy declared in the from host A). This is done by a policy declared in the HTTP header
HTTP header and enforced by conforming browser implementations. and enforced by browser implementations as documented here.
1.1. Requirements Language 1.1. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
2. X-Frame-Options Header 2. X-Frame-Options Header
The X-Frame-Options HTTP response header field indicates a policy on The X-Frame-Options HTTP response header field indicates a policy on
skipping to change at page 5, line 41 skipping to change at page 5, line 41
X-FRAME-OPTIONS: SAMEORIGIN X-FRAME-OPTIONS: SAMEORIGIN
X-FRAME-OPTIONS: ALLOW-FROM https://example.com/ X-FRAME-OPTIONS: ALLOW-FROM https://example.com/
2.3. Design Issues 2.3. Design Issues
2.3.1. Enable HTML content from other domains 2.3.1. Enable HTML content from other domains
There are a number of main direct vectors that enable HTML content There are a number of main direct vectors that enable HTML content
from other domains: from other domains and browser implementations of X-Frame-Options
cover all of them:
o IFRAME tag o IFRAME tag
o Frame tag o Frame tag
o The Object tag (requires a redirect) o The Object tag (requires a redirect)
o Applet tag o Applet tag
o Embed tag o Embed tag
Besides these, other ways to host HTML content can be possible. For Besides these, other ways to host HTML content can be possible. For
example some plugins may host HTML views directly. If these plugins example some plugins may host HTML views directly. If these plugins
appear essentially as frames (as opposed to top-level windows), the appear essentially as frames (as opposed to top-level windows), the
plugins MUST conform to the X-FRAME-OPTIONS policy as specified in plugins must conform to the X-FRAME-OPTIONS policy as specified in
this document as well. this document as well.
2.3.2. Browser Behaviour and Processing 2.3.2. Browser Behaviour and Processing
To allow secure implementations, browsers must behave in a consistent To allow secure implementations, browsers must behave in a consistent
and reliable way. and reliable way.
If an X-Frame-Options HTTP header field prohibits framing, the user- If an X-Frame-Options HTTP header field prohibits framing, the user-
agent of the browser MAY immediately abort downloading or parsing of agent of the browser MAY immediately abort downloading or parsing of
the document. the document.
skipping to change at page 7, line 6 skipping to change at page 7, line 6
The criteria for the SAMEORIGIN option is not evaluated unanimously The criteria for the SAMEORIGIN option is not evaluated unanimously
either: one implementation may evaluate the SAMEORIGIN option based either: one implementation may evaluate the SAMEORIGIN option based
on the origin of the framed page and the framing page, while another on the origin of the framed page and the framing page, while another
may evaluate based on the framed page and the top-level browsing- may evaluate based on the framed page and the top-level browsing-
context. context.
These variations in the evaluation of the header by different These variations in the evaluation of the header by different
implementations impair the useage and reliability of this http implementations impair the useage and reliability of this http
header. A revised version of x-frame-options in the form of a frame- header. A revised version of x-frame-options in the form of a frame-
options directive in the CSP 1.1[CSP-1-1] will unify the behaviour options directive in the CSP 1.1[CSP-1-1] will unify the behaviour
and replace this document in the future. and it is expected that newer implementations will use it rather than
the mechanisms documented here"
2.3.2.3. Usage design pattern and example scenario for the ALLOW-FROM 2.3.2.3. Usage design pattern and example scenario for the ALLOW-FROM
parameter parameter
As the "ALLOW-FROM" field does support only one URI, in cases when As the "ALLOW-FROM" field only supports one URI, in cases when the
the server wishes to allow more than one resource to frame its server wishes to allow more than one resource to frame its content,
content, the following design pattern is recommended: the following design pattern can fulfil that need:
1. A page that wants to render the requested content in a frame 1. A page that wants to render the requested content in a frame
supplies its own origin information to the server providing the supplies its own origin information to the server providing the
to-be-framed content via a querystring parameter. to-be-framed content via a querystring parameter.
2. The Server verifies the hostname meets its criteria so that the 2. The Server verifies the hostname meets its criteria so that the
page can be allowed to be framed by the target resource. This page can be allowed to be framed by the target resource. This
may for example happen via a look-up of a white-list of trusted may for example happen via a look-up of a white-list of trusted
domain names that are allowed to frame the page. For example, domain names that are allowed to frame the page. For example,
for a Facebook "Like" button, the server can check to see that for a Facebook "Like" button, the server can check to see that
the supplied hostname matches the hostname(s) expected for that the supplied hostname matches the hostname(s) expected for that
"Like" button. "Like" button.
3. The server return the hostname in X-FRAME-OPTIONS: ALLOW-FROM if 3. The server returns the hostname in X-FRAME-OPTIONS: ALLOW-FROM if
the proper criteria was met in step #2. the proper criteria was met in step #2.
4. The browser enforces the X-FRAME-OPTIONS: ALLOW-FROM header. 4. The browser enforces the X-FRAME-OPTIONS: ALLOW-FROM header.
3. Acknowledgements 3. Acknowledgements
This document was derived from input from specifications published by This document was derived from input from specifications published by
various browser vendors such as Microsoft (Eric Lawrence, David various browser vendors such as Microsoft (Eric Lawrence, David
Ross), Mozilla, Google, Opera and Apple. Ross), Mozilla, Google, Opera and Apple.
4. IANA Considerations 4. IANA Considerations
This memo is a request to IANA to include the specified HTTP header This memo is a request to IANA to include the specified HTTP header
in the registry as outlined in Registration Procedures for Message in the registry as outlined in Registration Procedures for Message
Header Fields [RFC3864] Header Fields [RFC3864]
4.1. Registration Template 4.1. Registration Template
PERMANENT MESSAGE HEADER FIELD REGISTRATION TEMPLATE: PERMANENT MESSAGE HEADER FIELD REGISTRATION TEMPLATE:
Header field name: X-Frame-Option Header field name: X-Frame-Options
Applicable protocol: http [RFC2616] Applicable protocol: http [RFC2616]
Status: informational Status: informational
Author/Change controller: IETF Author/Change controller: IETF
Specification document(s): draft-ietf-websec-x-frame-options Specification document(s): draft-ietf-websec-x-frame-options
Related information: Related information:
Figure 1 Figure 1
5. Security Considerations 5. Security Considerations
The introduction of the X-FRAME-OPTIONS http header field does The introduction of the X-FRAME-OPTIONS http header field does
improve the protection against Clickjacking. However, it is not improve the protection against Clickjacking. However, it is not
self-sufficient on its own, but must be used in conjunction with self-sufficient on its own to protect against all kinds of these
other security measures like secure coding and the Content Security attack vectors. It must be used in conjunction with other security
Policy [CSP]. measures like secure coding (e.g. input validation, output encoding,
...) and the Content Security Policy [CSP].
It is important to note that current implementations do not check the It is important to note that current implementations do not check the
origins of the entire ancestor tree of frames of the framing origins of the entire ancestor tree of frames of the framing
resources, and this may expose the resource to attack in multiply- resources, and this may expose the resource to attack in multiple-
nested scenarios. For example, if a resource on origin A embeds nested scenarios. For example, if a resource on origin A embeds
untrusted content from origin B, that untrusted content can embed untrusted content from origin B, that untrusted content can embed
another resource from origin A with an X-Frame-Options: SAMEORIGIN another resource from origin A with an X-Frame-Options: SAMEORIGIN
policy and that check would pass if the user agent only verifies the policy and that check would pass if the user agent only verifies the
top-level browsing context. top-level browsing context. Therefore web developers should be aware
that embedding content from other sites can leave their web pages
vulnerable to clickjacking even if the X-Frame-Options header is
used.
Furthermore, X-Frame-Options must be sent as an HTTP header field and Furthermore, X-Frame-Options must be sent as an HTTP header field and
is explicitly ignored by user agents when declared with a meta http- is explicitly ignored by user agents when declared with a meta http-
equiv tag. equiv tag.
5.1. Privacy Considreations 5.1. Privacy Considreations
The parameter ALLOW-FROM allows a page to guess who is framing it. The parameter ALLOW-FROM allows a page to guess who is framing it.
This is inherent by design, but may lead to data leakage or data This is inherent by design, but may lead to data leakage or data
protection concerns. protection concerns.
skipping to change at page 9, line 30 skipping to change at page 9, line 38
<http://www.w3.org/TR/2013/WD-CSP11-20130604/>. <http://www.w3.org/TR/2013/WD-CSP11-20130604/>.
Latest version available at Latest version available at
[CSP] Sterne, B. and A. Barth, "Content Security Policy 1.0", [CSP] Sterne, B. and A. Barth, "Content Security Policy 1.0",
W3C Candidate Recommendation CR-CSP-20121115, November W3C Candidate Recommendation CR-CSP-20121115, November
2012, <http://www.w3.org/TR/2012/CR-CSP-20121115/>. 2012, <http://www.w3.org/TR/2012/CR-CSP-20121115/>.
Latest version available at Latest version available at
[CSRF] OWASP (Open Web Application Security Project), "OWASP
Top-10: Cross-Site Request Forgery (CSRF)", 2010, <https:/
/www.owasp.org/index.php/Top_10_2013-A8-Cross-
Site_Request_Forgery_%28CSRF%29>.
[Clickjacking] [Clickjacking]
OWASP (Open Web Application Security Project), OWASP (Open Web Application Security Project),
"Clickjacking", 2010, "Clickjacking", 2010,
<http://www.owasp.org/index.php/Clickjacking>. <http://www.owasp.org/index.php/Clickjacking>.
[FRAME-BUSTING] [FRAME-BUSTING]
Stanford Web Security Research, "Busting frame busting: a Stanford Web Security Research, "Busting frame busting: a
study of clickjacking vulnerabilities at popular sites", study of clickjacking vulnerabilities at popular sites",
2010, <http://seclab.stanford.edu/websec/framebusting/>. 2010, <http://seclab.stanford.edu/websec/framebusting/>.
skipping to change at page 11, line 4 skipping to change at page 11, line 21
IFRAMES into their pages. There is a possible Clickjacking threat IFRAMES into their pages. There is a possible Clickjacking threat
here, which is why the marketplace/onlineshop needs to then here, which is why the marketplace/onlineshop needs to then
immediately navigate the main browsing context (or a new window) to a immediately navigate the main browsing context (or a new window) to a
confirmation page which is protected by anti-Clickjacking confirmation page which is protected by anti-Clickjacking
protections. protections.
B.2. Online Shop Confirm Purchase Page B.2. Online Shop Confirm Purchase Page
The "Confirm Purchase"" page of an online shop must be shown to the The "Confirm Purchase"" page of an online shop must be shown to the
end user without the risk of an overlay or misuse by an attacker. end user without the risk of an overlay or misuse by an attacker.
For that reason, the confirmation page uses a combination of anti- For that reason, the confirmation page uses a combination of anti-
CSRF tokens and the X-FRAME-OPTIONS HTTP header field, mitigating CSRF (Cross Site Request Forgery, [CSRF]) tokens and the X-FRAME-
ClickJacking attacks. OPTIONS HTTP header field, mitigating ClickJacking attacks.
B.3. Flash Configuration B.3. Flash Configuration
Macromedia Flash configuration settings are set by a Flash object Macromedia Flash configuration settings are set by a Flash object
which can run only from a specific configuration page on Macromedia's which can run only from a specific configuration page on Macromedia's
site. The object runs inside the page and thus can be subject to a site. The object runs inside the page and thus can be subject to a
ClickJacking attack. In order to prevent ClickJacking attacks ClickJacking attack. In order to prevent ClickJacking attacks
against the security settings, the configuration page uses the X against the security settings, the configuration page uses the X
-FRAME-OPTIONS directive. -FRAME-OPTIONS directive.
 End of changes. 19 change blocks. 
26 lines changed or deleted 36 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/