@@ -1937,6 +1937,27 @@ source of security bugs. Please seek security review for features that deal with
1937
1937
<a for="URL serializer"><i>exclude fragment</i></a> set to true.
1938
1938
</ol>
1939
1939
1940
+ <p> To check if <dfn export>Cross-Origin-Embedder-Policy allows credentials</dfn> , given a
1941
+ <a for=/>request</a> <var> request</var> , run these steps:
1942
+
1943
+ <ol>
1944
+ <li><p> If <var> request</var> 's <a for=request>mode</a> is not "<code> no-cors</code> ", then return
1945
+ true.</p>
1946
+
1947
+ <li><p> If <var> request</var> 's <a for=request>client</a> is null, then return true.</p>
1948
+
1949
+ <li><p> If <var> request</var> 's <a for=request>client</a>' s
1950
+ <a for="environment settings object">policy container</a> 's
1951
+ <a for="policy container">embedder policy</a> 's <a for="embedder policy">value</a> is not
1952
+ "<a for="embedder policy value"><code>credentialless</code></a> ", then return true.</p>
1953
+
1954
+ <li><p> If <var> request</var> 's <a for=request>origin</a> is <a>same origin</a> with
1955
+ <var> request</var> 's <a for=request>current URL</a>' s <a for=url>origin</a> and
1956
+ <var> request</var> 's <a for=request>tainted origin flag</a> is not set, then return true.</p>
1957
+
1958
+ <li><p> Return false.</p>
1959
+ </ol>
1960
+
1940
1961
1941
1962
<h4 id=responses>Responses</h4>
1942
1963
@@ -2023,6 +2044,9 @@ initially unset.
2023
2044
being provided to an API that didn't make a range request. See the flag's usage for a detailed
2024
2045
description of the attack.
2025
2046
2047
+ <p> A <a for=/>response</a> has an associated <dfn for=response>request-includes-credentials</dfn>
2048
+ (a boolean), which is initially true.
2049
+
2026
2050
<p> A <a for=/>response</a> has an associated
2027
2051
<dfn for=response id=concept-response-timing-allow-passed>timing allow passed flag</dfn> , which is
2028
2052
initially unset.
@@ -3524,7 +3548,7 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or
3524
3548
3525
3549
<li>
3526
3550
<p> If the <a>cross-origin resource policy internal check</a> with <var> origin</var> ,
3527
- "<code> < a for="embedder policy value">unsafe-none</a ></code > ", <var> response</var> , and
3551
+ "<a for="embedder policy value"><code> unsafe-none</code ></a > ", <var> response</var> , and
3528
3552
<var> forNavigation</var> returns <b> blocked</b> , then return <b> blocked</b> .
3529
3553
3530
3554
<p class="note"> This step is needed because we don't want to report violations not related to
@@ -3559,7 +3583,7 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or
3559
3583
3560
3584
<ol>
3561
3585
<li><p> If <var> forNavigation</var> is true and <var> embedderPolicyValue</var> is
3562
- "<code> < a for="embedder policy value">unsafe-none</a ></code > ", then return <b> allowed</b> .
3586
+ "<a for="embedder policy value"><code> unsafe-none</code ></a > ", then return <b> allowed</b> .
3563
3587
3564
3588
<li>
3565
3589
<p> Let <var> policy</var> be the result of <a for="header list">getting</a>
@@ -3568,16 +3592,33 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or
3568
3592
3569
3593
<p class=note> This means that `<code> Cross-Origin-Resource-Policy: same-site, same-origin</code> `
3570
3594
ends up as <b> allowed</b> below as it will never match anything, as long as
3571
- <var> embedderPolicyValue</var> is "<code> < a for="embedder policy value">unsafe-none</a ></code > ".
3595
+ <var> embedderPolicyValue</var> is "<a for="embedder policy value"><code> unsafe-none</code ></a > ".
3572
3596
Two or more `<a http-header><code>Cross-Origin-Resource-Policy</code></a> ` headers will have the
3573
3597
same effect.
3574
3598
3575
3599
<li><p> If <var> policy</var> is neither `<code> same-origin</code> `, `<code> same-site</code> `, nor
3576
3600
`<code> cross-origin</code> `, then set <var> policy</var> to null.
3577
3601
3578
- <li><p> If <var> policy</var> is null and <var> embedderPolicyValue</var> is
3579
- "<code> <a for="embedder policy value">require-corp</a> </code> ", then set <var> policy</var> to
3580
- `<code> same-origin</code> `.
3602
+ <li>
3603
+ <p> If <var> policy</var> is null, then switch on <var> embedderPolicyValue</var> :</p>
3604
+
3605
+ <dl class=switch>
3606
+ <dt> "<a for="embedder policy value"><code>unsafe-none</code></a> "
3607
+ <dd><p> Do nothing.
3608
+
3609
+ <dt> "<a for="embedder policy value"><code>credentialless</code></a> "
3610
+ <dd>
3611
+ <p> Set <var> policy</var> to `<code> same-origin</code> ` if:
3612
+
3613
+ <ul>
3614
+ <li><var> response</var> 's <a for="response">request-includes-credentials</a> is true, or
3615
+ <li><var> forNavigation</var> is true.
3616
+ </ul>
3617
+
3618
+ <dt> "<a for="embedder policy value"><code>require-corp</code></a> "
3619
+ <dd><p> Set <var> policy</var> to `<code> same-origin</code> `.
3620
+ </dl>
3621
+ </li>
3581
3622
3582
3623
<li>
3583
3624
<p> Switch on <var> policy</var> :
@@ -4729,6 +4770,9 @@ steps. They return a <a for=/>response</a>.
4729
4770
4730
4771
<p> is true; otherwise false.
4731
4772
4773
+ <li><p> If <a>Cross-Origin-Embedder-Policy allows credentials</a> with <var> request</var> returns
4774
+ false, then set <var> includeCredentials</var> to false.
4775
+
4732
4776
<li><p> Let <var> contentLength</var> be <var> httpRequest</var> 's <a for=request>body</a>' s
4733
4777
<a for=body>length</a> , if <var> httpRequest</var> 's <a for=request>body</a> is non-null;
4734
4778
otherwise null.
@@ -5095,6 +5139,9 @@ steps. They return a <a for=/>response</a>.
5095
5139
<li><p> If <var> httpRequest</var> 's <a for=request>header list</a> <a for="header list">contains</a>
5096
5140
`<code> Range</code> `, then set <var> response</var> 's <a for=response>range-requested flag</a> .
5097
5141
5142
+ <li><p> Set <var> response</var> 's <a for=response>request-includes-credentials</a> to
5143
+ <var> includeCredentials</var> .
5144
+
5098
5145
<li>
5099
5146
<p> If <var> response</var> 's <a for=response>status</a> is 401, <var>httpRequest</var>' s
5100
5147
<a for=request>response tainting</a> is not "<code> cors</code> ", <var> includeCredentials</var> is
@@ -7959,6 +8006,7 @@ Arkadiusz Michalski,
7959
8006
Arne Johannessen,
7960
8007
Artem Skoretskiy,
7961
8008
Arthur Barstow,
8009
+ Arthur Sonzogni, <!-- ArthurSonzogni; GitHub -->
7962
8010
Asanka Herath,
7963
8011
Axel Rauschmayer,
7964
8012
Ben Kelly,
0 commit comments