Merge pull request #901 from christianlouis/sentinel-fix-xss-search-14130401506656403756

🛡️ Sentinel: [HIGH] Fix XSS vulnerability in search.html escapeHtml
This commit is contained in:
Christian Krakau-Louis
2026-05-31 06:35:57 +02:00
committed by GitHub
+7 -3
View File
@@ -298,9 +298,13 @@
}
function escapeHtml(str) {
const d = document.createElement('div');
d.textContent = str;
return d.innerHTML;
if (str === null || str === undefined) return '';
return String(str)
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
}
/**