~/talk

Trusted Types: A World Without XSS

links:none on file
links:none on file
slides:none on file

Trusted Types blocks DOM XSS by requiring specially created objects (TrustedHTML, TrustedScriptURL) and enforcing them via a CSP header so raw strings cannot be assigned to sinks. Implementation here upgrades an Angular app to v12 and webpack 5, creates a default policy hack to sanitize third‑party markdown, adds a new Angular view for printing instead of document.write, and implements an analytics trusted-script-URL policy. The work takes about eight days part‑time, runs in Chromium, needs a fragile polyfill for other browsers, and ends as a proof‑of‑concept rather than drop‑in production.

AI-written summary · about

  1. 0:00Start
  2. 6:45Easy to create & hard to detect
  3. 7:55How does Trusted Types fix this?
  4. 11:52How do you turn it on?
  5. 12:36How do you create a policy?
  6. 13:24A Trusted Types policy
  7. 18:38Angular's guide
  8. 19:53Webpack lazy loading
  9. 23:21Solution #1: Upgrading to Angular 12
  10. 28:42ngx-markdown
  11. 29:17The 'default' policy
  12. 34:03ngx-print
  13. 42:23Analytics Policy
  14. 46:46Issue #5: TypeScript support
  15. 46:58(Bad) Solution #5: @ts-nocheck
  16. 47:39Issue #5: Supporting not-Chromium
  17. 48:30Locally loading the polyfill
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.