Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Taking Trusted Types to Production: Angular Policies, Third-Party Libraries and Baseline 2026
Trusted Types makes DOM sinks accept only typed objects produced by an allowed policy instead of plain strings; even writing the result of DomSanitizer.sanitize to innerHTML is a violation. In this post we verify Angular's policy names in node_modules, build an inventory with Report-Only, resolve DOMPurify, loader and third-party script violations, show the danger of the default policy and summarize support, which became Baseline 2026 with Firefox 148.
A DOM XSS Sink Inventory for Angular: ElementRef, Renderer2, Dynamic URLs, HTML-Producing Libraries and a Code Review Checklist
Angular only sanitizes its own template bindings; ElementRef.nativeElement, Renderer2.setProperty/setAttribute, insertAdjacentHTML, dynamic script and iframe sources and HTML-producing libraries are unprotected. In this post we show these sinks in headless Chrome, fix them with the template and DomSanitizer, compare marked, DOMPurify and setHTML, and build a grep and ESLint based code review checklist.