draft-ietf-websec-x-frame-options-00.txt   draft-ietf-websec-x-frame-options-01.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 4, 2013 July 3, 2012 Expires: April 26, 2013 October 23, 2012
HTTP Header X-Frame-Options HTTP Header X-Frame-Options
draft-ietf-websec-x-frame-options-00 draft-ietf-websec-x-frame-options-01
Abstract Abstract
To improve the protection of web applications against Clickjacking To improve the protection of web applications against Clickjacking
this standards defines a http response header that declares a policy this standard defines an http response header that declares a policy
communicated from a host to the client browser whether the communicated from a host to the client browser on whether the browser
transmitted content MUST NOT be displayed in frames of other pages must not display the transmitted content in frames of other web
from different origins which are allowed to frame the content. This pages. This drafts serves to document the existing use and
drafts serves to document the existing use and specification of specification of X-Frame-Options.
X-Frame-Options.
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.
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 4, 2013. This Internet-Draft will expire on April 26, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2012 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 17 skipping to change at page 2, line 16
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Language . . . . . . . . . . . . . . . . . . . 3 1.1. Requirements Language . . . . . . . . . . . . . . . . . . . 3
2. X-Frame-Options Header . . . . . . . . . . . . . . . . . . . . 3 2. X-Frame-Options Header . . . . . . . . . . . . . . . . . . . . 3
2.1. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2. Backus-Naur Form (BNF) . . . . . . . . . . . . . . . . . . 4 2.2. Backus-Naur Form (BNF) . . . . . . . . . . . . . . . . . . 4
2.3. Design Issues . . . . . . . . . . . . . . . . . . . . . . . 5 2.3. Design Issues . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.1. Enable HTML content from other domains . . . . . . . . 5 2.3.1. Enable HTML content from other domains . . . . . . . . 5
2.3.2. Browser Behaviour and Processing . . . . . . . . . . . 5 2.3.2. Browser Behaviour and Processing . . . . . . . . . . . 5
2.4. Examples of X-Frame-Options Headers . . . . . . . . . . . . 5 2.4. Examples of X-Frame-Options Headers . . . . . . . . . . . . 6
2.4.1. Example scenario for the ALLOW-FROM parameter . . . . . 6 2.4.1. Example scenario for the ALLOW-FROM parameter . . . . . 6
3. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 3. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6
4.1. Registration Template . . . . . . . . . . . . . . . . . . . 7 4.1. Registration Template . . . . . . . . . . . . . . . . . . . 7
5. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 5. Security Considerations . . . . . . . . . . . . . . . . . . . . 7
6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.1. Normative References . . . . . . . . . . . . . . . . . . . 7 6.1. Normative References . . . . . . . . . . . . . . . . . . . 7
6.2. Informative References . . . . . . . . . . . . . . . . . . 7 6.2. Informative References . . . . . . . . . . . . . . . . . . 7
Appendix A. Description of a Clickjacking attack . . . . . . . . . 8 Appendix A. Description of a Clickjacking attack . . . . . . . . . 8
A.1. Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 A.1. Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
A.2. Confirm Purchase Page . . . . . . . . . . . . . . . . . . . 8 A.2. Confirm Purchase Page . . . . . . . . . . . . . . . . . . . 9
A.3. Flash Configuration . . . . . . . . . . . . . . . . . . . . 9 A.3. Flash Configuration . . . . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
In 2009 and 2010 many browser vendors introduced the use of a non- In 2009 and 2010 many browser vendors ([Microsoft-X-Frame-Options],
standard http header RFC 2616 [RFC2616] "X-Frame-Options" to protect [CLICK-DEFENSE-BLOG], [Mozilla-X-Frame-Options]) introduced the use
against Clickjacking [Clickjacking]. This draft is to document the of a non-standard http header RFC 2616 [RFC2616] "X-Frame-Options" to
current use of X-Frame-Options header and shall in the future be protect against Clickjacking [Clickjacking]. This draft is to
replaced by the Frame-Options (CSRF) [FRAME-OPTIONS] standard. document the current use of X-Frame-Options header and shall in the
future be replaced by the Frame-Options [FRAME-OPTIONS] standard.
Existing anti-ClickJacking measures, e.g. Frame-breaking Javascript, Existing anti-ClickJacking measures, e.g. Frame-breaking Javascript,
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.
The "X-Frame-Options" allows a secure web page from host B to declare The "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 of another page (e.g. from host A). In be displayed in a frame (<frame> or <iframe>) of another page (e.g.
principle this is done by a policy declared in the HTTP header and from host A). In principle this is done by a policy declared in the
obeyed by conform browser implementations. HTTP header and obeyed by conform browser implementations.
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 indicates a policy whether a The X-Frame-Options HTTP response header indicates a policy whether a
skipping to change at page 4, line 16 skipping to change at page 4, line 16
A browser receiving content with this header MUST NOT display A browser receiving content with this header MUST NOT display
this content in any frame. this content in any frame.
SAMEORIGIN SAMEORIGIN
A browser receiving content with this header MUST NOT display A browser receiving content with this header MUST NOT display
this content in any frame from a page of different origin than this content in any frame from a page of different origin than
the content itself. the content itself.
If a browser or plugin can not reliably determine whether the If a browser or plugin can not reliably determine whether the
origin of the content and the frame have the same origin, this origin of the content and the frame have the same origin, this
MUST be treated as "DENY". MUST be treated as "DENY".
[TBD]current implementations do not display if the origin of (Please note that current implementations may vary on the
the top-level-browsing-context is different than the origin of interpretation of this criteria: In some it only allows to be
the page containing the X-FRAME-OPTIONS header. framed if the origin of the top-level browsing-context is
identical, in other it compares with to the origin of the
framing page.)
ALLOW-FROM (followed by a URI of trusted origins) ALLOW-FROM (followed by a URI [RFC3986] of a trusted origin)
A browser receiving content with this header MUST NOT display A browser receiving content with this header MUST NOT display
this content in any frame from a page of different origin than this content in a frame from any page with a top-level browsing
the listed origin. While this can expose the page to risks by contex of different origin than the specified origin. While
the trusted origin, in some cases it may be necessary to use this can expose the page to risks by the trusted origin, in
content from other domains. some cases it may be necessary to allow the framing by content
For example: X-FRAME-OPTIONS: ALLOW-FROM from other domains.
For example: X-FRAME-OPTIONS: ALLOW-FROM:
https://www.domain.com/ https://www.domain.com/
The URIs listed for ALLOW-FROM must be valid. The ALLOW-FROM URI MUST be valid.
Any data beyond the domain address (i.e. any data after the "/" Any data beyond the domain address (i.e. any data after the "/"
separator) is to be ignored and to verify a referring page is of the separator) is to be ignored. And the algorithm to compare origins
same origin as the content or that the referring page is listed in from [RFC6454] SHOULD be used to verify a referring page is of the
the ALLOW-FROM list of URI, the algorithm to compare origins from same origin as the content or that the referring page's origin is
[RFC6454] should be used. identical with the ALLOW-FROM URI.
Wildcards to declare multiple domains in one statement are not Wildcards or lists to declare multiple domains in one ALLOW-FROM
permitted. statement are not permitted.
[TBD] Current Implementations do not consider the port a component of Please note that in conflict with [RFC6454], current implementations
the origin - conflicting with [RFC6454]. do not consider the port as a defining component of the origin.
2.2. Backus-Naur Form (BNF) 2.2. Backus-Naur Form (BNF)
The RFC 822 [RFC0822] EBNF of the X-Frame-Options header is: The RFC 822 [RFC0822] EBNF of the X-Frame-Options header is:
X-Frame-Options = "Frame-Options" ":" "DENY"/ "SAMEORIGIN" / X-Frame-Options = "Frame-Options" ":" "DENY"/ "SAMEORIGIN" /
("ALLOW-FROM" ":" URI) ("ALLOW-FROM" ":" URI)
[TBD] with URI as defined in the websec-origin draft With URI as defined in [RFC3986]
[TBD] Or should we use the ABNF (RFC 2234) alternatively or in [TBD] Or should we use the ABNF (RFC 2234) alternatively to EBNF or
addition? in addition?
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 three main direct vectors that enable HTML content from There are three main direct vectors that enable HTML content from
other domains: other domains:
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)
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 directive as specified in plugins MUST conform to the X-FRAME-OPTIONS directive as specified in
this draft as well. this draft as well.
2.3.2. Browser Behaviour and Processing 2.3.2. Browser Behaviour and Processing
To allow secure implementations browser implementations MUST behave To allow secure implementations, browsers MUST behave in a consistent
in a consistent and reliable way. and reliable way.
If a HTTP Header prohibits framing, the user-agent of the browser MAY If an HTTP Header prohibits framing, the user-agent of the browser
immediately abort downloading or parsing of the document. MAY immediately abort downloading or parsing of the document.
When a browser discovers loaded content with the X-FRAME-OPTIONS When a browser discovers loaded content with the X-FRAME-OPTIONS
header would be displayed in a frame against the specified origin header would be displayed in a frame against the specified origin
orders of the header, the browser SHOULD redirect as soon as possible orders of the header, the browser SHOULD redirect as soon as possible
to a "No-Frame" page. to a "No-Frame" page.
"No-Frame" Page "No-Frame" Page
If the display of content is denied by the X-FRAME-OPTIONS header an If the display of content is denied by the X-FRAME-OPTIONS header an
error page SHOULD be displayed. For example this can be a error page SHOULD be displayed. For example this can be a
noframe.html page also stating the full URL of the protected page and noframe.html page also stating the full URL of the protected page and
the hostname of the protected page. the hostname of the protected page.
The NoFrame page MAY provide the user with an option to open the The NoFrame page MAY provide the user with an option to open the
target URL in a new window. target URL in a new window.
Variation in current browser behaviour
There are currently variations in the implementation of the X-FRAME-
OPTIONS header. For example not all browsers may support the "ALLOW-
FROM" option.
And the criteria for SAMEORIGIN option is not evaluated unanimously:
one implementation may evaluate the SAMEORIGIN option based 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-context
These variations in the evaluation of the header by different
implementations impair the useage and reliability of this http
header. A revised version of frame-options [FRAME-OPTIONS] shall
unify the behaviour and replace this document in the future.
2.4. Examples of X-Frame-Options Headers 2.4. Examples of X-Frame-Options Headers
2.4.1. Example scenario for the ALLOW-FROM parameter 2.4.1. Example scenario for the ALLOW-FROM parameter
1. Inner IFRAME suggests via a querystring parameter what site it 1. Inner IFRAME suggests via a querystring parameter what site it
wants to be hosted by. This can obviously be specified by an wants to be hosted by. This can obviously be specified by an
attacker, but that's OK. attacker, but that's OK.
2. Server verifies the hostname meets whatever criteria. For 2. Server verifies the hostname meets whatever criteria. For
example, for a Facebook "Like" button, the server can check to example, for a Facebook "Like" button, the server can check to
see that the supplied hostname matches the hostname expected for see that the supplied hostname matches the hostname expected for
that Like button. that Like button.
skipping to change at page 8, line 13 skipping to change at page 8, line 13
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/>.
[FRAME-OPTIONS] [FRAME-OPTIONS]
IETF, "The Web Origin Concept", December 2010, <http:// IETF, "The Web Origin Concept", July 2012, <http://
tools.ietf.org/id/draft-gondrom-frame-options-02.txt>. tools.ietf.org/id/draft-ietf-websec-frame-options-00.txt>.
[Microsoft-X-Frame-Options]
Microsoft, "Combating ClickJacking With X-Frame-Options",
2010, <http://blogs.msdn.com/b/ieinternals/archive/2010/
03/30/combating-clickjacking-with-x-frame-options.aspx>.
[Mozilla-X-Frame-Options]
Mozilla, "The X-Frame-Options response header", 2010, <htt
ps://developer.mozilla.org/en-US/docs/
The_X-FRAME-OPTIONS_response_header>.
[RFC0822] Crocker, D., "Standard for the format of ARPA Internet [RFC0822] Crocker, D., "Standard for the format of ARPA Internet
text messages", STD 11, RFC 822, August 1982. text messages", STD 11, RFC 822, August 1982.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration
Procedures for Message Header Fields", BCP 90, RFC 3864, Procedures for Message Header Fields", BCP 90, RFC 3864,
September 2004. September 2004.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, January 2005.
[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454,
December 2011. December 2011.
Appendix A. Description of a Clickjacking attack Appendix A. Description of a Clickjacking attack
More detailed explanation of Clickjacking scenarios More detailed explanation of Clickjacking scenarios
A.1. Shop A.1. Shop
An Internet Marketplace/Shop offering a feature with a link/button to An Internet Marketplace/Shop offering a feature with a link/button to
 End of changes. 23 change blocks. 
48 lines changed or deleted 80 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/