From 0cf8108ff08d48c7720a67c6b4deaa1b32b62eeb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 31 May 2026 03:03:31 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20[HIGH]=20Fi?= =?UTF-8?q?x=20XSS=20vulnerability=20in=20search.html=20escapeHtml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- frontend/templates/search.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/templates/search.html b/frontend/templates/search.html index 89ad5cb7..8f986b38 100644 --- a/frontend/templates/search.html +++ b/frontend/templates/search.html @@ -298,9 +298,13 @@ } function escapeHtml(str) { - const d = document.createElement('div'); - d.textContent = str; - return d.innerHTML; + if (!str) return ''; + return String(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); } /**