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): resolve Bearer scanner false positives (#6916, #6739, #6020) (#2316)

LearningCircuite94879e5a1a0
diff --git a/src/local_deep_research/web/static/js/pages/news.js b/src/local_deep_research/web/static/js/pages/news.js
index 83d7d2128c..3aa22e28eb 100644
--- a/src/local_deep_research/web/static/js/pages/news.js
+++ b/src/local_deep_research/web/static/js/pages/news.js
@@ -15,18 +15,14 @@ function safeRenderHTML(container, htmlString) {
throw new Error('DOMPurify not loaded — cannot safely render HTML');
}
- const template = document.createElement('template');
- const sanitized = window.DOMPurify.sanitize(htmlString);
- template.innerHTML = sanitized;
+ const fragment = window.DOMPurify.sanitize(htmlString, { RETURN_DOM_FRAGMENT: true });
// Clear the container safely
while (container.firstChild) {
container.removeChild(container.firstChild);
}
- // Import and append the content
- const content = document.importNode(template.content, true);
- container.appendChild(content);
+ container.appendChild(fragment);
}
// Sanitize a URL for safe use in href attributes (blocks javascript:, data:, etc.)
@@ -3190,7 +3186,7 @@ function useNewsTemplate(templateId) {
template: templateId
});
// bearer:disable javascript_lang_open_redirect — hardcoded path /news, only query params are dynamic
- window.location.href = `/news/subscriptions/new?${params.toString()}`;
+ window.location.href = `/news/subscriptions/new?${params.toString()}`; // bearer:disable javascript_lang_open_redirect
}
}
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 95e74dae27..f6f1d17370 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
@@ -171,6 +171,7 @@ function safeCreateElement(tagName, text = '', attributes = {}, classNames = [])
if (!SAFE_TAGS.has(normalizedTag)) {
throw new Error('safeCreateElement: disallowed tag "' + tagName + '"');
}
+ // bearer:disable javascript_lang_dangerous_insert_html — tag validated against SAFE_TAGS whitelist
const element = document.createElement(normalizedTag);
if (text) {