Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(security): add bearer:disable comments for false positives in xss-protection.js (#1861)

LearningCircuit9091175288be
diff --git a/src/local_deep_research/web/static/js/security/xss-protection.js b/src/local_deep_research/web/static/js/security/xss-protection.js
index 91bf35b186..cb5ec7f630 100644
--- a/src/local_deep_research/web/static/js/security/xss-protection.js
+++ b/src/local_deep_research/web/static/js/security/xss-protection.js
@@ -118,6 +118,7 @@
* @param {string} text - The text to escape for attribute context
* @returns {string} - The escaped text safe for HTML attributes
*/
+// bearer:disable javascript_lang_manual_html_sanitization - This IS the sanitization function
function escapeHtmlAttribute(text) {
if (typeof text !== 'string') {
text = String(text);
@@ -133,6 +134,7 @@ function escapeHtmlAttribute(text) {
* @param {string} content - The content to set (will be sanitized)
* @param {boolean} allowHtmlTags - If true, allows basic HTML tags, otherwise escapes everything
*/
+// bearer:disable javascript_lang_dangerous_insert_html - Content is sanitized by DOMPurify before insertion
function safeSetInnerHTML(element, content, allowHtmlTags = false) {
if (!element || !content) {
return;
@@ -143,7 +145,7 @@ function safeSetInnerHTML(element, content, allowHtmlTags = false) {
if (allowHtmlTags && hasDOMPurify()) {
// Use DOMPurify for secure HTML sanitization
const sanitized = DOMPurify.sanitize(contentString, SANITIZE_CONFIG);
- element.innerHTML = sanitized;
+ element.innerHTML = sanitized; // bearer:disable javascript_lang_dangerous_insert_html - Already sanitized by DOMPurify
} else if (allowHtmlTags) {
// DOMPurify not available but HTML requested - escape all HTML for safety
SafeLogger.warn('DOMPurify not available, escaping HTML instead of sanitizing');