Skip to content

Commit 00c558c

Browse files
committed
More fetch metadata.
1 parent 1ebb4b0 commit 00c558c

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

index.bs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ urlPrefix: https://tc39.es/ecma262/; spec: ECMA262; type: interface
2929
text: SharedArrayBuffer; url: #sec-sharedarraybuffer-objects
3030
urlPrefix: https://tools.ietf.org/html/rfc7231; spec: RFC7231; type: http-header
3131
text: Vary; url: #section-7.1.4
32+
urlPrefix: https://fetch.spec.whatwg.org/; spec: FETCH; type: http-header
33+
text: Origin; url: #origin-header
3234
</pre>
3335
<pre class="biblio">
3436
{
@@ -226,26 +228,29 @@ ISSUE: [[COI-THREAT-MODEL]] spells out more implications. Bring them in here for
226228
TL;DR {#tldr}
227229
-------------
228230

229-
1. **Restrict attackers' ability to load your data as a subresource** by setting a
230-
[=cross-origin resource policy=] (CORP) (default to `same-origin`, opening up to `same-site`
231-
or `cross-origin` only when necessary), and by making good decisions about when to enable access
232-
via CORS.
231+
1. **Decide when (not!) to respond to requests** by examining incoming headers, paying special
232+
attention to the <a http-header>`Origin`</a> header on the one hand, and various `Sec-Fetch-`
233+
prefixed headers on the other, as described in [[resource-isolation-policy]].
233234

234-
2. **Restrict attackers' ability to frame your data as a document** by opt-ing into framing
235+
2. **Restrict attackers' ability to load your data as a subresource** by setting a
236+
[=cross-origin resource policy=] (CORP) of `same-origin` (opening up to `same-site`
237+
or `cross-origin` only when necessary).
238+
239+
3. **Restrict attackers' ability to frame your data as a document** by opt-ing into framing
235240
protections via `X-Frame-Options: SAMEORIGIN` or CSP's more granular [=frame-ancestors=]
236241
directive (`frame-ancestors 'self' https://trusted.embedder`, for example).
237242

238-
3. **Restrict attackers' ability to obtain a handle to your window** by setting a
243+
4. **Restrict attackers' ability to obtain a handle to your window** by setting a
239244
[=cross-origin opener policy=] (COOP). In the best case, you can default to a restrictive
240245
`same-origin` value, opening up to `same-origin-allow-popups` or `unsafe-none` only if
241246
necessary.
242247

243-
4. **Prevent MIME-type confusion attacks** and increase the robustness of passive defenses like
248+
5. **Prevent MIME-type confusion attacks** and increase the robustness of passive defenses like
244249
[=cross-origin read blocking=] (CORB) /
245250
<a href="https://github.com/annevk/orb">opaque response blocking</a> ([[ORB]]) by setting
246-
`X-Content-Type-Options: nosniff` on all your responses.
251+
correct `Content-Type` headers, and globally asserting `X-Content-Type-Options: nosniff`.
247252

248-
ISSUE: Actually describe mitigations, swiping liberally from
253+
ISSUE: Describe these mitigations in more depth, swiping liberally from
249254
<a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of *cross-origin isolation*</a>,
250255
<a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.
251256

index.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@
14861486
</style>
14871487
<meta content="Bikeshed version c5172e83, updated Fri Nov 20 15:35:20 2020 -0800" name="generator">
14881488
<link href="https://mikewest.github.io/post-spectre-webdev/" rel="canonical">
1489-
<meta content="00ccca50d4a466befbe24ffec0f800a75176244a" name="document-revision">
1489+
<meta content="1ebb4b0e577bdbe3499bc6f59b4dd2c89a0eaa11" name="document-revision">
14901490
<style>/* style-autolinks */
14911491

14921492
.css.css, .property.property, .descriptor.descriptor {
@@ -2174,18 +2174,21 @@ <h3 class="heading settled" data-level="1.1" id="threat-model"><span class="secn
21742174
<h3 class="heading settled" data-level="1.2" id="tldr"><span class="secno">1.2. </span><span class="content">TL;DR</span><a class="self-link" href="#tldr"></a></h3>
21752175
<ol>
21762176
<li data-md>
2177-
<p><strong>Restrict attackers' ability to load your data as a subresource</strong> by setting a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#http-cross-origin-resource-policy" id="ref-for-http-cross-origin-resource-policy">cross-origin resource policy</a> (CORP) (default to <code>same-origin</code>, opening up to <code>same-site</code> or <code>cross-origin</code> only when necessary), and by making good decisions about when to enable access
2178-
via CORS.</p>
2177+
<p><strong>Decide when (not!) to respond to requests</strong> by examining incoming headers, paying special
2178+
attention to the <a data-link-type="http-header" href="https://fetch.spec.whatwg.org/#origin-header" id="ref-for-origin-header"><code>Origin</code></a> header on the one hand, and various <code>Sec-Fetch-</code> prefixed headers on the other, as described in <a data-link-type="biblio" href="#biblio-resource-isolation-policy">[resource-isolation-policy]</a>.</p>
2179+
<li data-md>
2180+
<p><strong>Restrict attackers' ability to load your data as a subresource</strong> by setting a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#http-cross-origin-resource-policy" id="ref-for-http-cross-origin-resource-policy">cross-origin resource policy</a> (CORP) of <code>same-origin</code> (opening up to <code>same-site</code> or <code>cross-origin</code> only when necessary).</p>
21792181
<li data-md>
21802182
<p><strong>Restrict attackers' ability to frame your data as a document</strong> by opt-ing into framing
21812183
protections via <code>X-Frame-Options: SAMEORIGIN</code> or CSP’s more granular <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/#frame-ancestors" id="ref-for-frame-ancestors">frame-ancestors</a> directive (<code>frame-ancestors 'self' https://trusted.embedder</code>, for example).</p>
21822184
<li data-md>
21832185
<p><strong>Restrict attackers' ability to obtain a handle to your window</strong> by setting a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policies" id="ref-for-cross-origin-opener-policies">cross-origin opener policy</a> (COOP). In the best case, you can default to a restrictive <code>same-origin</code> value, opening up to <code>same-origin-allow-popups</code> or <code>unsafe-none</code> only if
21842186
necessary.</p>
21852187
<li data-md>
2186-
<p><strong>Prevent MIME-type confusion attacks</strong> and increase the robustness of passive defenses like <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#corb" id="ref-for-corb">cross-origin read blocking</a> (CORB) / <a href="https://github.com/annevk/orb">opaque response blocking</a> (<a data-link-type="biblio" href="#biblio-orb">[ORB]</a>) by setting <code>X-Content-Type-Options: nosniff</code> on all your responses.</p>
2188+
<p><strong>Prevent MIME-type confusion attacks</strong> and increase the robustness of passive defenses like <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#corb" id="ref-for-corb">cross-origin read blocking</a> (CORB) / <a href="https://github.com/annevk/orb">opaque response blocking</a> (<a data-link-type="biblio" href="#biblio-orb">[ORB]</a>) by setting
2189+
correct <code>Content-Type</code> headers, and globally asserting <code>X-Content-Type-Options: nosniff</code>.</p>
21872190
</ol>
2188-
<p class="issue" id="issue-26c425e2"><a class="self-link" href="#issue-26c425e2"></a> Actually describe mitigations, swiping liberally from <a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of <em>cross-origin isolation</em></a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.</p>
2191+
<p class="issue" id="issue-db0b0c7b"><a class="self-link" href="#issue-db0b0c7b"></a> Describe these mitigations in more depth, swiping liberally from <a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of <em>cross-origin isolation</em></a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.</p>
21892192
<h2 class="heading settled" data-level="2" id="examples"><span class="secno">2. </span><span class="content">Practical Examples</span><a class="self-link" href="#examples"></a></h2>
21902193
<h3 class="heading settled" data-level="2.1" id="subresources"><span class="secno">2.1. </span><span class="content">Subresources</span><a class="self-link" href="#subresources"></a></h3>
21912194
<p>Resources which are intended to be loaded into documents should protect themselves from being used
@@ -2644,6 +2647,12 @@ <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index
26442647
<li><a href="#ref-for-http-cross-origin-resource-policy①">2.1.2. Dynamic Subresources</a>
26452648
</ul>
26462649
</aside>
2650+
<aside class="dfn-panel" data-for="term-for-origin-header">
2651+
<a href="https://fetch.spec.whatwg.org/#origin-header">https://fetch.spec.whatwg.org/#origin-header</a><b>Referenced in:</b>
2652+
<ul>
2653+
<li><a href="#ref-for-origin-header">1.2. TL;DR</a>
2654+
</ul>
2655+
</aside>
26472656
<aside class="dfn-panel" data-for="term-for-http-x-content-type-options">
26482657
<a href="https://fetch.spec.whatwg.org/#http-x-content-type-options">https://fetch.spec.whatwg.org/#http-x-content-type-options</a><b>Referenced in:</b>
26492658
<ul>
@@ -2714,6 +2723,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
27142723
<li><span class="dfn-paneled" id="term-for-corb">cross-origin read blocking</span>
27152724
<li><span class="dfn-paneled" id="term-for-http-cross-origin-resource-policy">cross-origin resource policy</span>
27162725
<li><span class="dfn-paneled" id="term-for-http-cross-origin-resource-policy①">cross-origin-resource-policy</span>
2726+
<li><span class="dfn-paneled" id="term-for-origin-header">origin</span>
27172727
<li><span class="dfn-paneled" id="term-for-http-x-content-type-options">x-content-type-options</span>
27182728
</ul>
27192729
<li>
@@ -2789,7 +2799,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
27892799
<div style="counter-reset:issue">
27902800
<div class="issue"> Propose this to WebAppSec.<a href="#issue-bdf75540"></a></div>
27912801
<div class="issue"> <a data-link-type="biblio" href="#biblio-coi-threat-model">[COI-THREAT-MODEL]</a> spells out more implications. Bring them in here for more nuance.<a href="#issue-340f57a5"></a></div>
2792-
<div class="issue"> Actually describe mitigations, swiping liberally from <a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of <em>cross-origin isolation</em></a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.<a href="#issue-26c425e2"></a></div>
2802+
<div class="issue"> Describe these mitigations in more depth, swiping liberally from <a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of <em>cross-origin isolation</em></a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.<a href="#issue-db0b0c7b"></a></div>
27932803
<div class="issue"> If we implemented more granular bindings for CORP headers (along
27942804
the lines of <code>Cross-Origin-Resource-Policy: https://trusted.example</code>), we could avoid this
27952805
tradeoff entirely. <a href="https://github.com/whatwg/fetch/issues/760">&lt;https://github.com/whatwg/fetch/issues/760></a><a href="#issue-ae9c0065"></a></div>

0 commit comments

Comments
 (0)