From b70ae56ffab3896554ab9172933fae4163edc5d5 Mon Sep 17 00:00:00 2001 From: SurprisedDuck Date: Mon, 1 Jun 2026 22:58:38 +0200 Subject: [PATCH] Sanitize preserved markdown HTML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `mdToHtml` deliberately stashes literal
blocks and tags from the source text *before* the global HTML-escape pass and restores them verbatim into the string callers assign to `innerHTML` (e.g. chatRenderer's `b.innerHTML = ...processWithThinking(text)`). Nothing scrubbed those fragments, so message/agent content containing `
` or `
` executed arbitrary script in the authenticated page. Route both stashed fragments through `sanitizeAllowedHtml()`, which parses them in an inert