Skip to content

Commit ed11a2d

Browse files
committed
Marginally more detail. +ORB.
1 parent dacd09f commit ed11a2d

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

index.bs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ urlPrefix: https://html.spec.whatwg.org/; spec: HTML; type: dfn
2020
text: cross-origin embedder policy; url: multipage/origin.html#coep
2121
urlPrefix: https://fetch.spec.whatwg.org/; spec: FETCH; type: dfn
2222
text: cross-origin resource policy; url: #http-cross-origin-resource-policy
23+
text: cross-origin read blocking; url: #corb
2324
urlPrefix: https://tc39.es/ecma262/; spec: ECMA262; type: interface
2425
text: SharedArrayBuffer; url: #sec-sharedarraybuffer-objects
2526
</pre>
@@ -128,6 +129,11 @@ urlPrefix: https://tc39.es/ecma262/; spec: ECMA262; type: interface
128129
"title": "Notes on the threat model of cross-origin isolation",
129130
"authors": [ "Artur Janc" ],
130131
"date": "2020-12"
132+
},
133+
"orb": {
134+
"href": "https://github.com/annevk/orb",
135+
"title": "Opaque Response Blocking (ORB, aka CORB++)",
136+
"authors": [ "Anne van Kesteren" ]
131137
}
132138
}
133139
</pre>
@@ -163,7 +169,7 @@ Spectre-like side-channel attacks inexorably lead to a model in which active web
163169
has entered the address space of the process which hosts it. While this has deep implications for
164170
user agent implementations' internal hardening strategies (stack canaries, ASLR, etc), here we'll
165171
remain focused on the core implication at the web platform level, which is both simple and profound:
166-
any data which flows into an origin's process is legible to that origin. We must design accordingly.
172+
any data which flows into an origin's process is legible to that origin. We m)ust design accordingly.
167173

168174
In order to determine the scope of data that can be assumed accessible to an attacker, we must make
169175
a few assumptions about the normally-not-web-exposed process model which the user agent implements.
@@ -193,24 +199,26 @@ TL;DR {#tldr}
193199
-------------
194200

195201
1. **Restrict attackers' ability to load your data as a subresource** by setting a
196-
[=cross-origin resource policy=] (CORP). In the best case, you can default to a restrictive
197-
`same-origin` value, opening up to `same-site` or `cross-origin` only in cases where you expect
198-
the resource to be used beyond your origin.
202+
[=cross-origin resource policy=] (CORP) (default to `same-origin`, opening up to `same-site`
203+
or `cross-origin` only when necessary), and by making good decisions about when to enable access
204+
via CORS.
199205

200206
2. **Restrict attackers' ability to frame your data as a document** by opt-ing into framing
201207
protections via `X-Frame-Options: SAMEORIGIN` or CSP's more granular [=frame-ancestors=]
202-
directive.
208+
directive (`frame-ancestors 'self' https://trusted.embedder`, for example).
203209

204210
3. **Restrict attackers' ability to obtain a handle to your window** by setting a
205211
[=cross-origin opener policy=] (COOP). In the best case, you can default to a restrictive
206212
`same-origin` value, opening up to `same-origin-allow-popups` or `unsafe-none` only if
207213
necessary.
208214

209-
4. **Prevent MIME-type confusion attacks** by setting `X-Content-Type-Options: nosniff` on all
210-
your responses.
215+
4. **Prevent MIME-type confusion attacks** and increase the robustness of passive defenses like
216+
[=cross-origin read blocking=] (CORB) /
217+
<a href="https://github.com/annevk/orb">opaque response blocking</a> ([[ORB]]) by setting
218+
`X-Content-Type-Options: nosniff` on all your responses.
211219

212220
ISSUE: Actually describe mitigations, swiping liberally from
213-
<a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of _cross-origin isolation_</a>,
221+
<a href="https://docs.google.com/document/d/1JBUaX1xSOZRxBk5bRNZWgnzyJoCQC52TIRokACBSmGc/edit?resourcekey=0-cZ7da6v52enjwRSsp_tLyQ">Notes on the threat model of *cross-origin isolation*</a>,
214222
<a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.
215223

216224
Practical Examples {#examples}
@@ -227,7 +235,6 @@ to making these resources widely available, and value in allowing embedders to r
227235
something like the following response headers could be appropriate:
228236

229237
<pre highlight="http">
230-
HTTP/1.1 200 OK
231238
Access-Control-Allow-Origin: *
232239
Cross-Origin-Resource-Policy: cross-origin
233240
Timing-Allow-Origin: *

index.html

Lines changed: 21 additions & 14 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="ce8b4ea16297e163777fa8761db9494f4ffdba7f" name="document-revision">
1489+
<meta content="dacd09ff803c8e9e3bf8d1c3ab609740dd21ed0c" name="document-revision">
14901490
<style>/* style-autolinks */
14911491

14921492
.css.css, .property.property, .descriptor.descriptor {
@@ -2136,7 +2136,7 @@ <h3 class="heading settled" data-level="1.1" id="threat-model"><span class="secn
21362136
has entered the address space of the process which hosts it. While this has deep implications for
21372137
user agent implementations' internal hardening strategies (stack canaries, ASLR, etc), here we’ll
21382138
remain focused on the core implication at the web platform level, which is both simple and profound:
2139-
any data which flows into an origin’s process is legible to that origin. We must design accordingly.</p>
2139+
any data which flows into an origin’s process is legible to that origin. We m)ust design accordingly.</p>
21402140
<p>In order to determine the scope of data that can be assumed accessible to an attacker, we must make
21412141
a few assumptions about the normally-not-web-exposed process model which the user agent implements.
21422142
The following seems like a good place to start:</p>
@@ -2162,31 +2162,29 @@ <h3 class="heading settled" data-level="1.1" id="threat-model"><span class="secn
21622162
<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>
21632163
<ol>
21642164
<li data-md>
2165-
<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). In the best case, you can default to a restrictive <code>same-origin</code> value, opening up to <code>same-site</code> or <code>cross-origin</code> only in cases where you expect
2166-
the resource to be used beyond your origin.</p>
2165+
<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
2166+
via CORS.</p>
21672167
<li data-md>
21682168
<p><strong>Restrict attackers' ability to frame your data as a document</strong> by opt-ing into framing
2169-
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.</p>
2169+
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>
21702170
<li data-md>
21712171
<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
21722172
necessary.</p>
21732173
<li data-md>
2174-
<p><strong>Prevent MIME-type confusion attacks</strong> by setting <code>X-Content-Type-Options: nosniff</code> on all
2175-
your responses.</p>
2174+
<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>
21762175
</ol>
2177-
<p class="issue" id="issue-32803971"><a class="self-link" href="#issue-32803971"></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 _cross-origin isolation_</a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.</p>
2176+
<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>
21782177
<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>
21792178
<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>
21802179
<h4 class="heading settled" data-level="2.1.1" id="static-subresources"><span class="secno">2.1.1. </span><span class="content">Static Subresources</span><a class="self-link" href="#static-subresources"></a></h4>
21812180
<p>By their nature, static resources contain the same data no matter who requests them, and therefore
21822181
cannot contain interesting information that an attacker couldn’t otherwise obtain. There’s no risk
21832182
to making these resources widely available, and value in allowing embedders to robustly debug, so
21842183
something like the following response headers could be appropriate:</p>
2185-
<pre class="highlight"><c- kr>HTTP</c-><c- o>/</c-><c- m>1.1</c-> <c- m>200</c-> <c- ne>OK</c->
2186-
<c- e>Access-Control-Allow-Origin</c-><c- o>:</c-> <c- l>*</c->
2187-
<c- e>Cross-Origin-Resource-Policy</c-><c- o>:</c-> <c- l>cross-origin</c->
2188-
<c- e>Timing-Allow-Origin</c-><c- o>:</c-> <c- l>*</c->
2189-
<c- e>X-Content-Type-Options</c-><c- o>:</c-> <c- l>nosniff</c->
2184+
<pre class="highlight">Access-Control-Allow-Origin: *
2185+
Cross-Origin-Resource-Policy: cross-origin
2186+
Timing-Allow-Origin: *
2187+
X-Content-Type-Options: nosniff
21902188
</pre>
21912189
<p>(Given these resources' characteristics, there’s little risk in allowing them to be embedded in
21922190
frames, but likely also little value. Unless there’s a good reason to allow framing these
@@ -2534,6 +2532,12 @@ <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index
25342532
<li><a href="#ref-for-sec-sharedarraybuffer-objects">2.2.1. Fully-Isolated Documents</a>
25352533
</ul>
25362534
</aside>
2535+
<aside class="dfn-panel" data-for="term-for-corb">
2536+
<a href="https://fetch.spec.whatwg.org/#corb">https://fetch.spec.whatwg.org/#corb</a><b>Referenced in:</b>
2537+
<ul>
2538+
<li><a href="#ref-for-corb">1.2. TL;DR</a>
2539+
</ul>
2540+
</aside>
25372541
<aside class="dfn-panel" data-for="term-for-http-cross-origin-resource-policy">
25382542
<a href="https://fetch.spec.whatwg.org/#http-cross-origin-resource-policy">https://fetch.spec.whatwg.org/#http-cross-origin-resource-policy</a><b>Referenced in:</b>
25392543
<ul>
@@ -2573,6 +2577,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
25732577
<li>
25742578
<a data-link-type="biblio">[FETCH]</a> defines the following terms:
25752579
<ul>
2580+
<li><span class="dfn-paneled" id="term-for-corb">cross-origin read blocking</span>
25762581
<li><span class="dfn-paneled" id="term-for-http-cross-origin-resource-policy">cross-origin resource policy</span>
25772582
</ul>
25782583
<li>
@@ -2609,6 +2614,8 @@ <h3 class="no-num no-ref heading settled" id="informative"><span class="content"
26092614
<dd>Charlie Reis; Camille Lamy. <a href="https://docs.google.com/document/d/1Ey3MXcLzwR1T7aarkpBXEwP7jKdd2NvQdgYvF8_8scI/edit">Cross-Origin-Opener-Policy Explainer</a>. 2020-05-24. URL: <a href="https://docs.google.com/document/d/1Ey3MXcLzwR1T7aarkpBXEwP7jKdd2NvQdgYvF8_8scI/edit">https://docs.google.com/document/d/1Ey3MXcLzwR1T7aarkpBXEwP7jKdd2NvQdgYvF8_8scI/edit</a>
26102615
<dt id="biblio-long-term-mitigations">[LONG-TERM-MITIGATIONS]
26112616
<dd>Charlie Reis. <a href="https://docs.google.com/document/d/1dnUjxfGWnvhQEIyCZb0F2LmCZ9gio6ogu2rhMGqi6gY/edit">Long-Term Web Browser Mitigations for Spectre</a>. 2019-03-04. URL: <a href="https://docs.google.com/document/d/1dnUjxfGWnvhQEIyCZb0F2LmCZ9gio6ogu2rhMGqi6gY/edit">https://docs.google.com/document/d/1dnUjxfGWnvhQEIyCZb0F2LmCZ9gio6ogu2rhMGqi6gY/edit</a>
2617+
<dt id="biblio-orb">[ORB]
2618+
<dd>Anne van Kesteren. <a href="https://github.com/annevk/orb">Opaque Response Blocking (ORB, aka CORB++)</a>. URL: <a href="https://github.com/annevk/orb">https://github.com/annevk/orb</a>
26122619
<dt id="biblio-post-spectre-rethink">[POST-SPECTRE-RETHINK]
26132620
<dd>Chromium. <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/security/side-channel-threat-model.md">Post-Spectre Threat Model Re-Think</a>. URL: <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/security/side-channel-threat-model.md">https://chromium.googlesource.com/chromium/src/+/master/docs/security/side-channel-threat-model.md</a>
26142621
<dt id="biblio-project-fission">[PROJECT-FISSION]
@@ -2630,7 +2637,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
26302637
<div style="counter-reset:issue">
26312638
<div class="issue"> Propose this to WebAppSec.<a href="#issue-bdf75540"></a></div>
26322639
<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>
2633-
<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 _cross-origin isolation_</a>, <a href="https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit">Safely reviving shared memory</a>, etc.<a href="#issue-32803971"></a></div>
2640+
<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>
26342641
<div class="issue"> Does <code>Content-Disposition</code> make any sense? <a href="https://github.com/mikewest/post-spectre-webdev/issues/1">&lt;https://github.com/mikewest/post-spectre-webdev/issues/1></a><a href="#issue-830682a1"></a></div>
26352642
<div class="issue"> Find some links.<a href="#issue-94179e25"></a></div>
26362643
<div class="issue"> Find some links.<a href="#issue-94179e25①"></a></div>

0 commit comments

Comments
 (0)