From 712e5ece7e7b69ec885c0fb8f3f1333dca23c4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Thu, 6 Aug 2026 18:01:14 +0200 Subject: [PATCH] Strip template elements from the HTML block preview (#23866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to a code scanner alert on `HtmlNodeView`. The alert itself is not a live vulnerability, but auditing the hand-rolled sanitizer behind it turned up one gap worth closing. ## What I checked `sanitizeHtmlPreview` is a blocklist sanitizer feeding `dangerouslySetInnerHTML` in the editor, so I ran ~30 payloads through the real implementation in headless Chromium, inserting the sanitized output into a live document. A deliberately unsanitized control payload fired, so the harness was actually detecting execution. Nothing executed. The parser-differential classes it already survives: `noscript`, `noembed`, `noframes`, `xmp`, `listing`, `title` and `textarea` raw-text handling; `svg`/`math`/`mglyph`/`foreignObject` namespace confusion; comment breakouts; table foster parenting; ``; `