diff --git a/.jules/sentinel.md b/.jules/sentinel.md new file mode 100644 index 0000000..defc80c --- /dev/null +++ b/.jules/sentinel.md @@ -0,0 +1,4 @@ +## 2025-01-30 - Prevent XSS in Email Previews with Sandboxed Iframes +**Vulnerability:** Use of `dangerouslySetInnerHTML` for rendering email HTML, even when sanitized by `DOMPurify`, can present residual XSS risks. +**Learning:** Using a sandboxed `iframe` with `srcDoc` and `sandbox="allow-popups allow-popups-to-escape-sandbox"` eliminates script execution and same-origin access risks, providing defense in depth. However, styles must be manually injected via `${sanitizedEmailHtml}`} + sandbox="allow-popups allow-popups-to-escape-sandbox" + className="h-full min-h-[24rem] w-full border-0" + />