[要約] RFC 7034は、HTTPヘッダーフィールドX-Frame-Optionsの目的と要約を提供します。このヘッダーフィールドは、クリックジャッキング攻撃を防ぐために使用され、フレーム内でのコンテンツの表示を制御します。
Internet Engineering Task Force (IETF) D. Ross
Request for Comments: 7034 Microsoft
Category: Informational T. Gondrom
ISSN: 2070-1721 Thames Stanley
October 2013
HTTP Header Field X-Frame-Options
HTTPヘッダーフィールドX-Frame-Options
Abstract
概要
To improve the protection of web applications against clickjacking, this document describes the X-Frame-Options HTTP header field, which declares a policy, communicated from the server to the client browser, regarding whether the browser may display the transmitted content in frames that are part of other web pages.
クリックジャッキングに対するWebアプリケーションの保護を改善するために、このドキュメントでは、他のWebページの一部であるフレーム内に、ブラウザが送信されたコンテンツを表示してもよいかどうかに関して、サーバーからクライアントブラウザに伝達されるポリシーを宣言するX-Frame-Options HTTPヘッダーフィールドについて説明します。
Status of This Memo
本文書の状態
This document is not an Internet Standards Track specification; it is published for informational purposes.
このドキュメントはInternet Standards Trackの仕様ではありません。情報提供を目的として公開されています。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are a candidate for any level of Internet Standard; see Section 2 of RFC 5741.
このドキュメントは、Internet Engineering Task Force(IETF)の成果物です。これは、IETFコミュニティの合意を表しています。公開レビューを受け、Internet Engineering Steering Group(IESG)による公開が承認されました。IESGによって承認されたすべてのドキュメントが、あらゆるレベルのインターネット標準の候補になるわけではありません。RFC 5741のセクション2をご覧ください。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7034.
このドキュメントの現在のステータス、正誤表(エラッタ)、およびフィードバックの提供方法に関する情報は、http://www.rfc-editor.org/info/rfc7034で入手できます。
Copyright Notice
著作権表示
Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.
Copyright(c)2013 IETF Trustおよびドキュメントの作成者として識別された人物。全著作権所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
この文書は、BCP 78およびこの文書の発行日に有効なIETF文書に関するIETFトラストの法的規定(http://trustee.ietf.org/license-info)の対象となります。これらのドキュメントは、このドキュメントに関するあなたの権利と制限を説明しているため、注意深く確認してください。このドキュメントから抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。
Table of Contents
目次
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3
2. X-Frame-Options Header . . . . . . . . . . . . . . . . . . . . 4
2.1. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2. Augmented Backus-Naur Form (ABNF) . . . . . . . . . . . . 5
2.2.1. Examples of X-Frame-Options . . . . . . . . . . . . . 6
2.3. Design Issues . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1. Enable HTML Content from Other Domains . . . . . . . . 6
2.3.2. Browser Behavior and Processing . . . . . . . . . . . 6
2.3.2.1. Violation of X-Frame-Options . . . . . . . . . . . 6
2.3.2.2. Variation in Current Browser Behavior . . . . . . 7
2.3.2.3. Usage Design Pattern and Example Scenario for
the ALLOW-FROM Parameter . . . . . . . . . . . . . 8
2.3.2.4. No Caching of the X-Frame-Options Header . . . . . 8
3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
3.1. Registration Template . . . . . . . . . . . . . . . . . . 9
4. Security Considerations . . . . . . . . . . . . . . . . . . . 9
4.1. Privacy Considerations . . . . . . . . . . . . . . . . . . 10
5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.1. Normative References . . . . . . . . . . . . . . . . . . . 10
5.2. Informative References . . . . . . . . . . . . . . . . . . 11
Appendix A. Browsers That Support X-Frame-Options . . . . . . . . 13
Appendix B. Description of a Clickjacking Attack . . . . . . . . 13
B.1. Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
B.2. Online Shop Confirm Purchase Page . . . . . . . . . . . . 13
B.3. Flash Configuration . . . . . . . . . . . . . . . . . . . 13
Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 13
In 2009 and 2010, many browser vendors ([Microsoft-X-Frame-Options], [CLICK-DEFENSE-BLOG], and [Mozilla-X-Frame-Options]) introduced the use of a non-standard HTTP [RFC2616] header field "X-Frame-Options" to protect against clickjacking [Clickjacking]. HTML-based web applications can embed or "frame" other web pages. Clickjacking is a type of attack that occurs when an attacker uses multiple transparent or opaque layers in the user interface to trick a user into clicking on a button or link on another page from server B when they were intending to click on the same place of the overlaying page from server A. Thus, the attacker is "hijacking" clicks meant for page A and routing them to page B. The attacker is tricking the user (who sees the overlaying user interface content from page A) into clicking specific locations on the underlying page from server B, triggering some actions on server B and potentially using an existing session context in that step. This is an attack on both the user and on server B. In addition, server A may or may not be the attacker.
2009年と2010年に、多くのブラウザベンダー([Microsoft-X-Frame-Options]、[CLICK-DEFENSE-BLOG]、および[Mozilla-X-Frame-Options])が、クリックジャッキング[Clickjacking]から保護するために、非標準のHTTP [RFC2616]ヘッダーフィールド「X-Frame-Options」の使用を導入しました。HTMLベースのWebアプリケーションは、他のWebページを埋め込んだり、「フレーム化」したりできます。クリックジャッキングは、攻撃者がユーザーインターフェイスで複数の透明または不透明のレイヤーを使用して、ユーザーがサーバーAのオーバーレイページ上の同じ場所をクリックするつもりであるのに、サーバーBの別のページのボタンまたはリンクをクリックするように仕向けるときに発生する攻撃の一種です。したがって、攻撃者はページA向けのクリックを「ハイジャック」し、それらをページBにルーティングします。攻撃者はユーザー(ページAのオーバーレイUIコンテンツを見ている)をだまして、サーバーBの基になるページの特定の場所をクリックさせ、サーバーBでのアクションをトリガーし、そのステップで既存のセッションコンテキストを使用する可能性があります。これは、ユーザーとサーバーBの両方に対する攻撃です。さらに、サーバーAが攻撃者である場合とそうでない場合があります。
This specification provides informational documentation about the current use and definition of the X-Frame-Options HTTP header field. As described in Section 2.3.2.2, not all browsers implement X-Frame-Options in exactly the same way, which can lead to unintended results. And, given that the "X-" construction is deprecated [RFC6648], the X-Frame-Options header field will be replaced in the future by the Frame-Options directive in the Content Security Policy (CSP) version 1.1 [CSP-1-1].
この仕様は、X-Frame-Options HTTPヘッダーフィールドの現在の使用法と定義に関する情報を提供します。セクション2.3.2.2で説明したように、すべてのブラウザがX-Frame-Optionsをまったく同じ方法で実装するわけではないため、意図しない結果になる可能性があります。また、「X-」構文は非推奨[RFC6648]であることから、X-Frame-Optionsヘッダーフィールドは、将来的にContent Security Policy(CSP)バージョン1.1 [CSP-1-1]のFrame-Optionsディレクティブに置き換えられる予定です。
A study [FRAME-BUSTING] demonstrated that existing anti-clickjacking measures, e.g., frame-breaking JavaScript, have weaknesses that allow their protection to be circumvented.
調査[FRAME-BUSTING]は、既存のクリックジャッキング対策(フレームバスティングJavaScriptなど)には、保護を回避できる弱点があることを示しています。
Short of configuring the browser to disable frames and scripts entirely, which massively impairs browser utility, browser users are vulnerable to this type of attack.
ブラウザの利便性を大幅に損なうことになりますが、フレームとスクリプトを完全に無効にするようにブラウザを設定しない限り、ブラウザユーザーはこのタイプの攻撃に対して脆弱です。
The use of "X-Frame-Options" allows a web page from host B to declare 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., from host A). This is done by a policy declared in the HTTP header and enforced by browser implementations as documented here.
「X-Frame-Options」を使用すると、ホストBからのWebページで、そのコンテンツ(ボタン、リンク、テキストなど)を別のページ(例えば、ホストAからのページ)のフレーム(<frame>または<iframe>)に表示してはならないことを宣言できます。これは、HTTPヘッダーで宣言されたポリシーによって行われ、ここに記載されているようにブラウザ実装によって強制されます。
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
このドキュメントのキーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「MAY」、および「OPTIONAL」は、 RFC 2119 [RFC2119]で説明されているように解釈されます。
The X-Frame-Options HTTP header field indicates a policy that specifies whether the browser should render the transmitted resource within a <frame> or an <iframe>. Servers can declare this policy in the header of their HTTP responses to prevent clickjacking attacks, which ensures that their content is not embedded into other pages or frames.
X-Frame-Options HTTPヘッダーフィールドは、ブラウザーが送信されたリソースを<frame>または<iframe>内でレンダリングするかどうかを指定するポリシーを示します。サーバーは、HTTP応答のヘッダーでこのポリシーを宣言して、クリックジャッキング攻撃を防ぐことができます。これにより、コンテンツが他のページまたはフレームに埋め込まれないことが保証されます。
The header field name is:
ヘッダーフィールド名は次のとおりです。
X-Frame-Options
X-Frame-Options
There are three different values for the header field. These values are mutually exclusive; that is, the header field MUST be set to exactly one of the three values.
ヘッダーフィールドには3つの異なる値があります。これらの値は相互に排他的です。つまり、ヘッダーフィールドはこれら3つの値のいずれか1つに設定する必要があります(MUST)。
DENY A browser receiving content with this header field MUST NOT display this content in any frame.
DENY このヘッダーフィールドを持つコンテンツを受信するブラウザは、このコンテンツをいかなるフレームにも表示してはなりません(MUST NOT)。
SAMEORIGIN A browser receiving content with this header field MUST NOT display this content in any frame from a page of different origin than the content itself.
SAMEORIGIN このヘッダーフィールドを持つコンテンツを受信するブラウザは、コンテンツ自体とは異なるオリジンのページからのいかなるフレームにもこのコンテンツを表示してはなりません(MUST NOT)。
If a browser or plugin cannot reliably determine whether or not the origin of the content and the frame are the same, this MUST be treated as "DENY".
ブラウザまたはプラグインがコンテンツのオリジンとフレームのオリジンが同じであるかどうかを確実に判断できない場合、これは "DENY" として扱われなければなりません(MUST)。
Please note that current implementations vary on the interpretation of this criteria. In some, it only allows a page to be framed if the origin of the top-level browsing context is identical to the origin of the content using the X-Frame-Options directive; in others, it may consider the origin of the framing page instead. Also see Section 2.3.2.2 for more details on the nesting of frames and variations in the handling of this header field by different browsers. In addition, refer to Section 4, paragraph 2 for the resulting potential security problems.
現在の実装では、この基準の解釈が異なることに注意してください。ある実装では、トップレベルのブラウジングコンテキストのオリジンが、X-Frame-Optionsディレクティブを使用しているコンテンツのオリジンと同一である場合にのみ、ページのフレーム化を許可します。他の実装では、代わりにフレーミングページのオリジンを考慮する場合があります。フレームのネストの詳細と、異なるブラウザによるこのヘッダーフィールドの処理のばらつきについては、セクション2.3.2.2も参照してください。さらに、結果として生じる潜在的なセキュリティ上の問題については、セクション4の第2段落を参照してください。
ALLOW-FROM (followed by a serialized-origin [RFC6454]) A browser receiving content with this header MUST NOT display this content in a frame from any page with a top-level browsing context of different origin than the specified origin. While this can expose the page to risks by the trusted origin, in some cases, it may be necessary to allow the framing by content from other domains.
ALLOW-FROM(その後にserialized-origin [RFC6454]が続く) このヘッダーを持つコンテンツを受信するブラウザは、指定されたオリジンとは異なるオリジンのトップレベルのブラウジングコンテキストを持つページのフレームに、このコンテンツを表示してはなりません(MUST NOT)。これにより、信頼されたオリジンによるリスクにページをさらす可能性がありますが、場合によっては、他のドメインからのコンテンツによるフレーミングを許可する必要があります。
The meaning of the term "serialized-origin" is given in [RFC6454]. If the ALLOW-FROM value is used, it MUST be followed by a valid origin [RFC6454] (as a subset of the URI [RFC3986]).
「serialized-origin」という用語の意味は[RFC6454]で定義されています。ALLOW-FROM値が使用される場合、有効なオリジン[RFC6454]が後に続く必要があります(URI [RFC3986]のサブセットとして)。
Any data beyond the domain address (i.e., any data after the "/" separator) is to be ignored. The algorithm to compare origins from [RFC6454] SHOULD be used to verify that a referring page is of the same origin as the content (in the case of SAMEORIGIN) or that the referring page's origin is identical with the ALLOW-FROM serialized-origin (in the case of ALLOW-FROM). Though in conflict with [RFC6454], current implementations do not consider the port as a defining component of the origin; i.e., existing implementations differ with [RFC6454] in that origins with the same protocol but different port values are considered equivalent.
ドメインアドレスを超えるデータ(つまり、「/」区切り記号の後のデータ)は無視されます。[RFC6454]のオリジンを比較するアルゴリズムを使用して、参照ページがコンテンツと同じオリジンであること(SAMEORIGINの場合)、または参照ページのオリジンがALLOW-FROMのserialized-originと同一であること(ALLOW-FROMの場合)を確認する必要があります(SHOULD)。[RFC6454]と矛盾しますが、現在の実装では、ポートをオリジンの定義要素と見なしていません。つまり、同じプロトコルであってもポート値が異なるオリジンは同等と見なされるという点で、既存の実装は[RFC6454]と異なります。
Wildcards or lists to declare multiple domains in one ALLOW-FROM statement are not permitted (see Section 2.3.2.3).
1つのALLOW-FROMステートメントで複数のドメインを宣言するためのワイルドカードまたはリストは許可されません(セクション2.3.2.3を参照)。
The RFC 5234 [RFC5234] ABNF of the X-Frame-Options header field value is the following:
X-Frame-Optionsヘッダーフィールド値のRFC 5234 [RFC5234] ABNFは次のとおりです。
X-Frame-Options = "DENY" / "SAMEORIGIN" / ( "ALLOW-FROM" RWS SERIALIZED-ORIGIN )
X-Frame-Options = "DENY" / "SAMEORIGIN" / ( "ALLOW-FROM" RWS SERIALIZED-ORIGIN )
RWS = 1*( SP / HTAB )
; required whitespace
with serialized-origin as defined in [RFC6454] and required whitespace (RWS) as defined in [HTTPbis-P1].
ここで、serialized-originは[RFC6454]で定義されており、必須の空白(RWS)は[HTTPbis-P1]で定義されています。
RWS is used when at least one linear whitespace octet is required to separate field tokens. RWS SHOULD be generated as a single space (SP). Multiple RWS octets that occur within field-content SHOULD either be replaced with a SP or transformed to all SP octets before interpreting the field value or forwarding the message downstream.
RWSは、フィールドトークンを分離するために少なくとも1つの線形空白オクテットが必要な場合に使用されます。RWSはシングルスペース(SP)として生成する必要があります(SHOULD)。フィールドコンテンツ内で発生する複数のRWSオクテットは、フィールド値を解釈するか、メッセージをダウンストリームに転送する前に、SPで置き換えるか、すべてのSPオクテットに変換する必要があります(SHOULD)。
SP and horizontal tab (HTAB) are as defined in Appendix B.1 of RFC 5234 [RFC5234].
SPと水平タブ(HTAB)は、RFC 5234 [RFC5234]の付録B.1で定義されています。
The values are specified as ABNF strings; therefore, they are case-insensitive.
値はABNF文字列として指定されます。したがって、大文字と小文字は区別されません。
X-Frame-Options: DENY
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https://example.com/
There are a number of main direct vectors that enable HTML content from other domains, and browser implementations of X-Frame-Options cover all of them:
他のドメインからのHTMLコンテンツを可能にする主要な直接的ベクタがいくつかあり、X-Frame-Optionsのブラウザ実装はそれらすべてをカバーしています。
o IFRAME tag
o IFRAMEタグ
o Frame tag
o フレームタグ
o Object tag (requires a redirect)
o オブジェクトタグ(リダイレクトが必要)
o Applet tag
o アプレットタグ
o Embed tag
o Embedタグ
Besides these, other ways to host HTML content can be possible. For example, some plugins may host HTML views directly. If these plugins appear essentially as frames (as opposed to top-level windows), the plugins must conform to the X-Frame-Options policy as specified in this document as well.
これらに加えて、HTMLコンテンツをホストする他の方法も可能です。たとえば、一部のプラグインはHTMLビューを直接ホストする場合があります。これらのプラグインが(トップレベルウィンドウではなく)基本的にフレームとして表示される場合、プラグインは、このドキュメントで指定されているX-Frame-Optionsポリシーにも準拠している必要があります。
To allow secure implementations, browsers must behave in a consistent and reliable way.
安全な実装を可能にするために、ブラウザは一貫した信頼できる方法で動作する必要があります。
If an X-Frame-Options HTTP header field prohibits framing, the user agent of the browser MAY immediately abort downloading or parsing of the document.
X-Frame-Options HTTPヘッダーフィールドがフレーミングを禁止している場合、ブラウザのユーザーエージェントは、ドキュメントのダウンロードまたは解析をただちに中止してもよい(MAY)。
When a browser discovers that loaded content with the X-Frame-Options header field would be displayed in a frame against the specified orders of the header, the browser SHOULD redirect to a "NOFRAME" page as soon as possible. For example, this can be a noframe.html page that also states the full URL and hostname of the protected page.
X-Frame-Optionsヘッダーフィールドを含むロードされたコンテンツが、ヘッダーの指定された指示に反してフレームに表示されることをブラウザーが検出した場合、ブラウザーはできるだけ早く「NOFRAME」ページにリダイレクトする必要があります(SHOULD)。たとえば、これは、保護されたページの完全なURLとホスト名も示すnoframe.htmlページにすることができます。
The NOFRAME page could provide the user with an option to open the target URL in a new window.
NOFRAMEページでは、ターゲットURLを新しいウィンドウで開くオプションをユーザーに提供できます。
Implementations of this vary: some browsers will show a message that allows the user to safely open the target page in a new window, whereas other implementations will simply render an empty frame.
この実装はさまざまです。ブラウザによっては、ユーザーがターゲットページを安全に新しいウィンドウで開くことができるようにするメッセージを表示しますが、他の実装では、空のフレームをレンダリングするだけです。
There are currently variations in the implementation of the X-Frame-Options header. For example, not all browsers support the "ALLOW-FROM" option. "ALLOW-FROM" was initially an Internet Explorer extension and, at the time of writing, has not been uniformly implemented by other user agents.
現在、X-Frame-Optionsヘッダーの実装にはバリエーションがあります。たとえば、すべてのブラウザが「ALLOW-FROM」オプションをサポートしているわけではありません。「ALLOW-FROM」は、当初はInternet Explorerの拡張機能であり、執筆時点では他のユーザーエージェントによって均一に実装されていません。
Furthermore, the criteria for the SAMEORIGIN (and ALLOW-FROM) directive may not be evaluated unanimously either: the known implementations in Appendix A evaluate the SAMEORIGIN directive based on the origin of the framed page and the top-level browsing context, while other implementations might evaluate it based on the framed page and the framing page, or the whole chain of nested frames in between.
さらに、SAMEORIGIN(およびALLOW-FROM)ディレクティブの基準も一律に評価されない場合があります。付録Aの既知の実装は、フレーム化されたページのオリジンとトップレベルのブラウジングコンテキストに基づいてSAMEORIGINディレクティブを評価しますが、他の実装では、フレーム化されたページとフレーミングページ、またはその間のネストされたフレームのチェーン全体に基づいて評価する場合があります。
To illustrate the difference between the comparison of the "framing page" and the "top-level browsing context", consider the following scenario: web pages may embed frames with other pages that, in turn, embed frames with other pages as well, and so on. In theory, this can result in an infinite nesting of framed pages. For example, web page A may contain web page B in a frame, and web page B may contain web page C in a frame.
「フレーミングページ」と「トップレベルのブラウジングコンテキスト」の比較の違いを説明するために、次のシナリオを検討してください。Webページが他のページを含むフレームを埋め込み、そのページがさらに他のページを含むフレームを埋め込む、といった具合です。理論的には、これによりフレーム化されたページが無限にネストされる可能性があります。例えば、WebページAはフレームにWebページBを含み、WebページBはフレームにWebページCを含む場合があります。
Web page A
<html>
....
<frame src="https://URI_of_web_page_B" />
</html>
Web page B
<html>
....
<frame src="https://URI_of_web_page_C" />
</html>
and so forth.
以下同様です。
In this example, for the nested frames with the inner-framed web page C, the most outer web page A would be the "top-level browsing context", and web page B would be the "framing page".
この例では、内側のフレームのWebページCを持つネストされたフレームの場合、最も外側のWebページAが「トップレベルのブラウジングコンテキスト」になり、WebページBが「フレーミングページ」になります。
These potential variations in the evaluation of the header by different implementations impair the usage and reliability of this HTTP header and have security implications as described in Section 4. A revised version of X-Frame-Options in the form of a Frame-Options directive in CSP 1.1 [CSP-1-1] will unify the behavior, and it is expected that newer implementations will use it rather than the mechanisms documented here.
さまざまな実装によるヘッダーの評価におけるこれらの潜在的なばらつきは、このHTTPヘッダーの使用と信頼性を損ない、セクション4で説明されているようにセキュリティに影響を及ぼします。CSP 1.1 [CSP-1-1]におけるFrame-Optionsディレクティブという形式でのX-Frame-Optionsの改訂版は、動作を統一するものであり、新しい実装では、ここで説明されているメカニズムではなく、それを使用することが期待されています。
2.3.2.3. Usage Design Pattern and Example Scenario for the ALLOW-FROM Parameter
2.3.2.3. ALLOW-FROMパラメータの使用設計パターンとシナリオ例
As the "ALLOW-FROM" field only supports one serialized-origin, in cases when the server wishes to allow more than one resource to frame its content, the following design pattern can fulfill that need:
「ALLOW-FROM」フィールドは1つのserialized-originのみをサポートするため、サーバーが複数のリソースにコンテンツのフレーミングを許可する場合は、次の設計パターンでそのニーズを満たすことができます。
1. A page that wants to render the requested content in a frame supplies its own origin information to the server providing the content to be framed via a query string parameter.
1. 要求されたコンテンツをフレームにレンダリングしたいページは、クエリ文字列パラメーターを介してフレーム化されるコンテンツを提供するサーバーに独自のオリジン情報を提供します。
2. The server verifies that the hostname meets its criteria, so that the page is allowed to be framed by the target resource. This may, for example, happen via a lookup of a whitelist of trusted domain names that are allowed to frame the page. For example, for a Facebook "Like" button, the server can check to see that the supplied hostname matches the hostname(s) expected for that "Like" button.
2. サーバーはホスト名が基準を満たしていることを確認し、そのページがターゲットリソースによってフレーム化されることを許可します。これは、たとえば、ページのフレーム化が許可されている信頼できるドメイン名のホワイトリストの照合によって行われる場合があります。たとえば、Facebookの「いいね」ボタンの場合、サーバーは、指定されたホスト名がその「いいね」ボタンに対して想定されているホスト名と一致することを確認できます。
3. The server returns the hostname in "X-Frame-Options: ALLOW-FROM" if the proper criteria was met in step #2.
3. 手順2で適切な条件が満たされた場合、サーバーは「X-Frame-Options: ALLOW-FROM」でホスト名を返します。
4. The browser enforces the "X-Frame-Options: ALLOW-FROM" header.
4. ブラウザは「X-Frame-Options: ALLOW-FROM」ヘッダーを強制します。
Caching the X-Frame-Options header for a resource is not recommended. Caching the X-Frame-Options response could result in problems because:
リソースのX-Frame-Optionsヘッダーをキャッシュすることはお勧めしません。X-Frame-Options応答をキャッシュすると、次の理由により問題が発生する可能性があります。
1. For every http-request of the resource, the browser has to check whether the X-Frame-Options header has been set and then act accordingly, as a resource itself might be created dynamically and the header could change with it, too.
1. リソースのすべてのhttpリクエストに対して、ブラウザはX-Frame-Optionsヘッダーが設定されているかどうかを確認し、それに応じて動作する必要があります。リソース自体が動的に作成され、ヘッダーもそれに応じて変化する可能性があるためです。
2. Also, as outlined in Section 2.3.2.3, servers may generate X-Frame-Options header responses depending on the request. Example case: Considering that we have only one serialized-origin in the ALLOW-FROM directive, imagine a user has multiple pages open in his browser tabs with web page 1 from domain A and web page 2 from domain B, and both frame the same page from domain C with the ALLOW-FROM directive. In that case, the page needs to reply to both requests with different X-Frame-Options headers, with the first pointing to origin A and the second pointing to origin B.
2. また、セクション2.3.2.3で概説されているように、サーバーはリクエストに応じてX-Frame-Optionsヘッダー応答を生成する場合があります。例:ALLOW-FROMディレクティブには1つのserialized-originしか指定できないことを考慮してください。ユーザーがブラウザのタブで複数のページを開いており、ドメインAのWebページ1とドメインBのWebページ2があり、両方がALLOW-FROMディレクティブを使用するドメインCの同じページをフレーム化していると想像してください。その場合、ページは異なるX-Frame-Optionsヘッダーを使用して両方のリクエストに応答する必要があり、1つ目はオリジンAを指定し、2つ目はオリジンBを指定します。
However, we found that none of the major browsers listed in Appendix A cache the responses.
ただし、付録Aに記載されている主要なブラウザのいずれも応答をキャッシュしないことがわかりました。
IANA has included the specified HTTP header in the "Permanent Message Header Field Name" registry as outlined in "Registration Procedures for Message Header Fields" [RFC3864].
「メッセージヘッダーフィールドの登録手順」[RFC3864]で説明されているように、IANAは指定されたHTTPヘッダーを「Permanent Message Header Field Name」レジストリに含めました。
Permanent Message Header Field Names Template:
恒久的なメッセージヘッダーフィールド名テンプレート:
Header field name: X-Frame-Options
ヘッダーフィールド名:X-Frame-Options
Applicable protocol: http [RFC2616]
該当するプロトコル:http [RFC2616]
Status: Informational
ステータス:情報提供
Author/change controller: IETF
作成者/変更コントローラ:IETF
Specification document(s): RFC 7034
仕様書:RFC 7034
Related information: None
関連情報:なし
The introduction of the X-Frame-Options HTTP header field improves the protection against clickjacking. However, it is not self-sufficient enough to protect against all kinds of these attack vectors. It must be used in conjunction with other security measures like secure coding (e.g., input validation, output encoding, etc.) and the Content Security Policy version 1.0 [CSP].
X-Frame-Options HTTPヘッダーフィールドの導入により、クリックジャッキングに対する保護が向上します。ただし、これらすべての種類の攻撃ベクタから保護するには、これ単独では不十分です。安全なコーディング(入力検証、出力エンコーディングなど)やContent Security Policyバージョン1.0 [CSP]などの他のセキュリティ対策と組み合わせて使用する必要があります。
It is important to note that current implementations do not check the origins of the framing resources' entire ancestor tree of frames, and this may expose the resource to attack in multiple-nested scenarios.
現在の実装では、フレーミングリソースのフレームの祖先ツリー全体のオリジンをチェックしないことに注意することが重要です。これにより、多重ネストされたシナリオでリソースが攻撃にさらされる可能性があります。
The browser implementations evaluate based on the origin of the framed page and the top-level browsing context (i.e., the most outer frame): If a resource from origin A embeds untrusted content from origin B, that untrusted content can embed another resource from origin A with an "X-Frame-Options: SAMEORIGIN" policy, and that check would pass when the user agent only verifies the 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.
ブラウザの実装は、フレーム化されたページのオリジンとトップレベルのブラウジングコンテキスト(つまり、最も外側のフレーム)に基づいて評価します。オリジンAのリソースがオリジンBの信頼できないコンテンツを埋め込む場合、その信頼できないコンテンツは、「X-Frame-Options: SAMEORIGIN」ポリシーを持つオリジンAの別のリソースを埋め込むことができ、ユーザーエージェントがトップレベルのブラウジングコンテキストのみを検証する場合、そのチェックは通過してしまいます。したがって、Web開発者は、X-Frame-Optionsヘッダーが使用されている場合でも、他のサイトからのコンテンツを埋め込むと、Webページがクリックジャッキングに対して脆弱になる可能性があることに注意する必要があります。
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-equiv tag.
さらに、X-Frame-OptionsはHTTPヘッダーフィールドとして送信する必要があり、meta http-equivタグで宣言されている場合、ユーザーエージェントによって明示的に無視されます。
There are two kinds of potential data leakage to consider:
考慮すべき潜在的なデータ漏洩には2種類あります。
1. Using X-Frame-Options with the parameter ALLOW-FROM allows a page to guess or infer information about who is framing it. A web server may answer requests with the "X-Frame-Options: ALLOW-FROM" header and thus determine which other page is framing it. This is inherent by design, but it may lead to data-leakage or data-protection concerns.
1. パラメータALLOW-FROMを指定してX-Frame-Optionsを使用すると、誰がそれをフレーム化しているかに関する情報をページが推測または推論できるようになります。Webサーバーは、「X-Frame-Options: ALLOW-FROM」ヘッダーを使用してリクエストに応答することで、他のどのページがそれをフレーム化しているかを判別できます。これは設計上固有のものですが、データ漏洩またはデータ保護の懸念につながる可能性があります。
2. The web server using the ALLOW-FROM directive effectively discloses the origin specified in the header. If a web server wishes to reduce this leakage, it is recommended to generate the ALLOW-FROM header for each request based on the design pattern as described in Section 2.3.2.3.
2. ALLOW-FROMディレクティブを使用するWebサーバーは、ヘッダーで指定されたオリジンを事実上公開することになります。Webサーバーがこの漏洩を減らしたい場合は、セクション2.3.2.3で説明されているように、設計パターンに基づいて各リクエストのALLOW-FROMヘッダーを生成することが推奨されます。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.
[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, December 2011.
[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, December 2011.
[CLICK-DEFENSE-BLOG] Lawrence, E., "IE8 Security Part VII: Clickjacking Defenses", Microsoft Developer Network Blogs, January 2009, <http://blogs.msdn.com/b/ie/archive/2009/01/ 27/ie8-security-part-vii-clickjacking-defenses.aspx>.
[CLICK-DEFENSE-BLOG] Lawrence, E., "IE8 Security Part VII: Clickjacking Defenses", Microsoft Developer Network Blogs, January 2009, <http://blogs.msdn.com/b/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx>.
[CSP] Sterne, B. and A. Barth, "Content Security Policy 1.0", W3C Candidate Recommendation CR-CSP-20121115, November 2012, <http://www.w3.org/TR/2012/CR-CSP-20121115/>.
[CSP] Sterne, B. and A. Barth, "Content Security Policy 1.0", W3C Candidate Recommendation CR-CSP-20121115, November 2012, <http://www.w3.org/TR/2012/CR-CSP-20121115/>.
[CSP-1-1] Barth, A. and M. West, "Content Security Policy 1.1", W3C Working Draft WD-CSP11-20130604, June 2013, <http://www.w3.org/TR/2013/WD-CSP11-20130604/>.
[CSP-1-1] Barth, A. and M. West, "Content Security Policy 1.1", W3C Working Draft WD-CSP11-20130604, June 2013, <http://www.w3.org/TR/2013/WD-CSP11-20130604/>.
[CSRF] OWASP (Open Web Application Security Project), "Top-10 2013-A8-Cross-Site Request Forgery (CSRF)", June 2013, <https://www.owasp.org/index.php/ Top_10_2013-A8-Cross-Site_Request_Forgery_%28CSRF%29>.
[CSRF] OWASP (Open Web Application Security Project), "Top-10 2013-A8-Cross-Site Request Forgery (CSRF)", June 2013, <https://www.owasp.org/index.php/Top_10_2013-A8-Cross-Site_Request_Forgery_%28CSRF%29>.
[Clickjacking] OWASP (Open Web Application Security Project), "Clickjacking", April 2013, <http://www.owasp.org/index.php/Clickjacking>.
[Clickjacking] OWASP (Open Web Application Security Project), "Clickjacking", April 2013, <http://www.owasp.org/index.php/Clickjacking>.
[FRAME-BUSTING] Stanford Web Security Research, "Busting frame busting: a study of clickjacking vulnerabilities at popular sites", July 2010, <http://seclab.stanford.edu/websec/framebusting/>.
[FRAME-BUSTING] Stanford Web Security Research、 "Busting frame busting: a study of clickjacking vulnerabilities at popular sites"、2010年7月、<http://seclab.stanford.edu/websec/framebusting/>。
[HTTPbis-P1] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", Work in Progress, September 2013.
[HTTPbis-P1] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", Work in Progress, September 2013.
[Microsoft-X-Frame-Options] Lawrence, E., "Combating ClickJacking With X-Frame-Options", Microsoft Developer Network Blogs, March 2010, <http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/ combating-clickjacking-with-x-frame-options.aspx>.
[Microsoft-X-Frame-Options] Lawrence, E., "Combating ClickJacking With X-Frame-Options", Microsoft Developer Network Blogs, March 2010, <http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx>.
[Mozilla-X-Frame-Options] Mozilla Developer Network, "The X-Frame-Options response header", August 2013, <https://developer.mozilla.org/ en-US/docs/The_X-FRAME-OPTIONS_response_header>.
[Mozilla-X-Frame-Options] Mozilla Developer Network, "The X-Frame-Options response header", August 2013, <https://developer.mozilla.org/en-US/docs/The_X-FRAME-OPTIONS_response_header>.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration Procedures for Message Header Fields", BCP 90, RFC 3864, September 2004.
[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration Procedures for Message Header Fields", BCP 90, RFC 3864, September 2004.
[RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, "Deprecating the "X-" Prefix and Similar Constructs in Application Protocols", BCP 178, RFC 6648, June 2012.
[RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, "Deprecating the "X-" Prefix and Similar Constructs in Application Protocols", BCP 178, RFC 6648, June 2012.
o Internet Explorer 8+
o Internet Explorer 8以降
o Firefox 3.6.9+
o Firefox 3.6.9以降
o Opera 10.5+
o Opera 10.5以降
o Safari 4+
o Safari 4以降
o Chrome 4.1+
o Chrome 4.1以降
A more detailed explanation of clickjacking scenarios follows.
クリックジャッキングのシナリオの詳細な説明は次のとおりです。
An Internet marketplace/shop offering a feature with a link/button to "Buy this" gadget wants their affiliates (who could be malicious attackers) to be able to stick the "Buy such and such from XYZ" IFRAMES into their pages. There is a possible clickjacking threat here, which is why the marketplace/online shop needs to then immediately navigate the main browsing context (or a new window) to a confirmation page that is protected by anti-clickjacking protections.
「これを購入する」ガジェットへのリンク/ボタンを備えた機能を提供するインターネットマーケットプレイス/ショップは、アフィリエイト(悪意のある攻撃者である可能性があります)が「XYZからこれこれを購入する」というiframeを自分のページに貼り付けられるようにしたいと考えています。ここにはクリックジャッキングの脅威の可能性があります。そのため、マーケットプレイス/オンラインショップは、メインのブラウジングコンテキスト(または新しいウィンドウ)を、アンチクリックジャッキング保護で保護された確認ページにすぐに遷移させる必要があります。
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. For that reason, the confirmation page uses a combination of anti-CSRF (Cross Site Request Forgery [CSRF]) tokens and the X-Frame-Options HTTP header field, mitigating clickjacking attacks.
オンラインショップの「購入の確認」ページは、オーバーレイや攻撃者による悪用のリスクなしにエンドユーザーに表示される必要があります。そのため、確認ページでは、アンチCSRF(Cross Site Request Forgery [CSRF])トークンとX-Frame-Options HTTPヘッダーフィールドの組み合わせを使用して、クリックジャッキング攻撃を軽減しています。
Macromedia Flash configuration settings are set by a Flash object that 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 clickjacking attack. In order to prevent clickjacking attacks against the security settings, the configuration page uses the X-Frame-Options directive.
Macromedia Flashの構成設定は、Macromediaのサイトの特定の構成ページからのみ実行できるFlashオブジェクトによって設定されます。オブジェクトはページ内で実行されるため、クリックジャッキング攻撃を受ける可能性があります。セキュリティ設定に対するクリックジャッキング攻撃を防ぐために、構成ページではX-Frame-Optionsディレクティブを使用します。
This document was derived from input from specifications published by various browser vendors such as Microsoft (Eric Lawrence and David Ross), Mozilla, Google, Opera, and Apple.
このドキュメントは、Microsoft(Eric LawrenceとDavid Ross)、Mozilla、Google、Opera、Appleなどのさまざまなブラウザーベンダーによって公開された仕様からの入力に基づいています。
Authors' Addresses
著者のアドレス
David Ross Microsoft
David Ross Microsoft
EMail: dross@microsoft.com
Tobias Gondrom Thames Stanley
Tobias Gondrom Thames Stanley
EMail: tobias.gondrom@gondrom.org