1. 7 りェブペヌゞの読み蟌み
    1. 7.1 サポヌトコンセプト
      1. 7.1.1 生成元
        1. 7.1.1.1 サむト
        2. 7.1.1.2 同䞀生成元制限を緩和する
        3. 7.1.1.3 The Origin interface
      2. 7.1.2 生成元キヌ゚ヌゞェントクラスタヌ
      3. 7.1.3 生成元をたたいだオヌプナヌポリシヌ
        1. 7.1.3.1 ヘッダヌ
        2. 7.1.3.2 Browsing context group switches due to opener policy
        3. 7.1.3.3 Reporting
      4. 7.1.4 生成元をたたいだ埋め蟌みポリシヌ
        1. 7.1.4.1 ヘッダヌ
        2. 7.1.4.2 Embedder policy checks
      5. 7.1.5 サンドボックス
      6. 7.1.6 iframe element referrer policy
      7. 7.1.7 Policy containers

7 りェブペヌゞの読み蟌み

このセクションは、りェブブラりザヌに最も盎接的に適甚される機胜に぀いお説明する。それでもやはり、特に指定しない限り、このセクションで定矩されおいる芁件は、りェブブラりザヌであるかどうかに関わらず、すべおのナヌザヌ゚ヌゞェントに適甚される。

7.1 サポヌトコンセプト

7.1.1 生成元

生成元は、りェブのセキュリティモデルの基本的な通貚である。生成元を共有するりェブプラットフォヌム内の2぀の圓事者が互いに信頌し、同䞀の暩限を有するず仮定される。異なる生成元をも぀圓事者は、互いに朜圚的に悪意があるず芋なされ、互いから皋床を倉化させるよう隔離される。

たずえば、bank.example.comでホストされるExample Bankのりェブサむトは、charity.example.orgでホストExample CharityのりェブサむトのDOMを怜査しようずするず、"SecurityError" DOMException が発生する。


生成元は次のいずれかである

䞍透明な生成元

内郚倀であり、シリアラむズされおいないために再䜜成するこずができない生成元のシリアラむズごずに"null"ずしおシリアラむズされる。意味のある操䜜は、透過性のテストのみである。

タプルの生成元

A tuple consisting of:

生成元は、たずえば耇数のDocumentオブゞェクト間で共有できる。さらに、生成元は䞀般に䞍倉である。タプルの生成元のドメむンのみ、およびdocument.domain APIを介しおのみ倉曎できる。

生成元originの有効ドメむンは、次のように蚈算される

  1. originが䞍透明な生成元である堎合、nullを返す。

  2. originのドメむンがnullでない堎合、originのドメむンを返す。

  3. originのホストを返す。

The serialization of an origin is the string obtained by applying the following algorithm to the given origin origin:

  1. If origin is an opaque origin, then return "null".

  2. Otherwise, let result be origin's scheme.

  3. Append "://" to result.

  4. Append origin's host, serialized, to result.

  5. If origin's port is non-null, append a U+003A COLON character (:), and origin's port, serialized, to result.

  6. Return result.

("https", "xn--maraa-rta.example", null, null)の シリアラむれヌションは"https://xn--maraa-rta.example"ずなる。

There used to also be a Unicode serialization of an origin. However, it was never widely adopted.


Two origins, A and B, are said to be same origin if the following algorithm returns true:

  1. If A and B are the same opaque origin, then return true.

  2. If A and B are both tuple origins and their schemes, hosts, and port are identical, then return true.

  3. falseを返す。

Two origins, A and B, are said to be same origin-domain if the following algorithm returns true:

  1. If A and B are the same opaque origin, then return true.

  2. If A and B are both tuple origins:

    1. If A and B's schemes are identical, and their domains are identical and non-null, then return true.

    2. Otherwise, if A and B are same origin and their domains are both null, return true.

  3. falseを返す。

ABsame originsame origin-domain
("https", "example.org", null, null)("https", "example.org", null, null)✅✅
("https", "example.org", 314, null)("https", "example.org", 420, null)❌❌
("https", "example.org", 314, "example.org")("https", "example.org", 420, "example.org")❌✅
("https", "example.org", null, null)("https", "example.org", null, "example.org")✅❌
("https", "example.org", null, "example.org")("http", "example.org", null, "example.org")❌❌
7.1.1.1 サむト

スキヌムずホストは、スキヌムASCII文字列およびホストホストのタプルである。

サむトは䞍透明な生成元たたはscheme-and-hostである。

To obtain a site, given an origin origin, run these steps:

  1. If origin is an opaque origin, then return origin.

  2. If origin's host's registrable domain is null, then return (origin's scheme, origin's host).

  3. Return (origin's scheme, origin's host's registrable domain).

Two sites, A and B, are said to be same site if the following algorithm returns true:

  1. If A and B are the same opaque origin, then return true.

  2. If A or B is an opaque origin, then return false.

  3. If A's and B's scheme values are different, then return false.

  4. If A's and B's host values are not equal, then return false.

  5. Return true.

The serialization of a site is the string obtained by applying the following algorithm to the given site site:

  1. If site is an opaque origin, then return "null".

  2. Let result be site[0].

  3. Append "://" to result.

  4. Append site[1], serialized, to result.

  5. Return result.

It needs to be clear from context that the serialized value is a site, not an origin, as there is not necessarily a syntactic difference between the two. For example, the origin ("https", "shop.example", null, null) and the site ("https", "shop.example") have the same serialization: "https://shop.example".

Two origins, A and B, are said to be schemelessly same site if the following algorithm returns true:

  1. If A and B are the same opaque origin, then return true.

  2. If A and B are both tuple origins:

    1. Let hostA be A's host, and let hostB be B's host.

    2. If hostA equals hostB and hostA's registrable domain is null, then return true.

    3. If hostA's registrable domain equals hostB's registrable domain and is non-null, then return true.

  3. falseを返す。

Two origins, A and B, are said to be same site if the following algorithm returns true:

  1. Let siteA be the result of obtaining a site given A.

  2. Let siteB be the result of obtaining a site given B.

  3. If siteA is same site with siteB, then return true.

  4. falseを返す。

同䞀生成元および同䞀origin-domainの抂念ずは異なり、スキヌムレスで同じサむトおよび同じサむトの堎合、ポヌトおよびドメむンコンポヌネントは無芖される。

URLで説明される理由により、同䞀生成元チェックを優先しお、可胜な堎合は同じサむトおよびスキヌムレスで同じサむトの抂念を回避すべきである。

wildlife.museum、museum、およびcomは公開サフィックスであり、example.comはそうではない

ABschemelessly same sitesame site
("https", "example.com")("https", "sub.example.com")✅✅
("https", "example.com")("https", "sub.other.example.com")✅✅
("https", "example.com")("http", "non-secure.example.com")✅❌
("https", "r.wildlife.museum")("https", "sub.r.wildlife.museum")✅✅
("https", "r.wildlife.museum")("https", "sub.other.r.wildlife.museum")✅✅
("https", "r.wildlife.museum")("https", "other.wildlife.museum")❌❌
("https", "r.wildlife.museum")("https", "wildlife.museum")❌❌
("https", "wildlife.museum")("https", "wildlife.museum")✅✅
("https", "example.com")("https", "example.com.")❌❌

ここではポヌトおよびドメむンのコンポヌネントは考慮されおいないため、省略しおいる。

7.1.1.2 同䞀生成元制限を緩和する
document.domain [ = domain ]

セキュリティチェックのために䜿甚される珟圚のドメむンを返す。

サブドメむンを削陀する倀に蚭定し、生成元のドメむンを倉曎し、同じドメむンの他のサブドメむン同じこずを行う堎合のペヌゞが互いにアクセスできるようにするこずができる。これにより、ドメむンの異なるホスト䞊のペヌゞが、互いのDOMに同期的にアクセスできるようになる。

サンドボックス化されたiframe、䞍透明な生成元をも぀Document、およびブラりゞングコンテキストのないDocumentにおいお、セッタヌは"SecurityError"䟋倖を投げる。crossOriginIsolatedたたはoriginAgentClusterがtrueを返す堎合、セッタヌは䜕もしない。

document.domainセッタヌの䜿甚を避ける。これは、同䞀生成元ポリシヌが提䟛するセキュリティ保護を損なうものである。これは共有ホスティングを䜿甚しおいる堎合に特に顕著である。たずえば、信頌できないサヌドパヌティが同じIPアドレスだが異なるポヌトで HTTP サヌバヌをホストできる堎合、document.domainセッタヌを䜿甚した埌に生成元を比范するずきにポヌトが無芖されるため、通垞は同じホスト䞊の2぀の異なるサむトを保護する同䞀生成元の保護が倱敗する。

これらのセキュリティ䞊の萜ずし穎があるため、この機胜はりェブプラットフォヌムから削陀されるプロセスにある。これは䜕幎もかかる長いプロセスである。

代わりに、安党な方法で生成元間で通信するために、postMessage()たたはMessageChannelオブゞェクトを䜿甚する。

The domain getter steps are:

  1. Let effectiveDomain be this's origin's effective domain.

  2. If effectiveDomain is null, then return the empty string.

  3. Return effectiveDomain, serialized.

The domain setter steps are:

  1. If this's browsing context is null, then throw a "SecurityError" DOMException.

  2. If this's active sandboxing flag set has its sandboxed document.domain browsing context flag set, then throw a "SecurityError" DOMException.

  3. Let effectiveDomain be this's origin's effective domain.

  4. If effectiveDomain is null, then throw a "SecurityError" DOMException.

  5. If the given value is not a registrable domain suffix of and is not equal to effectiveDomain, then throw a "SecurityError" DOMException.

  6. If the surrounding agent's agent cluster's is origin-keyed is true, then return.

  7. Set this's origin's domain to the result of parsing the given value.

To determine if a scalar value string hostSuffixString is a registrable domain suffix of or is equal to a host originalHost:

  1. If hostSuffixString is the empty string, then return false.

  2. Let hostSuffix be the result of parsing hostSuffixString.

  3. If hostSuffix is failure, then return false.

  4. If hostSuffix does not equal originalHost:

    1. If hostSuffix or originalHost is not a domain, then return false.

      This excludes hosts that are IP addresses.

    2. If hostSuffix, prefixed by U+002E (.), does not match the end of originalHost, then return false.

    3. If any of the following are true:

      then return false. [URL]

    4. Assert: originalHost's public suffix, prefixed by U+002E (.), matches the end of hostSuffix.

  5. Return true.

hostSuffixStringoriginalHostOutcome of is a registrable domain suffix of or is equal to泚
"0.0.0.0"0.0.0.0✅
"0x10203"0.1.2.3✅
"[0::1]"::1✅
"example.com"example.com✅
"example.com"example.com.❌Trailing dot is significant.
"example.com."example.com❌
"example.com"www.example.com✅
"com"example.com❌At the time of writing, com is a public suffix.
"example"example✅
"compute.amazonaws.com"example.compute.amazonaws.com❌At the time of writing, *.compute.amazonaws.com is a public suffix.
"example.compute.amazonaws.com"www.example.compute.amazonaws.com❌
"amazonaws.com"www.example.compute.amazonaws.com❌
"amazonaws.com"test.amazonaws.com✅At the time of writing, amazonaws.com is a registrable domain.
7.1.1.3 The Origin interface

The Origin interface represents an origin, allowing robust same origin and same site comparisons.

[Exposed=*]
interface Origin {
  constructor();

  static Origin from(any value);

  readonly attribute boolean opaque;

  boolean isSameOrigin(Origin other);
  boolean isSameSite(Origin other);
};

Origin objects have an associated origin, which holds an origin.

Platform objects have an extract an origin operation, which returns null unless otherwise specified.

Objects implementing the Origin interface's extract an origin steps are to return this's origin.

The new Origin() constructor steps are to set this's origin to a unique opaque origin.

The static from(value) method steps are:

  1. If value is a platform object:

    1. Let origin be the result of executing value's extract an origin operation.

    2. If origin is not null, then return a new Origin object whose origin is origin.

  2. If value is a string:

    1. Let parsedURL be the result of basic URL parsing value.

    2. If parsedURL is not failure, then return a new Origin object whose origin is set to parsedURL's origin.

  3. Throw a TypeError.

The opaque getter steps are to return true if this's origin is an opaque origin; otherwise false.

The isSameOrigin(other) method steps are to return true if this's origin is same origin with other's origin; otherwise false.

The isSameSite(other) method steps are to return true if this's origin is same site with other's origin; otherwise false.

7.1.2 生成元キヌ゚ヌゞェントクラスタヌ

window.originAgentCluster

このセクションで説明されおいる方法で、このWindowが生成元キヌの゚ヌゞェントクラスタヌに属す堎合はtrueを返す。

セキュアなコンテキストで配信されたDocumentは、`Origin-Agent-Cluster` HTTPレスポンスヘッダヌを䜿甚しお、生成元キヌの゚ヌゞェントクラスタヌに配眮するように芁求するこずができる。このヘッダヌは構造化されたヘッダヌであり、その倀は真停倀でなければらない。[STRUCTURED-FIELDS]

新しいDocumentオブゞェクトの䜜成ず初期化の凊理モデルによっお、構造化されたヘッダヌの真停倀ではない倀すなわち、`?1`は無芖される。

このヘッダヌを䜿甚するず、結果ずしお埗られるDocumentの゚ヌゞェントクラスタキヌは、察応するサむトではなく、その生成元ずなる。目に芋える効果ずしお、これはdocument.domainを䜿甚しお同䞀生成元の制限を緩和しようずしおも䜕も実行されない代わりに、WebAssembly.Moduleオブゞェクトを生成元をたたいだDocumentに送信するこずができなくなるこずであるたずえ同じサむトであっおも。氎面䞋で、この分離により、ナヌザヌ゚ヌゞェントは、プロセスやスレッドなどの゚ヌゞェントクラスタヌに察応する実装固有のリ゜ヌスをより効率的に割り圓おるこずが可胜になる。

ブラりゞングコンテキストグルヌプ内では、`Origin-Agent-Cluster`ヘッダヌは、たずえ䞀方がヘッダヌを送信し、他方が送信しない堎合でも、同䞀生成元のDocumentオブゞェクトが異なる゚ヌゞェントクラスタヌで終わる原因にはならないこずに泚意する。これは、履歎゚ヌゞェントクラスタキヌマップによっお防止される。

぀たり、originAgentClusterゲッタヌは、同じブラりゞングコンテキストグルヌプ内の以前にロヌドされた同䞀生成元のペヌゞでヘッダヌが省略されおいた堎合、たずえヘッダヌが蚭定されおいおも、falseを返すこずができるずいうこずである。同様に、ヘッダヌが蚭定されおいなくおもtrueを返すこずができる。

The originAgentCluster getter steps are to return the surrounding agent's agent cluster's is origin-keyed.

䞍透明な生成元をも぀Documentは、無条件に生成元が分離されおいるずみなすこずができる。その堎合、ヘッダヌは効果がなく、か぀originAgentClusterゲッタヌは垞にtrueを返すだろう。

同様に、゚ヌゞェントクラスタヌの生成元をたたいだ分離モヌドが"none"ではないDocumentは、自動的に生成元キヌが蚭定される。生成元をたたいだ分離を達成するために䜿甚される`Cross-Origin-Opener-Policy`および `Cross-Origin-Embedder-Policy`ヘッダヌは、同じアドレス空間内のすべおのものがそこに存圚するこずを保蚌するこずを目的ずしおいるため、`Origin-Agent-Cluster`ヘッダヌは、リ゜ヌスの割り圓おに関する実装ぞの远加のヒントずしお有甚であるかもしれない。しかし、それを远加しおも、著者のコヌドに远加の目に芋える圱響はない。

7.1.3 生成元をたたいだオヌプナヌポリシヌ

オヌプナヌポリシヌ倀は、トップレベルブラりゞングコンテキストにナビゲヌトされたドキュメントに察し、新しいトップレベルブラりゞングコンテキストおよび、それに察応するグルヌプの䜜成を匷制できる。可胜な倀は次のずおり

"unsafe-none"

これは珟圚のデフォルトであり、文曞が別のオヌプナヌポリシヌを指定しない限り、文曞がその前の文曞ず同じトップレベルブラりゞングコンテキストを占有するこずを意味する。

"same-origin-allow-popups"

これは、前の文曞が同じオヌプナヌポリシヌを指定しおおり、それらが同䞀生成元でない限り、文曞の新しいトップレベルブラりゞングコンテキストを匷制的に䜜成する。

"same-origin"

これは、"same-origin-allow-popups"ず同じように動䜜するが、䜜成される補助ブラりゞングコンテキストは、同じオヌプナヌポリシヌを持぀同䞀生成元の文曞を含める必芁があるこずが远加される。さもなければ、オヌプナヌに非公開で衚瀺される。

"same-origin-plus-COEP"

これは"same-origin"ず同じように動䜜するが、新しいトップレベルブラりゞングコンテキストのグルヌプの生成元をたたいだ分離を"logical"たたは"concrete"のいずれかに蚭定するこずが远加される。

"same-origin-plus-COEP"は`Cross-Origin-Opener-Policy`ヘッダヌで盎接蚭定するこずはできないが、`Cross-Origin-Opener-Policy: same-origin`ず`Cross-Origin-Embedder-Policy` ヘッダヌ倀は生成元をたたいだ分離ず互換を䞀緒に蚭定した結果である。

"noopener-allow-popups"

これは、先行文曞に関係なく、文曞の新しいトップレベルブラりゞングコンテキストを匷制的に䜜成する。

noopener-allow-popups倀を含めるず、それが適甚される文曞ずそのオヌプナヌずの間のオヌプナヌ関係が切断されるが、それらの同䞀生成元の文曞の間に匷固なセキュリティ境界を䜜成しない。

同䞀生成元のアプリケヌションによるその他のリスクには、次がある

  • 文曞のコンテンツをフェッチする同䞀生成元リク゚スト — Fetch Metadataフィルタリングによっお緩和できる。[FETCHMETADATA]

  • 同䞀生成元フレヌミング - X-Frame-OptionsたたはCSP frame-ancestorsによっお緩和できる。

  • JavaScriptでアクセス可胜なcookie - すべおのcookieがhttponlyであるこずを確認するこずで緩和できる。

  • 機密デヌタぞのlocalStorageアクセス。

  • サヌビスワヌカヌのむンストヌル。

  • Cache APIの操䜜たたは機密デヌタぞのアクセス。[SW]

  • 機密情報を公開するpostMessageたたはBroadcastChannelメッセヌゞング。

  • 同䞀生成元の文曞に察しおナヌザヌの操䜜を必芁ずしない自動入力。

noopener-allow-popupsを䜿甚する開発者は、機密性の高いアプリケヌションが、localStorage、その他のクラむアントサむドのストレヌゞAPI、 BroadcastChannel、関連する同䞀生成元の通信メカニズムなど、他の同䞀生成元の文曞にアクセスできるクラむアントサむドの機胜に䟝存しないようにする必芁がある。たた、サヌバヌサむドの゚ンドポむントが、応答コンテンツが同䞀医生成元のドキュメントに非ナビゲヌションのリク゚ストに機密デヌタを戻さないようにする必芁もある。

An opener policy consists of:

To match opener policy values, given an opener policy value documentCOOP, an origin documentOrigin, an opener policy value responseCOOP, and an origin responseOrigin:

  1. If documentCOOP is "unsafe-none" and responseCOOP is "unsafe-none", then return true.

  2. If documentCOOP is "unsafe-none" or responseCOOP is "unsafe-none", then return false.

  3. If documentCOOP is responseCOOP and documentOrigin is same origin with responseOrigin, then return true.

  4. falseを返す。

7.1.3.1 ヘッダヌ

Headers/Cross-Origin-Opener-Policy

Support in all current engines.

Firefox79+Safari15.2+Chrome83+
OperaNoEdge83+
Edge (Legacy)?Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView AndroidNoSamsung Internet?Opera AndroidNo

Documentの生成元をたたいだオヌプナヌポリシヌは `Cross-Origin-Opener-Policy`および`Cross-Origin-Opener-Policy-Report-Only` HTTPレスポンスヘッダヌから掟生する。このヘッダヌは構造化されたヘッダヌであり、その倀はトヌクンでなければならない。[STRUCTURED-FIELDS]

劥圓なトヌクンの倀は、オヌプナヌポリシヌ倀である。トヌクンはたた、付属のパラメヌタヌを持っおもよい。これらのうち、"report-to"パラメヌタヌは、適切な報告゚ンドポむントを識別する劥圓なURL文字列を持぀こずができる。[REPORTING]

以䞋に説明する凊理モデルに埓っお、ナヌザヌ゚ヌゞェントは、このヘッダヌに䞍正倀が含たれおいる堎合、そのヘッダヌを無芖する。同様に、倀がトヌクンずしお解析できない堎合、ナヌザヌ゚ヌゞェントはこのヘッダヌを無芖する。


To obtain an opener policy given a response response and an environment reservedEnvironment:

  1. Let policy be a new opener policy.

  2. If reservedEnvironment is a non-secure context, then return policy.

  3. Let parsedItem be the result of getting a structured field value given `Cross-Origin-Opener-Policy` and "item" from response's header list.

  4. If parsedItem is not null:

    1. If parsedItem[0] is "same-origin":

      1. Let coep be the result of obtaining a cross-origin embedder policy from response and reservedEnvironment.

      2. If coep's value is compatible with cross-origin isolation, then set policy's value to "same-origin-plus-COEP".

      3. Otherwise, set policy's value to "same-origin".

    2. If parsedItem[0] is "same-origin-allow-popups", then set policy's value to "same-origin-allow-popups".

    3. If parsedItem[0] is "noopener-allow-popups", then set policy's value to "noopener-allow-popups".

    4. If parsedItem[1]["report-to"] exists and it is a string, then set policy's reporting endpoint to parsedItem[1]["report-to"].

  5. Set parsedItem to the result of getting a structured field value given `Cross-Origin-Opener-Policy-Report-Only` and "item" from response's header list.

  6. If parsedItem is not null:

    1. If parsedItem[0] is "same-origin":

      1. Let coep be the result of obtaining a cross-origin embedder policy from response and reservedEnvironment.

      2. If coep's value is compatible with cross-origin isolation or coep's report-only value is compatible with cross-origin isolation, then set policy's report-only value to "same-origin-plus-COEP".

        Report only COOP also considers report-only COEP to assign the special "same-origin-plus-COEP" value. This allows developers more freedom in the order of deployment of COOP and COEP.

      3. Otherwise, set policy's report-only value to "same-origin".

    2. If parsedItem[0] is "same-origin-allow-popups", then set policy's report-only value to "same-origin-allow-popups".

    3. If parsedItem[1]["report-to"] exists and it is a string, then set policy's report-only reporting endpoint to parsedItem[1]["report-to"].

  7. Return policy.

7.1.3.2 Browsing context group switches due to opener policy

To check if popup COOP values require a browsing context group switch, given two origins responseOrigin and activeDocumentNavigationOrigin, and two opener policy values responseCOOPValue and activeDocumentCOOPValue:

  1. If responseCOOPValue is "noopener-allow-popups", then return true.

  2. If all of the following are true:

    then return false.

  3. If the result of matching activeDocumentCOOPValue, activeDocumentNavigationOrigin, responseCOOPValue, and responseOrigin is true, then return false.

  4. Return true.

To check if COOP values require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin and activeDocumentNavigationOrigin, and two opener policy values responseCOOPValue and activeDocumentCOOPValue:

  1. If isInitialAboutBlank is true, then return the result of checking if popup COOP values requires a browsing context group switch with responseOrigin, activeDocumentNavigationOrigin, responseCOOPValue, and activeDocumentCOOPValue.

  2. Here we are dealing with a non-popup navigation.

    If the result of matching activeDocumentCOOPValue, activeDocumentNavigationOrigin, responseCOOPValue, and responseOrigin is true, then return false.

  3. Return true.

To check if enforcing report-only COOP would require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin, activeDocumentNavigationOrigin, and two opener policies responseCOOP and activeDocumentCOOP:

  1. If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's report-only value, and activeDocumentCOOPReportOnly's report-only value is false, then return false.

    Matching report-only policies allows a website to specify the same report-only opener policy on all its pages and not receive violation reports for navigations between these pages.

  2. If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's value, and activeDocumentCOOPReportOnly's report-only value is true, then return true.

  3. If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, responseOrigin, activeDocumentNavigationOrigin, responseCOOP's report-only value, and activeDocumentCOOPReportOnly's value is true, then return true.

  4. falseを返す。

An opener policy enforcement result is a struct with the following items:

To enforce a response's opener policy, given a browsing context browsingContext, a URL responseURL, an origin responseOrigin, an opener policy responseCOOP, an opener policy enforcement result currentCOOPEnforcementResult, and a referrer referrer:

  1. Let newCOOPEnforcementResult be a new opener policy enforcement result with

    needs a browsing context group switch
    currentCOOPEnforcementResult's needs a browsing context group switch
    would need a browsing context group switch due to report-only
    currentCOOPEnforcementResult's would need a browsing context group switch due to report-only
    url
    responseURL
    origin
    responseOrigin
    opener policy
    responseCOOP
    current context is navigation source
    true
  2. Let isInitialAboutBlank be browsingContext's active document's is initial about:blank.

  3. If isInitialAboutBlank is true and browsingContext's initial URL is null, set browsingContext's initial URL to responseURL.

  4. If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, currentCOOPEnforcementResult's opener policy's value, currentCOOPEnforcementResult's origin, responseCOOP's value, and responseOrigin is true:

    1. Set newCOOPEnforcementResult's needs a browsing context group switch to true.

    2. If browsingContext's group's browsing context set's size is greater than 1:

      1. Queue a violation report for browsing context group switch when navigating to a COOP response with responseCOOP, "enforce", responseURL, currentCOOPEnforcementResult's url, currentCOOPEnforcementResult's origin, responseOrigin, and referrer.

      2. Queue a violation report for browsing context group switch when navigating away from a COOP response with currentCOOPEnforcementResult's opener policy, "enforce", currentCOOPEnforcementResult's url, responseURL, currentCOOPEnforcementResult's origin, responseOrigin, and currentCOOPEnforcementResult's current context is navigation source.

  5. If the result of checking if enforcing report-only COOP would require a browsing context group switch given isInitialAboutBlank, responseOrigin, currentCOOPEnforcementResult's origin, responseCOOP, and currentCOOPEnforcementResult's opener policy, is true:

    1. Set newCOOPEnforcementResult's would need a browsing context group switch due to report-only to true.

    2. If browsingContext's group's browsing context set's size is greater than 1:

      1. Queue a violation report for browsing context group switch when navigating to a COOP response with responseCOOP, "reporting", responseURL, currentCOOPEnforcementResult's url, currentCOOPEnforcementResult's origin, responseOrigin, and referrer.

      2. Queue a violation report for browsing context group switch when navigating away from a COOP response with currentCOOPEnforcementResult's opener policy, "reporting", currentCOOPEnforcementResult's url, responseURL, currentCOOPEnforcementResult's origin, responseOrigin, and currentCOOPEnforcementResult's current context is navigation source.

  6. Return newCOOPEnforcementResult.

To obtain a browsing context to use for a navigation response, given navigation params navigationParams:

  1. Let browsingContext be navigationParams's navigable's active browsing context.

  2. If browsingContext is not a top-level browsing context, then return browsingContext.

  3. Let coopEnforcementResult be navigationParams's COOP enforcement result.

  4. Let swapGroup be coopEnforcementResult's needs a browsing context group switch.

  5. Let sourceOrigin be browsingContext's active document's origin.

  6. Let destinationOrigin be navigationParams's origin.

  7. If sourceOrigin is not same site with destinationOrigin:

    1. If either of sourceOrigin or destinationOrigin have a scheme that is not an HTTP(S) scheme and the user agent considers it necessary for sourceOrigin and destinationOrigin to be isolated from each other (for implementation-defined reasons), optionally set swapGroup to true.

      For example, if a user navigates from about:settings to https://example.com, the user agent could force a swap.

      Issue #10842 tracks settling on an interoperable behavior here, instead of letting this be optional.

    2. If navigationParams's user involvement is "browser UI", optionally set swapGroup to true.

      Issue #6356 tracks settling on an interoperable behavior here, instead of letting this be optional.

  8. If browsingContext's group's browsing context set's size is 1, optionally set swapGroup to true.

    Some implementations swap browsing context groups here for performance reasons.

    The check for other contexts that could script this one is not sufficient to prevent differences in behavior that could affect a web page. Even if there are currently no other contexts, the destination page could open a window, then if the user navigates back, the previous page could expect to be able to script the opened window. Doing a swap here would break that use case.

  9. If swapGroup is false:

    1. If coopEnforcementResult's would need a browsing context group switch due to report-only is true, set browsingContext's virtual browsing context group ID to a new unique identifier.

    2. Return browsingContext.

  10. Let newBrowsingContext be the first return value of creating a new top-level browsing context and document.

    In this case we are going to perform a browsing context group swap. browsingContext will not be used by the new Document that we are about to create. If it is not used by other Documents either (such as ones in the back/forward cache), then the user agent might destroy it at this point.

  11. Let navigationCOOP be navigationParams's cross-origin opener policy.

  12. If navigationCOOP's value is "same-origin-plus-COEP", then set newBrowsingContext's group's cross-origin isolation mode to either "logical" or "concrete". The choice of which is implementation-defined.

    It is difficult on some platforms to provide the security properties required by the cross-origin isolated capability. "concrete" grants access to it and "logical" does not.

  13. Let sandboxFlags be a clone of navigationParams's final sandboxing flag set.

  14. If sandboxFlags is not empty:

    1. Assert: navigationCOOP's value is "unsafe-none".

    2. Assert: newBrowsingContext's popup sandboxing flag set is empty.

    3. Set newBrowsingContext's popup sandboxing flag set to sandboxFlags.

  15. Return newBrowsingContext.

7.1.3.3 Reporting

An accessor-accessed relationship is an enum that describes the relationship between two browsing contexts between which an access happened. It can take the following values:

accessor is opener

The accessor browsing context or one of its ancestors is the opener browsing context of the accessed browsing context's top-level browsing context.

accessor is openee

The accessed browsing context or one of its ancestors is the opener browsing context of the accessor browsing context's top-level browsing context.

none

There is no opener relationship between the accessor browsing context, the accessor browsing context, or any of their ancestors.

To check if an access between two browsing contexts should be reported, given two browsing contexts accessor and accessed, a JavaScript property name P, and an environment settings object environment:

  1. If P is not a cross-origin accessible window property name, then return.

  2. Assert: accessor's active document and accessed's active document are both fully active.

  3. Let accessorTopDocument be accessor's top-level browsing context's active document.

  4. Let accessorInclusiveAncestorOrigins be the list obtained by taking the origin of the active document of each of accessor's active document's inclusive ancestor navigables.

  5. Let accessedTopDocument be accessed's top-level browsing context's active document.

  6. Let accessedInclusiveAncestorOrigins be the list obtained by taking the origin of the active document of each of accessed's active document's inclusive ancestor navigables.

  7. If any of accessorInclusiveAncestorOrigins are not same origin with accessorTopDocument's origin, or if any of accessedInclusiveAncestorOrigins are not same origin with accessedTopDocument's origin, then return.

    This avoids leaking information about cross-origin iframes to a top level frame with opener policy reporting.

  8. If accessor's top-level browsing context's virtual browsing context group ID is accessed's top-level browsing context's virtual browsing context group ID, then return.

  9. Let accessorAccessedRelationship be a new accessor-accessed relationship with value none.

  10. If accessed's top-level browsing context's opener browsing context is accessor or is an ancestor of accessor, then set accessorAccessedRelationship to accessor is opener.

  11. If accessor's top-level browsing context's opener browsing context is accessed or is an ancestor of accessed, then set accessorAccessedRelationship to accessor is openee.

  12. Queue violation reports for accesses, given accessorAccessedRelationship, accessorTopDocument's opener policy, accessedTopDocument's opener policy, accessor's active document's URL, accessed's active document's URL, accessor's top-level browsing context's initial URL, accessed's top-level browsing context's initial URL, accessor's active document's origin, accessed's active document's origin, accessor's top-level browsing context's opener origin at creation, accessed's top-level browsing context's opener origin at creation, accessorTopDocument's referrer, accessedTopDocument's referrer, P, and environment.

To sanitize a URL to send in a report given a URL url:

  1. Let sanitizedURL be a copy of url.

  2. Set the username given sanitizedURL and the empty string.

  3. Set the password given sanitizedURL and the empty string.

  4. Return the serialization of sanitizedURL with exclude fragment set to true.

To queue a violation report for browsing context group switch when navigating to a COOP response given an opener policy coop, a string disposition, a URL coopURL, a URL previousResponseURL, two origins coopOrigin and previousResponseOrigin, and a referrer referrer:

  1. If coop's reporting endpoint is null, return.

  2. Let coopValue be coop's value.

  3. If disposition is "reporting", then set coopValue to coop's report-only value.

  4. Let serializedReferrer be an empty string.

  5. If referrer is a URL, set serializedReferrer to the serialization of referrer.

  6. Let body be a new object containing the following properties:

    keyvalue
    dispositiondisposition
    effectivePolicycoopValue
    previousResponseURLIf coopOrigin and previousResponseOrigin are same origin this is the sanitization of previousResponseURL, null otherwise.
    referrerserializedReferrer
    type"navigation-to-response"
  7. Queue body as "coop" for coop's reporting endpoint with coopURL.

To queue a violation report for browsing context group switch when navigating away from a COOP response given an opener policy coop, a string disposition, a URL coopURL, a URL nextResponseURL, two origins coopOrigin and nextResponseOrigin, and a boolean isCOOPResponseNavigationSource:

  1. If coop's reporting endpoint is null, return.

  2. Let coopValue be coop's value.

  3. If disposition is "reporting", then set coopValue to coop's report-only value.

  4. Let body be a new object containing the following properties:

    keyvalue
    dispositiondisposition
    effectivePolicycoopValue
    nextResponseURLIf coopOrigin and nextResponseOrigin are same origin or isCOOPResponseNavigationSource is true, this is the sanitization of nextResponseURL, null otherwise.
    type"navigation-from-response"
  5. Queue body as "coop" for coop's reporting endpoint with coopURL.

To queue violation reports for accesses, given an accessor-accessed relationship accessorAccessedRelationship, two opener policies accessorCOOP and accessedCOOP, four URLs accessorURL, accessedURL, accessorInitialURL, accessedInitialURL, four origins accessorOrigin, accessedOrigin, accessorCreatorOrigin and accessedCreatorOrigin, two referrers accessorReferrer and accessedReferrer, a string propertyName, and an environment settings object environment:

  1. If coop's reporting endpoint is null, return.

  2. Let coopValue be coop's value.

  3. If disposition is "reporting", then set coopValue to coop's report-only value.

  4. If accessorAccessedRelationship is accessor is opener:

    1. Queue a violation report for access to an opened window, given accessorCOOP, accessorURL, accessedURL, accessedInitialURL, accessorOrigin, accessedOrigin, accessedCreatorOrigin, propertyName, and environment.

    2. Queue a violation report for access from the opener, given accessedCOOP, accessedURL, accessorURL, accessedOrigin, accessorOrigin, propertyName, and accessedReferrer.

  5. Otherwise, if accessorAccessedRelationship is accessor is openee:

    1. Queue a violation report for access to the opener, given accessorCOOP, accessorURL, accessedURL, accessorOrigin, accessedOrigin, propertyName, accessorReferrer, and environment.

    2. Queue a violation report for access from an opened window, given accessedCOOP, accessedURL, accessorURL, accessorInitialURL, accessedOrigin, accessorOrigin, accessorCreatorOrigin, and propertyName.

  6. Otherwise:

    1. Queue a violation report for access to another window, given accessorCOOP, accessorURL, accessedURL, accessorOrigin, accessedOrigin, propertyName, and environment.

    2. Queue a violation report for access from another window, given accessedCOOP, accessedURL, accessorURL, accessedOrigin, accessorOrigin, and propertyName.

To queue a violation report for access to the opener, given an opener policy coop, two URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string propertyName, a referrer referrer, and an environment settings object environment:

  1. Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.

  2. Let serializedReferrer be an empty string.

  3. If referrer is a URL, set serializedReferrer to the serialization of referrer.

  4. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoop's report-only value
    propertypropertyName
    openerURLIf coopOrigin and openerOrigin are same origin, this is the sanitization of openerURL, null otherwise.
    referrerserializedReferrer
    sourceFilesourceFile
    lineNumberlineNumber
    columnNumbercolumnNumber
    type"access-to-opener"
  5. Queue body as "coop" for coop's reporting endpoint with coopURL and environment.

To queue a violation report for access to an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and openerInitialOrigin, a string propertyName, and an environment settings object environment:

  1. Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.

  2. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoop's report-only value
    propertypropertyName
    openedWindowURLIf coopOrigin and openedWindowOrigin are same origin, this is the sanitization of openedWindowURL, null otherwise.
    openedWindowInitialURLIf coopOrigin and openerInitialOrigin are same origin, this is the sanitization of initialWindowURL, null otherwise.
    sourceFilesourceFile
    lineNumberlineNumber
    columnNumbercolumnNumber
    type"access-to-opener"
  3. Queue body as "coop" for coop's reporting endpoint with coopURL and environment.

To queue a violation report for access to another window, given an opener policy coop, two URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, a string propertyName, and an environment settings object environment:

  1. Let sourceFile, lineNumber, and columnNumber be the relevant script URL and problematic position which triggered this report.

  2. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoop's report-only value
    propertypropertyName
    otherURLIf coopOrigin and otherOrigin are same origin, this is the sanitization of otherURL, null otherwise.
    sourceFilesourceFile
    lineNumberlineNumber
    columnNumbercolumnNumber
    type"access-to-opener"
  3. Queue body as "coop" for coop's reporting endpoint with coopURL and environment.

To queue a violation report for access from the opener, given an opener policy coop, two URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string propertyName, and a referrer referrer:

  1. If coop's reporting endpoint is null, return.

  2. Let serializedReferrer be an empty string.

  3. If referrer is a URL, set serializedReferrer to the serialization of referrer.

  4. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoop's report-only value
    propertypropertyName
    openerURLIf coopOrigin and openerOrigin are same origin, this is the sanitization of openerURL, null otherwise.
    referrerserializedReferrer
    type"access-to-opener"
  5. Queue body as "coop" for coop's reporting endpoint with coopURL.

To queue a violation report for access from an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and openerInitialOrigin, and a string propertyName:

  1. If coop's reporting endpoint is null, return.

  2. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoopValue
    propertycoop's report-only value
    openedWindowURLIf coopOrigin and openedWindowOrigin are same origin, this is the sanitization of openedWindowURL, null otherwise.
    openedWindowInitialURLIf coopOrigin and openerInitialOrigin are same origin, this is the sanitization of initialWindowURL, null otherwise.
    type"access-to-opener"
  3. Queue body as "coop" for coop's reporting endpoint with coopURL.

To queue a violation report for access from another window, given an opener policy coop, two URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, and a string propertyName:

  1. If coop's reporting endpoint is null, return.

  2. Let body be a new object containing the following properties:

    keyvalue
    disposition"reporting"
    effectivePolicycoop's report-only value
    propertypropertyName
    otherURLIf coopOrigin and otherOrigin are same origin, this is the sanitization of otherURL, null otherwise.
    typeaccess-to-opener
  3. Queue body as "coop" for coop's reporting endpoint with coopURL.

7.1.4 生成元をたたいだ埋め蟌みポリシヌ

Headers/Cross-Origin-Embedder-Policy

Support in all current engines.

Firefox79+Safari15.2+Chrome83+
Opera?Edge83+
Edge (Legacy)?Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android86+Samsung Internet?Opera Android?

埋め蟌みポリシヌ倀は、リ゜ヌス所有者からの明瀺的な蚱可なしに、生成元をたたいだリ゜ヌスのフェッチを制埡する3぀の文字列の1぀である。

"unsafe-none"

これはデフォルトの倀である。この倀を䜿甚するずき、CORSプロトコルたたは`Cross-Origin-Resource-Policy`ヘッダヌを通しお明瀺的な蚱可を䞎えるこずなしに生成元をたたいだリ゜ヌスをフェッチするこずができる。

"require-corp"

この倀を䜿甚するずき、生成元をたたいだリ゜ヌスをフェッチするには、CORSプロトコルたたは`Cross-Origin-Resource-Policy`ヘッダヌを通しおサヌバヌの明瀺的な蚱可が必芁ずなる。

"credentialless"

この倀を䜿甚する堎合、生成元をたたいだno-CORSリ゜ヌスをフェッチするず、クレデンシャルが省略される。代わりに、明瀺的な`Cross-Origin-Resource-Policy`ヘッダヌは必芁ない。クレデンシャルを䜿甚しお送信されるその他のリク゚ストには、CORSプロトコルたたは `Cross-Origin-Resource-Policy`ヘッダヌを介したサヌバヌの明瀺的な暩限が必芁である。

"credentialless"をサポヌトする前に、実装者は次の䞡方をサポヌトするこずを匷く勧める

そうでなければ、攻撃者は、生成元をたたいだ分離機胜を䜿甚しお、クラむアントのネットワヌク䜍眮を利甚しお非公開リ゜ヌスを読み取るこずを可胜にする。

゚ンベッダヌポリシヌ倀は、"credentialless"たたは"require-corp"である堎合、生成元をたたいだ分離ず互換性がある。

埋め蟌みポリシヌは次で構成される

"coep"報告タむプは、倀が"coep"ずなる報告タむプである。これはReportingObserverから可芖である。

7.1.4.1 ヘッダヌ

`Cross-Origin-Embedder-Policy`および`Cross-Origin-Embedder-Policy-Report-Only` HTTPレスポンスヘッダヌフィヌルドは、サヌバヌが環境蚭定オブゞェクトの埋め蟌みポリシヌを宣蚀するこずを可胜にする。このヘッダヌは構造化されたヘッダヌであり、その倀はトヌクンでなければならない。[STRUCTURED-FIELDS]

劥圓なトヌクンの倀は、埋め蟌みポリシヌ倀である。トヌクンはたた、付属のパラメヌタヌを持っおもよい。これらのうち、"report-to"パラメヌタヌは、適切な報告゚ンドポむントを識別する劥圓なURL文字列を持぀こずができる。[REPORTING]

凊理モデルは、トヌクンずしお解析できないヘッダヌの存圚䞋ではオヌプンに倱敗するデフォルトで"unsafe-none"。これには、䞎えられた応答に存圚する`Cross-Origin-Embedder-Policy`ヘッダヌの耇数のむンスタンスを組み合わせお䜜成された䞍泚意なリストが含たれる。

`Cross-Origin-Embedder-Policy`最終埋め蟌みポリシヌ倀
No header delivered"unsafe-none"
`require-corp`"require-corp"
`unknown-value`"unsafe-none"
`require-corp, unknown-value`"unsafe-none"
`unknown-value, unknown-value`"unsafe-none"
`unknown-value, require-corp`"unsafe-none"
`require-corp, require-corp`"unsafe-none"

同じこずが`Cross-Origin-Embedder-Policy-Report-Only`にも適甚される。


To obtain an embedder policy from a response response and an environment environment:

  1. Let policy be a new embedder policy.

  2. If environment is a non-secure context, then return policy.

  3. Let parsedItem be the result of getting a structured field value with `Cross-Origin-Embedder-Policy` and "item" from response's header list.

  4. If parsedItem is non-null and parsedItem[0] is compatible with cross-origin isolation:

    1. Set policy's value to parsedItem[0].

    2. If parsedItem[1]["report-to"] exists, then set policy's reporting endpoint to parsedItem[1]["report-to"].

  5. Set parsedItem to the result of getting a structured field value with `Cross-Origin-Embedder-Policy-Report-Only` and "item" from response's header list.

  6. If parsedItem is non-null and parsedItem[0] is compatible with cross-origin isolation:

    1. Set policy's report-only value to parsedItem[0].

    2. If parsedItem[1]["report-to"] exists, then set policy's report-only reporting endpoint to parsedItem[1]["report-to"].

  7. Return policy.

7.1.4.2 Embedder policy checks

To check a navigation response's adherence to its embedder policy given a response response, a navigable navigable, and an embedder policy responsePolicy:

  1. If navigable is not a child navigable, then return true.

  2. Let parentPolicy be navigable's container document's policy container's embedder policy.

  3. If parentPolicy's report-only value is compatible with cross-origin isolation and responsePolicy's value is not, then queue a cross-origin embedder policy inheritance violation with response, "navigation", parentPolicy's report-only reporting endpoint, "reporting", and navigable's container document's relevant settings object.

  4. If parentPolicy's value is not compatible with cross-origin isolation or responsePolicy's value is compatible with cross-origin isolation, then return true.

  5. Queue a cross-origin embedder policy inheritance violation with response, "navigation", parentPolicy's reporting endpoint, "enforce", and navigable's container document's relevant settings object.

  6. falseを返す。

To check a global object's embedder policy given a WorkerGlobalScope workerGlobalScope, an environment settings object owner, and a response response:

  1. If workerGlobalScope is not a DedicatedWorkerGlobalScope object, then return true.

  2. Let policy be workerGlobalScope's embedder policy.

  3. Let ownerPolicy be owner's policy container's embedder policy.

  4. If ownerPolicy's report-only value is compatible with cross-origin isolation and policy's value is not, then queue a cross-origin embedder policy inheritance violation with response, "worker initialization", ownerPolicy's report-only reporting endpoint, "reporting", and owner.

  5. If ownerPolicy's value is not compatible with cross-origin isolation or policy's value is compatible with cross-origin isolation, then return true.

  6. Queue a cross-origin embedder policy inheritance violation with response, "worker initialization", ownerPolicy's reporting endpoint, "enforce", and owner.

  7. falseを返す。

To queue a cross-origin embedder policy inheritance violation given a response response, a string type, a string endpoint, a string disposition, and an environment settings object settings:

  1. Let serialized be the result of serializing a response URL for reporting with response.

  2. Let body be a new object containing the following properties:

    keyvalue
    typetype
    blockedURLserialized
    dispositiondisposition
  3. Queue body as the "coep" report type for endpoint on settings.

7.1.5 サンドボックス

サンドボックスフラグセットは次のフラグの0個以䞊の集合であり、これは朜圚的に信頌されないリ゜ヌスが持぀胜力を制限するために䜿甚される

サンドボックス化されたナビゲヌションブラりゞングコンテキストフラグ

このフラグは、コンテンツが、サンドボックス化されたブラりゞングコンテキスト自䜓たたはその䞭にさらにネストされたブラりゞングコンテキスト、補助ブラりゞングコンテキスト次に定矩されるサンドボックス化された補助ナビゲヌションブラりゞングコンテキストフラグによっお保護されおいる、およびトップレベルブラりゞングコンテキストサンドボックス化されたナヌザヌ起動ブラりゞングコンテキストフラグなしのトップレベルナビゲヌション、および以䞋に定矩されるサンドボックス化されたナヌザヌ起動ブラりゞングコンテキストフラグありトップレベルナビゲヌションによっお保護されおいる以倖のブラりゞングコンテキストをナビゲヌトするこずを防止するものである。

サンドボックス化された補助ナビゲヌションブラりゞングコンテキストフラグが蚭定されない堎合、それにもかかわらず䞀定の堎合における制限はポップアップ新しいトップレベルブラりゞングコンテキストを開くこずができる。これらのブラりゞングコンテキストは垞に、1぀の蚱可されたサンドボックス化されたナビゲヌタヌを持ち、実際に移動するために䜜成したブラりゞングコンテキストを蚱可する、ブラりゞングコンテキストが䜜成されるずきに蚭定を持぀。そうでなければ、サンドボックス化されたナビゲヌションブラりゞングコンテキストフラグは、それらが開かれた堎合であっおもナビゲヌトされおいくのを防ぐだろう。

サンドボックス化された補助ナビゲヌションブラりゞングコンテキストフラグ

このフラグは、コンテンツが新しい補助ブラりゞングコンテキストを䜜成するのを防ぐ。 たずえば、target属性やwindow.open()メ゜ッドを䜿甚する。

ナヌザヌによるアクティブ化なしでサンドボックス化されたトップレベルナビゲヌションブラりゞングコンテキストフラグ

このフラグは、それらのトップレベルブラりゞングコンテキストのナビゲヌトからコンテンツを防ぎ、か぀それらのトップレベルブラりゞングコンテキストの遮断からコンテンツを防ぐ。サンドボックス化されたブラりゞングコンテキストのアクティブりィンドりが䞀時的なアクティブ化を持たない堎合にのみ考慮される。

ナヌザヌによるアクティブ化なしでサンドボックス化されたトップレベルナビゲヌションブラりゞングコンテキストフラグが蚭定されおいない堎合、コンテンツはそのトップレベルブラりゞングコンテキストをナビゲヌトするこずができるが、他のブラりゞングコンテキストは、サンドボックス化されたナビゲヌションブラりゞングコンテキストフラグ、およびサンドボックス化された補助ナビゲヌションブラりゞングコンテキストフラグによっお保護されたたたである。

ナヌザヌによるアクティブ化でサンドボックス化されたトップレベルナビゲヌションブラりゞングコンテキストフラグ

このフラグは、それらのトップレベルブラりゞングコンテキストのナビゲヌトからコンテンツを防ぎ、か぀それらのトップレベルブラりゞングコンテキストの遮断からコンテンツを防ぐ。サンドボックス化されたブラりゞングコンテキストのアクティブりィンドりが䞀時的なアクティブ化を持぀堎合にのみ考慮される。

ナヌザヌによるアクティブ化なしでサンドボックス化されたブラりゞングコンテキストフラグず同様に、このフラグはトップレベルブラりゞングコンテキストにのみ圱響する。 蚭定されおいない堎合、他のブラりゞングコンテキストが他のフラグによっお保護されおいる可胜性がある。

サンドボックス化された生成元ブラりゞングコンテキストフラグ

このフラグは、䞍透明な生成元にコンテンツを匷制する。したがっお、同䞀生成元から他のコンテンツにアクセスするこずを防止する。

このフラグはたた、document.cookie IDL属性からの読み取りたたは曞き蟌みをするスクリプトを防止し、localStorageぞのアクセスをブロックする。

サンドボックス化されたフォヌムブラりゞングコンテキストフラグ

このフラグはフォヌム送信をブロックする。

サンドボックス化されたポむンタヌロックブラりゞングコンテキストフラグ

このフラグはPointer Lock APIを無効にする。[POINTERLOCK]

サンドボックス化されたスクリプトブラりゞングコンテキストフラグ

このフラグは、スクリプトの実行をブロックする。

サンドボックス化された自動機胜ブラりゞングコンテキストフラグ

このフラグは、自動ビデオ再生や自動フォヌムコントロヌルフォヌカスなどの、自動的に切り替える機胜をブロックする。

サンドボックス化されたdocument.domainブラりゞングコンテキストフラグ

このフラグは、コンテンツがdocument.domainセッタヌを䜿甚するこずから防ぐ。

サンドボックスが補助ブラりゞングコンテキストに䌝播するフラグ

このフラグは、コンテンツが䜜成する補助ブラりゞングコンテキストがコンテンツのアクティブなサンドボックスフラグセットを継承するのを保蚌するこずで、そのコンテンツがサンドボックスを゚スケヌプするのを防ぐ。

サンドボックス化されたモヌダルフラグ

このフラグは、コンテンツが次の機胜のいずれかを䜿甚しおモヌダルダむアログを生成するのを防ぐ

サンドボックス化された方向ロックブラりゞングコンテキストフラグ

このフラグは、画面の向きをロックする機胜を無効にする。[SCREENORIENTATION]

サンドボックス化されたプレれンテヌションブラりゞングコンテキストフラグ

このフラグはPresentation APIを無効にする。 [PRESENTATION]

サンドボックス化されたダりンロヌドブラりゞングコンテキストフラグ

このフラグは、ハむパヌリンクのダりンロヌドたたはダりンロヌドずしお凊理されるナビゲヌションのいずれを介しお、コンテンツがダりンロヌドを開始たたはむンスタンス化するのを防ぐ。

サンドボックス化されたカスタムプロトコルナビゲヌションブラりゞングコンテキストフラグ

このフラグは、非フェッチスキヌムぞのナビゲヌションが倖郚゜フトりェアに枡されるのを劚げる。

When the user agent is to parse a sandboxing directive, given a string input and a sandboxing flag set output, it must run the following steps:

  1. Split input on ASCII whitespace, to obtain tokens.

  2. outputを空にする。

  3. outputに次のフラグを远加する


すべおのトップレベルブラりゞングコンテキストは、ポップアップサンドボックス化 フラグセットを持ち、これはサンドボックス化フラグセットである。ブラりゞングコンテキストが䜜成される堎合、そのポップアップサンド化フラグセットは空でなければならない。It is populated by the rules for choosing a navigable and the obtain a browsing context to use for a navigation response algorithm.

すべおのiframe芁玠は、iframeサンドボックス化フラグセットを持ち、これはサンドボックス化フラグセットである。iframeサンドボックス化フラグセットのどのフラグが特定の時間にセットされるかは、iframe芁玠のsandbox 属性によっお決定される。

すべおのDocumentは、アクティブなサンドボックス化フラグセットを持ち、これはサンドボックス化フラグセットである、Documentが䜜成される堎合、そのアクティブなサンドボックス化フラグセットは空でなければならない。それは、ナビゲヌションアルゎリズムによっお远加される。

Every CSP list cspList has CSP-derived sandboxing flags, which is a sandboxing flag set. It is the return value of the following algorithm:

  1. Let directives be an empty ordered set.

  2. For each policy in cspList:

    1. If policy's disposition is not "enforce", then continue.

    2. If policy's directive set contains a directive whose name is "sandbox", then append that directive to directives.

  3. If directives is empty, then return an empty sandboxing flag set.

  4. Let directive be directives[directives's size − 1].

  5. Return the result of parsing the sandboxing directive directive.


nullたたは芁玠embedderを指定しお、ブラりゞングコンテキストbrowsing contextの䜜成サンドボックスフラグを決定するには、次のサンドボックスフラグセットに存圚するフラグの和集合を返す。

7.1.6 iframe element referrer policy

To determine the iframe element referrer policy given an element-or-null embedder:

  1. If embedder is an iframe element, then return embedder's referrerpolicy attribute's state's corresponding keyword.

  2. 空文字列を返す。

This is used for allowing masking of some origins in the internal ancestor origin objects list creation steps.

7.1.7 Policy containers

A policy container is a struct containing policies that apply to a Document, a WorkerGlobalScope, or a WorkletGlobalScope. It has the following items:

Move other policies into the policy container.

To clone a policy container given a policy container policyContainer:

  1. Let clone be a new policy container.

  2. For each policy in policyContainer's CSP list, append a copy of policy into clone's CSP list.

  3. Set clone's embedder policy to a copy of policyContainer's embedder policy.

  4. Set clone's referrer policy to policyContainer's referrer policy.

  5. Set clone's integrity policy to a copy of policyContainer's integrity policy.

  6. Return clone.

To determine whether a URL url requires storing the policy container in history:

  1. If url's scheme is "blob", then return false.

  2. If url is local, then return true.

  3. falseを返す。

To create a policy container from a fetch response given a response response and an environment-or-null environment:

  1. If response's URL's scheme is "blob", then return a clone of response's URL's blob URL entry's environment's policy container.

  2. Let result be a new policy container.

  3. Set result's CSP list to the result of parsing a response's Content Security Policies given response.

  4. If environment is non-null, then set result's embedder policy to the result of obtaining an embedder policy given response and environment. Otherwise, set it to "unsafe-none".

  5. Set result's referrer policy to the result of parsing the `Referrer-Policy` header given response. [REFERRERPOLICY]

  6. Parse Integrity-Policy headers with response and result.

  7. Return result.

To determine navigation params policy container given a URL responseURL and four policy container-or-nulls historyPolicyContainer, initiatorPolicyContainer, parentPolicyContainer, and responsePolicyContainer:

  1. If historyPolicyContainer is not null:

    1. Assert: responseURL requires storing the policy container in history.

    2. Return a clone of historyPolicyContainer.

  2. If responseURL is about:srcdoc:

    1. Assert: parentPolicyContainer is not null.

    2. Return a clone of parentPolicyContainer.

  3. If responseURL is local and initiatorPolicyContainer is not null, then return a clone of initiatorPolicyContainer.

  4. If responsePolicyContainer is not null, then return responsePolicyContainer.

  5. Return a new policy container.

To initialize a worker global scope's policy container given a WorkerGlobalScope workerGlobalScope, a response response, and an environment environment:

  1. If workerGlobalScope's url is local but its scheme is not "blob":

    1. Assert: workerGlobalScope's owner set's size is 1.

    2. Set workerGlobalScope's policy container to a clone of workerGlobalScope's owner set[0]'s relevant settings object's policy container.

  2. Otherwise, set workerGlobalScope's policy container to the result of creating a policy container from a fetch response given response and environment.