diff --git a/.jules/sentinel.md b/.jules/sentinel.md new file mode 100644 index 0000000..6e9974e --- /dev/null +++ b/.jules/sentinel.md @@ -0,0 +1,5 @@ +## 2024-07-02 - Replace dangerouslySetInnerHTML with Iframe + +**Vulnerability:** Used `dangerouslySetInnerHTML` for rendering email HTML previews, even with DOMPurify. +**Learning:** `dangerouslySetInnerHTML` can still be a risk if DOMPurify fails to catch an edge-case bypass. Iframes provide a robust, defense-in-depth sandbox context that completely blocks script execution when `allow-scripts` is omitted from the `sandbox` attribute. Also learned that Tailwind classes on the iframe element do not apply to the `srcDoc` content, requiring an inline `${sanitizedEmailHtml}`} + sandbox="allow-popups allow-popups-to-escape-sandbox" + className="h-full min-h-[24rem] w-full border-none" + /> diff --git a/package-lock.json b/package-lock.json index 6115437..cfe04eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4513,7 +4513,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true,