EXERCISE 2 — Grepping a framework codebase for XSS =================================================== WHAT TO GREP FOR: Framework escape hatches (auto-escaping OFF -> must sanitize): React: dangerouslySetInnerHTML Vue: v-html Angular: [innerHTML] , bypassSecurityTrustHtml , bypassSecurityTrustUrl , bypassSecurityTrustResourceUrl , bypassSecurityTrustScript , bypassSecurityTrustStyle Svelte: {@html Lit/others: unsafeHTML , unsafeSVG Raw DOM sinks (framework doesn't protect these at all): .innerHTML = .outerHTML = document.write( document.writeln( insertAdjacentHTML( eval( new Function( setTimeout("..." setInterval("..." location = / location.href = / .src = / .href = (with untrusted data) el.setAttribute('href'/'src', untrusted) (javascript: scheme) jQuery: .html( $(untrusted) .append(untrustedHTMLstring) SSR / template-injection smells: server-side template strings interpolating user data into HTML or into a