[要約] 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アプリケーションの保護を改善するために、このドキュメントでは、ブラウザーが送信されたコンテンツをフレームで表示できるかどうかに関して、サーバーからクライアントブラウザーに伝達されるポリシーを宣言する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.

このドキュメントは、IETF(Internet Engineering Task Force)の製品です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、インターネットエンジニアリングステアリンググループ(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
        
1. Introduction
1. はじめに

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])が非標準のHTTP [RFC2616]の使用を導入しましたヘッダーフィールド「X-Frame-Options」。クリックジャッキングから保護します[クリックジャッキング]。 HTMLベースのWebアプリケーションは、他のWebページを埋め込んだり、「フレーム化」したりできます。クリックジャッキングは、攻撃者がユーザーインターフェイスで複数の透明または不透明のレイヤーを使用して、ユーザーを同じ場所をクリックするつもりでサーバーBの別のページのボタンまたはリンクをクリックするように仕向けるときに発生する攻撃の一種です。サーバーAのページをオーバーレイします。したがって、攻撃者はページAのクリックを「ハイジャック」し、それらをページBにルーティングします。攻撃者はユーザー(ページAのオーバーレイするユーザーインターフェイスコンテンツを見る)をだまして、サーバー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ヘッダーフィールドは、コンテンツセキュリティポリシー(CSP)バージョン1.1のFrame-Optionsディレクティブに置き換えられます[CSP-1 -1]。

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ページで、そのコンテンツ(ボタン、リンク、テキストなど)をフレーム(<frame>または<iframe)に表示してはならないことを宣言できます>)別のページ(例えば、ホストAから)。これは、HTTPヘッダーで宣言されたポリシーによって実行され、ここに記載されているようにブラウザー実装によって実施されます。

1.1. Requirements Language
1.1. 要件言語

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]で説明されているように解釈されます。

2. X-Frame-Options Header
2. X-Frame-Optionsヘッダー

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応答のヘッダーでこのポリシーを宣言して、クリックジャッキング攻撃を防ぐことができます。これにより、コンテンツが他のページまたはフレームに埋め込まれないことが保証されます。

2.1. Syntax
2.1. 構文

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つの値のいずれかに正確に設定する必要があります。

DENY A browser receiving content with this header field MUST NOT display this content in any frame.

DENYこのヘッダーフィールドを持つコンテンツを受信するブラウザは、このコンテンツをフレームに表示してはなりません。

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このヘッダーフィールドを持つコンテンツを受信するブラウザーは、コンテンツ自体とは異なる起源のページからのフレームにこのコンテンツを表示してはなりません。

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".

ブラウザまたはプラグインがコンテンツの出所とフレームが同じであるかどうかを確実に判断できない場合、これは「拒否」として扱われる必要があります。

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])が続くこのヘッダーのコンテンツを受信するブラウザーは、指定されたオリジンとは異なるオリジンのトップレベルのブラウジングコンテキストを持つページのフレームにこのコンテンツを表示してはなりません。これにより、信頼できる発行元によってページがリスクにさらされる可能性がありますが、場合によっては、他のドメインからのコンテンツによるフレーミングを許可する必要があります。

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]).

「シリアライズドオリジン」という用語の意味は[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の場合)。 [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を参照)。

2.2. Augmented Backus-Naur Form (ABNF)
2.2. Augmented Backus-Naur Form(ABNF)

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].

[RFC6454]で定義されているserialized-originと[HTTPbis-P1]で定義されている必須の空白(RWS)

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文字列として指定されます。したがって、大文字と小文字は区別されません。

2.2.1. Examples of X-Frame-Options
2.2.1. X-Frame-Optionsの例

X-Frame-Options: DENY

X-Frame-Options:DENY

X-Frame-Options: SAMEORIGIN

X-Frame-Options:SAMEORIGIN

       X-Frame-Options: ALLOW-FROM https://example.com/
        
2.3. Design Issues
2.3. 設計上の問題
2.3.1. Enable HTML Content from Other Domains
2.3.1. 他のドメインのHTMLコンテンツを有効にする

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 タグを埋め込む

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ポリシーにも準拠している必要があります。

2.3.2. Browser Behavior and Processing
2.3.2. ブラウザの動作と処理

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)。

2.3.2.1. Violation of X-Frame-Options
2.3.2.1. X-Frame-Optionsの違反

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.

この実装はさまざまです。ブラウザによっては、ユーザーがターゲットウィンドウを安全に新しいウィンドウで開くことができるようにするメッセージを表示しますが、他の実装では、空のフレームをレンダリングするだけです。

2.3.2.2. Variation in Current Browser Behavior
2.3.2.2. 現在のブラウザの動作の変化

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ページは他のページにフレームを埋め込むことができ、次に他のページにもフレームを埋め込むことができます。など。理論的には、これによりフレーム化されたページが無限にネストされる可能性があります。例えば、ウェブページAは、フレームにウェブページBを含み得、ウェブページBは、フレームにウェブページ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で説明されているようにセキュリティに影響を及ぼします。Frame-Optionsディレクティブの形式のX-Frame-Optionsの改訂バージョンCSP 1.1 [CSP-1-1]は動作を統合し、ここで説明されているメカニズムではなく、新しい実装ではそれを使用することが期待されています。

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つのシリアライズドオリジンのみをサポートするため、サーバーが複数のリソースにコンテンツのフレーミングを許可する場合は、次の設計パターンでそのニーズを満たすことができます。

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」ヘッダーを強制します。

2.3.2.4. No Caching of the X-Frame-Options Header
2.3.2.4. X-Frame-Optionsヘッダーのキャッシングなし

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つしかないことを考慮して、ユーザーがブラウザタブで複数のページを開いており、ドメインAのWebページ1とドメインBのWebページ2があり、両方が同じフレームを構成しているとします。 ALLOW-FROMディレクティブを使用したドメインCのページ。その場合、ページは異なるX-Frame-Optionsヘッダーを使用して両方の要求に応答する必要があり、最初のポイントは起点Aを指し、2番目のポイントは起点Bを指します。

However, we found that none of the major browsers listed in Appendix A cache the responses.

ただし、付録Aに記載されている主要なブラウザのいずれも応答をキャッシュしないことがわかりました。

3. IANA Considerations
3. IANAに関する考慮事項

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」レジストリに含めました。

3.1. Registration Template
3.1. 登録テンプレート

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

関連情報:なし

4. Security Considerations
4. セキュリティに関する考慮事項

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ヘッダーフィールドの導入により、クリックジャッキングに対する保護が向上しています。ただし、これらのすべての種類の攻撃ベクトルから保護するのに十分な自己完結型ではありません。安全なコーディング(入力検証、出力エンコーディングなど)やコンテンツセキュリティポリシーバージョン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ヘッダーフィールドとして送信する必要があり、メタhttp-equivタグで宣言されている場合、ユーザーエージェントによって明示的に無視されます。

4.1. Privacy Considerations
4.1. プライバシーに関する考慮事項

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ヘッダーを生成することが推奨されます。

5. References
5. 参考文献
5.1. Normative References
5.1. 引用文献

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119] Bradner、S。、「要件レベルを示すためにRFCで使用するキーワード」、BCP 14、RFC 2119、1997年3月。

[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。、およびL. Masinter、「Uniform Resource Identifier(URI):Generic Syntax」、STD 66、RFC 3986、2005年1月。

[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234] Crocker、D。およびP. Overell、「構文仕様の拡張BNF:ABNF」、STD 68、RFC 5234、2008年1月。

[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, December 2011.

[RFC6454]バース、A。、「The Web Origin Concept」、RFC 6454、2011年12月。

5.2. Informative References
5.2. 参考引用

[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、2009年1月、<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。およびA. Barth、「コンテンツセキュリティポリシー1.0」、W3C候補勧告CR-CSP-20121115、2012年11月、<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.およびM. West、「コンテンツセキュリティポリシー1.1」、W3C草案WD-CSP11-20130604、2013年6月、<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)」、2013年6月、<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>.

[クリックジャック] OWASP(Open Web Application Security Project)、「クリックジャック」、2013年4月、<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/>.

[フレームバスティング] Stanford Web Security Research、 "Busting frame busting:a study of clickjacking vulnerability at人気サイト"、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。およびJ. Reschke、「Hypertext Transfer Protocol(HTTP / 1.1):Message Syntax and Routing」、Work in Progress、2013年9月。

[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、2010年3月、<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、「X-Frame-Options応答ヘッダー」、2013年8月、<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。、およびT. Berners-Lee、「Hypertext Transfer Protocol-HTTP / 1.1」 、RFC 2616、1999年6月。

[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。、およびJ. Mogul、「メッセージヘッダーフィールドの登録手順」、BCP 90、RFC 3864、2004年9月。

[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]セントアンドレ、P。、クロッカー、D。、およびM.ノッティンガム、「アプリケーションプロトコルでの「X-」プレフィックスと同様の構成の非推奨」、BCP 178、RFC 6648、2012年6月。

Appendix A. Browsers That Support X-Frame-Options
付録A. X-Frame-Optionsをサポートするブラウザー

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以降

Appendix B. Description of a Clickjacking Attack
付録B.クリックジャッキング攻撃の説明

A more detailed explanation of clickjacking scenarios follows.

クリックジャッキングのシナリオの詳細な説明は次のとおりです。

B.1. Shop
B.1. ショップ

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から購入する」などのIFRAMESをページに貼り付けられることを望んでいます。ここではクリックジャックの脅威の可能性があります。そのため、マーケットプレイスやオンラインショップは、メインのブラウジングコンテキスト(または新しいウィンドウ)をすぐにアンチクリックジャック保護で保護された確認ページに移動する必要があります。

B.2. Online Shop Confirm Purchase Page
B.2. オンラインショップ購入確認ページ

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ヘッダーフィールドの組み合わせを使用して、クリックジャッキング攻撃を軽減しています。

B.3. Flash Configuration
B.3. フラッシュ構成

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ディレクティブを使用します。

Appendix C. Acknowledgements
付録C.謝辞

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

デビッドロスマイクロソフト

   EMail: dross@microsoft.com
        

Tobias Gondrom Thames Stanley

トビアスゴンドロムテムズスタンレー

   EMail: tobias.gondrom@gondrom.org