@@ -1548,10 +1548,15 @@ Unless stated otherwise, it is unset.
1548
1548
<p> A <a for=/>request</a> has an associated <dfn export for=request id=done-flag>done flag</dfn> .
1549
1549
Unless stated otherwise, it is unset.
1550
1550
1551
+ <p> A <a for=/>request</a> has an associated
1552
+ <dfn export for=request id=timing-allow-failed>timing allow failed flag</dfn> . Unless stated
1553
+ otherwise, it is unset.
1554
+
1551
1555
<p class="note no-backref"> A <a for=/>request</a> 's <a for=request>tainted origin flag</a> ,
1552
1556
<a for=request>URL list</a> , <a for=request>current URL</a> , <a for=request>redirect count</a> ,
1553
- <a for=request>response tainting</a> , and <a for=request>done flag</a> are used as bookkeeping
1554
- details by the <a for=/>fetch</a> algorithm.
1557
+ <a for=request>response tainting</a> , <a for=request>done flag</a> , and
1558
+ <a for=request>timing allow failed flag</a> are used as bookkeeping details by the
1559
+ <a for=/>fetch</a> algorithm.
1555
1560
1556
1561
<hr>
1557
1562
@@ -1585,12 +1590,16 @@ run these steps:
1585
1590
1586
1591
<ol>
1587
1592
<li><p> If <var> request</var> 's <a for=request>tainted origin flag</a> is set, then return
1588
- ` <code> null</code> ` .
1593
+ " <code> null</code> " .
1589
1594
1590
1595
<li><p> Return <var> request</var> 's <a for=request>origin</a> ,
1591
- <a lt="ASCII serialization of an origin">serialized</a> and <a>isomorphic encoded</a> .
1596
+ <a lt="ASCII serialization of an origin">serialized</a> .
1592
1597
</ol>
1593
1598
1599
+ <p> <dfn>Byte-serializing a request origin</dfn> , given a <a for=/>request</a> <var> request</var> ,
1600
+ is to return the result of <a>serializing a request origin</a> with <var> request</var> ,
1601
+ <a>isomorphic encoded</a> .
1602
+
1594
1603
<hr>
1595
1604
1596
1605
<p> To <dfn export for=request id=concept-request-clone>clone</dfn> a
@@ -1800,6 +1809,15 @@ initially unset.
1800
1809
being provided to an API that didn't make a range request. See the flag's usage for a detailed
1801
1810
description of the attack.
1802
1811
1812
+ <p> A <a for=/>response</a> has an associated
1813
+ <dfn for=response id=concept-response-timing-allow-passed>timing allow passed flag</dfn> , which is
1814
+ initially unset.
1815
+
1816
+ <p class=note> This is used so that the caller to a fetch can determine if sensitive timing data is
1817
+ allowed on the resource fetched by looking at the flag of the response returned. Because the flag on
1818
+ the response of a redirect has to be set if it was set for previous responses in the redirect chain,
1819
+ this is also tracked internally using the request's <a for=request>timing allow failed flag</a> .
1820
+
1803
1821
<p> A <a for=/>response</a> can have an associated
1804
1822
<dfn export for=response id=concept-response-location-url>location URL</dfn> (null, failure, or a
1805
1823
<a for=/>URL</a> ). Unless specified otherwise, <a for=/>response</a> has no
@@ -2415,8 +2433,8 @@ origin = <a for=url>scheme</a> "://" <a for=url>host</
2415
2433
given a <a for=/>request</a> <var> request</var> , run these steps:
2416
2434
2417
2435
<ol>
2418
- <li><p> Let <var> serializedOrigin</var> be the result of <a>serializing a request origin</a> with
2419
- <var> request</var> .
2436
+ <li><p> Let <var> serializedOrigin</var> be the result of <a>byte- serializing a request origin</a>
2437
+ with <var> request</var> .
2420
2438
2421
2439
<li><p> If <var> request</var> 's <a for=request>response tainting</a> is "<code> cors</code> " or
2422
2440
<var> request</var> 's <a for=request>mode</a> is "<code> websocket</code> ", then
@@ -3526,6 +3544,9 @@ optionally with a <i>recursive flag</i>, run these steps:
3526
3544
<!-- If you are ever tempted to move this around, carefully consider responses from about URLs,
3527
3545
blob URLs, service workers, HTTP cache, HTTP network, etc. -->
3528
3546
3547
+ <li><p> If <var> request</var> 's <a for=request>timing allow failed flag</a> is unset, then set
3548
+ <var> internalResponse</var> 's <a for=response>timing allow passed flag</a> .
3549
+
3529
3550
<li><p> <a href=https://w3c.github.io/webappsec-csp/#set-response-csp-list>Set <var>internalResponse</var>'s CSP list</a> .
3530
3551
[[!CSP]]
3531
3552
@@ -3892,6 +3913,9 @@ optional <i>CORS-preflight flag</i>, run these steps:
3892
3913
<p class="note no-backref"> As the <a>CORS check</a> is not to be applied to
3893
3914
<a for=/>responses</a> whose <a for=response>status</a> is <code> 304</code> or <code> 407</code> ,
3894
3915
or <a for=/>responses</a> from a service worker for that matter, it is applied here.
3916
+
3917
+ <li><p> If the <a>TAO check</a> for <var> request</var> and <var> response</var> returns failure,
3918
+ then set <var> request</var> 's <a for=request>timing allow failed flag</a> .
3895
3919
</ol>
3896
3920
3897
3921
<li>
@@ -4943,7 +4967,7 @@ run these steps:
4943
4967
<p> A <dfn>cache entry</dfn> consists of:
4944
4968
4945
4969
<ul class=brief>
4946
- <li> <dfn id=concept-cache-origin for="cache entry">serialized origin</dfn> (a
4970
+ <li> <dfn id=concept-cache-origin for="cache entry">byte- serialized origin</dfn> (a
4947
4971
<a for=/>byte sequence</a> )
4948
4972
<li> <dfn id=concept-cache-url for="cache entry">URL</dfn> (a <a for=/>URL</a> )
4949
4973
<li> <dfn id=concept-cache-max-age for="cache entry">max-age</dfn> (a number of seconds)
@@ -4966,8 +4990,8 @@ be removed before that moment arrives.
4966
4990
<p> Let <var> entry</var> be a <a>cache entry</a> , initialized as follows:
4967
4991
4968
4992
<dl>
4969
- <dt> <a for="cache entry">serialized origin</a>
4970
- <dd><p> The result of <a>serializing a request origin</a> with <var> request</var>
4993
+ <dt> <a for="cache entry">byte- serialized origin</a>
4994
+ <dd><p> The result of <a>byte- serializing a request origin</a> with <var> request</var>
4971
4995
4972
4996
<dt> <a for="cache entry">URL</a>
4973
4997
<dd><p><var> request</var> 's <a for=request>current URL</a>
@@ -4991,15 +5015,15 @@ be removed before that moment arrives.
4991
5015
4992
5016
<p> To <dfn id=concept-cache-clear>clear cache entries</dfn> , given a <var> request</var> ,
4993
5017
<a for=list>remove</a> any <a>cache entries</a> in the user agent's <a>CORS-preflight cache</a>
4994
- whose <a for="cache entry">serialized origin</a> is the result of
4995
- <a>serializing a request origin</a> with <var> request</var> and whose <a for="cache entry">URL</a>
4996
- is <var> request</var> 's <a for=request>current URL</a> .
5018
+ whose <a for="cache entry">byte- serialized origin</a> is the result of
5019
+ <a>byte- serializing a request origin</a> with <var> request</var> and whose
5020
+ <a for="cache entry">URL</a> is <var> request</var> 's <a for=request>current URL</a> .
4997
5021
4998
5022
<p> There is a <dfn id=concept-cache-match>cache entry match</dfn> for a <a>cache entry</a>
4999
5023
<var> entry</var> with <var> request</var> if <var> entry</var> 's
5000
- <a for="cache entry">serialized origin</a> is the result of <a>serializing a request origin</a> with
5001
- <var> request</var> , <var> entry </var> 's <a for="cache entry">URL</a> is < var>request </var>' s
5002
- <a for=request>current URL</a> , and one of
5024
+ <a for="cache entry">byte- serialized origin</a> is the result of
5025
+ <a>byte-serializing a request origin</a> with <var> request </var> , < var>entry </var> 's
5026
+ <a for="cache entry">URL</a> is <var> request </var> 's <a for= request>current URL</a> , and one of
5003
5027
5004
5028
<ul class=brief>
5005
5029
<li><var> entry</var> 's <a for="cache entry">credentials</a> is true
@@ -5047,7 +5071,7 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
5047
5071
<li><p> If <var> request</var> 's <a for=request>credentials mode</a> is not "<code> include</code> "
5048
5072
and <var> origin</var> is `<code> *</code> `, then return success.
5049
5073
5050
- <li><p> If the result of <a>serializing a request origin</a> with <var> request</var> is not
5074
+ <li><p> If the result of <a>byte- serializing a request origin</a> with <var> request</var> is not
5051
5075
<var> origin</var> , then return failure.
5052
5076
5053
5077
<li><p> If <var> request</var> 's <a for=request>credentials mode</a> is not "<code> include</code> ",
@@ -5063,6 +5087,31 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
5063
5087
</ol>
5064
5088
5065
5089
5090
+ <h3 id=tao-check>TAO check</h3>
5091
+
5092
+ <p> To perform a <dfn id=concept-tao-check>TAO check</dfn> for a <var> request</var> and
5093
+ <var> response</var> , run these steps:
5094
+
5095
+ <ol>
5096
+ <li><p> If <var> request</var> 's <a for=request>timing allow failed flag</a> is set, then return
5097
+ failure.
5098
+
5099
+ <li><p> If <var> request</var> 's <a for=request>response tainting</a> is "<code> basic</code> ", then
5100
+ return success.
5101
+
5102
+ <li><p> Let <var> values</var> be the result of
5103
+ <a for="header list">getting, decoding, and splitting</a> `<code> Timing-Allow-Origin</code> ` from
5104
+ <var> response</var> 's <a for=response>header list</a> .
5105
+
5106
+ <li><p> If <var> values</var> <a for=list>contains</a> "<code> *</code> ", then return success.
5107
+
5108
+ <li><p> If <var> values</var> <a for=list>contains</a> the result of
5109
+ <a>serializing a request origin</a> with <var> request</var> , then return success.
5110
+
5111
+ <li><p> Return failure.
5112
+ </ol>
5113
+
5114
+
5066
5115
5067
5116
<h2 id=fetch-api>Fetch API</h2>
5068
5117
@@ -7196,6 +7245,7 @@ Mohammed Zubair Ahmed<!-- M-ZubairAhmed; GitHub -->,
7196
7245
Moritz Kneilmann,
7197
7246
Ms2ger,
7198
7247
Nico Schlömer,
7248
+ Nicolás Peña Moreno,
7199
7249
Nikhil Marathe,
7200
7250
Nikki Bee,
7201
7251
Nikunj Mehta,
0 commit comments