Slide 1

Slide 1 text

Web Platform Security CMS Security Summit, Feb. 2020 Mike West NOT A DIRECTOR, CHROME SECURITY [email protected]

Slide 2

Slide 2 text

Google Vulnerability Reward Program payouts in 2018 youtu.be/DDtM9caQ97I

Slide 3

Slide 3 text

bit.ly/post-spectre-threat-model

Slide 4

Slide 4 text

Injection and Isolation are our focus in 2020.

Slide 5

Slide 5 text

Injection

Slide 6

Slide 6 text

const templateId = location.hash.match(/tplid=([^;&]*)/)[1]; document.head.innerHTML += `` // `https://example.com#tplid=">` => // `https://example.com?name=alert(1)` => DOM XSS Reflected XSS

Slide 7

Slide 7 text

Content-Security-Policy: object-src 'none'; base-uri 'none'; script-src 'nonce-{random}' 'strict-dynamic' ...; Strict CSP bit.ly/strict-csp

Slide 8

Slide 8 text

Strict CSP bit.ly/strict-csp Content-Security-Policy: object-src 'none'; base-uri 'none'; script-src 'nonce-ABCDEFG' 'strict-dynamic' …; doAmazingThings("yay"); // Executes. let s = document.createElement('script'); s.src = "/script.js"; document.body.appendChild(s); // Executes. /* This will not execute. */ /* Nor this. */ /* Nor this. */

Slide 9

Slide 9 text

Trusted Types research.google/pubs/pub42934

Slide 10

Slide 10 text

Trusted Types bit.ly/tt-introduction bit.ly/tt-spec

Slide 11

Slide 11 text

let p = trustedTypes.createPolicy("my-policy", { createHTML: (i) => sanitizerGoesHere(i), createScript: (i) => anotherSanitizer(i), createScriptURL: (i) => allowedURLs(i) }); myDiv.innerHTML = p.createHTML(userInput); eval(p.createScript(moreInput)); scriptEl.src = p.createScriptURL(evenMore); Content-Security-Policy: ... require-trusted-types-for 'script'; trusted-types my-awesome-policy; Trusted Types bit.ly/tt-introduction bit.ly/tt-spec

Slide 12

Slide 12 text

Content-Security-Policy-Report-Only: require-trusted-types-for 'script'; report-uri ...; let p = trustedTypes.createPolicy("my-policy", { createHTML: a=>a, createScript: a=>a, createScriptURL: a=>a }); {"csp-report":{... "violated-directive": "require-trusted-types-for", "blocked-uri": "trusted-types-sink", "line-number": 128, "column-number": 73, "source-file": "https://example.site/a.html", "script-sample": "Element.innerHTML console.log('Hello');", ...}} Trusted Types bit.ly/tt-introduction bit.ly/tt-spec

Slide 13

Slide 13 text

Scripting-Policy: nonce="ABCDEFG", require-trusted-types-for=(script) Scripting Policy (WIP) bit.ly/scripting-policy

Slide 14

Slide 14 text

Isolation

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Cross-Origin Resource Policy Cross-Origin-Resource-Policy: same-origin a.com/js a.com sub.a.com b.com bit.ly/corp-spec

Slide 20

Slide 20 text

Cross-Origin Resource Policy Cross-Origin-Resource-Policy: same-site a.com/js a.com sub.a.com b.com bit.ly/corp-spec

Slide 21

Slide 21 text

Cross-Origin Resource Policy bit.ly/corp-spec Cross-Origin-Resource-Policy: cross-site a.com/js a.com sub.a.com b.com

Slide 22

Slide 22 text

Cross-Origin Resource Policy Cross-Origin-Resource-Policy: same-origin bit.ly/corp-spec

Slide 23

Slide 23 text

Please, set CORP headers for known cross-site responses.

Slide 24

Slide 24 text

Cross-Origin Embedder Policy bit.ly/coep-spec Cross-Origin-Embedder-Policy: require-corp a.com a.com sub.a.com b.com CORP: same-origin CORP: same-site CORP: cross-site b.com

Slide 25

Slide 25 text

COEP will be required when using APIs that amplify side-channel attacks.

Slide 26

Slide 26 text

// Top-level navigation Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: same-origin Sec-Fetch-User: ?1 // Sec-Fetch-Dest: image Sec-Fetch-Mode: no-cors Sec-Fetch-Site: cross-site Fetch Metadata bit.ly/fm-spec bit.ly/fm-policies Artur Janc 10:00ish tomorrow. Cross-Origin-Opener-Policy: same-origin; report-to=endpoint Cross-Origin Opener Policy bit.ly/coop-spec

Slide 27

Slide 27 text

Securer Contexts (WIP)

Slide 28

Slide 28 text

TLS is an insufficient baseline in 2020. Isolation is critical. bit.ly/securer-contexts

Slide 29

Slide 29 text

Thanks! @mikewest [email protected]