|
1486 | 1486 | </style>
|
1487 | 1487 | <meta content="Bikeshed version c5172e83, updated Fri Nov 20 15:35:20 2020 -0800" name="generator">
|
1488 | 1488 | <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"> |
1490 | 1490 | <style>/* style-autolinks */
|
1491 | 1491 |
|
1492 | 1492 | .css.css, .property.property, .descriptor.descriptor {
|
@@ -2174,18 +2174,21 @@ <h3 class="heading settled" data-level="1.1" id="threat-model"><span class="secn
|
2174 | 2174 | <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>
|
2175 | 2175 | <ol>
|
2176 | 2176 | <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> |
2179 | 2181 | <li data-md>
|
2180 | 2182 | <p><strong>Restrict attackers' ability to frame your data as a document</strong> by opt-ing into framing
|
2181 | 2183 | 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>
|
2182 | 2184 | <li data-md>
|
2183 | 2185 | <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
|
2184 | 2186 | necessary.</p>
|
2185 | 2187 | <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> |
2187 | 2190 | </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> |
2189 | 2192 | <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>
|
2190 | 2193 | <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>
|
2191 | 2194 | <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
|
2644 | 2647 | <li><a href="#ref-for-http-cross-origin-resource-policy①">2.1.2. Dynamic Subresources</a>
|
2645 | 2648 | </ul>
|
2646 | 2649 | </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> |
2647 | 2656 | <aside class="dfn-panel" data-for="term-for-http-x-content-type-options">
|
2648 | 2657 | <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>
|
2649 | 2658 | <ul>
|
@@ -2714,6 +2723,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
|
2714 | 2723 | <li><span class="dfn-paneled" id="term-for-corb">cross-origin read blocking</span>
|
2715 | 2724 | <li><span class="dfn-paneled" id="term-for-http-cross-origin-resource-policy">cross-origin resource policy</span>
|
2716 | 2725 | <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> |
2717 | 2727 | <li><span class="dfn-paneled" id="term-for-http-x-content-type-options">x-content-type-options</span>
|
2718 | 2728 | </ul>
|
2719 | 2729 | <li>
|
@@ -2789,7 +2799,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
|
2789 | 2799 | <div style="counter-reset:issue">
|
2790 | 2800 | <div class="issue"> Propose this to WebAppSec.<a href="#issue-bdf75540"> ↵ </a></div>
|
2791 | 2801 | <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> |
2793 | 2803 | <div class="issue"> If we implemented more granular bindings for CORP headers (along
|
2794 | 2804 | the lines of <code>Cross-Origin-Resource-Policy: https://trusted.example</code>), we could avoid this
|
2795 | 2805 | tradeoff entirely. <a href="https://github.com/whatwg/fetch/issues/760"><https://github.com/whatwg/fetch/issues/760></a><a href="#issue-ae9c0065"> ↵ </a></div>
|
|
0 commit comments