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): suppress 4 Bearer false positives in chat.js (#2953) (#4374)

LearningCircuitd716d4abacd9
diff --git a/src/local_deep_research/web/static/js/components/chat.js b/src/local_deep_research/web/static/js/components/chat.js
index e283fe1664..c0b4def799 100644
--- a/src/local_deep_research/web/static/js/components/chat.js
+++ b/src/local_deep_research/web/static/js/components/chat.js
@@ -732,7 +732,9 @@
function renderToElement(textEl, content) {
if (window.ui && window.ui.renderMarkdown) {
try {
- textEl.innerHTML = window.ui.renderMarkdown(content); // eslint-disable-line no-unsanitized/property -- audited: renderMarkdown sanitizes via DOMPurify
+ // bearer:disable javascript_lang_dangerous_insert_html
+ // eslint-disable-next-line no-unsanitized/property -- audited: renderMarkdown() sanitizes via DOMPurify (app.js bundle), with textContent fallback on error
+ textEl.innerHTML = window.ui.renderMarkdown(content);
} catch (e) {
textEl.textContent = content;
}
@@ -938,12 +940,14 @@
const group = document.createElement('div');
group.className = 'ldr-chat-steps-group';
group.dataset.live = 'true';
+ // bearer:disable javascript_lang_insufficiently_random_values — DOM element id for aria-controls wiring only; not security-sensitive (collision is at most a duplicate id)
const contentId = `ldr-chat-steps-content-${Date.now()}-${Math.floor(Math.random() * 1e6)}`;
const header = document.createElement('button');
header.className = 'ldr-chat-steps-header';
header.setAttribute('aria-expanded', 'true');
header.setAttribute('aria-controls', contentId);
header.type = 'button';
+ // bearer:disable javascript_lang_dangerous_insert_html — static literal markup only, no user/LLM input
header.innerHTML =
'<i class="fas fa-chevron-right ldr-chat-steps-chevron"></i>' +
'<i class="fas fa-flask"></i>' +
@@ -1048,6 +1052,7 @@
// accordions are wrapped in the same millisecond (rare but
// possible during fast reload), so combine with a counter
// suffix via Math.random.
+ // bearer:disable javascript_lang_insufficiently_random_values — DOM element id for aria-controls wiring only; not security-sensitive (collision is at most a duplicate id)
const contentId = `ldr-chat-steps-content-${Date.now()}-${Math.floor(Math.random() * 1e6)}`;
// Header — button for keyboard accessibility
const header = document.createElement('button');
@@ -1055,6 +1060,7 @@
header.setAttribute('aria-expanded', 'false');
header.setAttribute('aria-controls', contentId);
header.type = 'button';
+ // bearer:disable javascript_lang_dangerous_insert_html — static literals + integer stepElements.length, no user/LLM input
// eslint-disable-next-line no-unsanitized/property -- audited: all content is static strings, no user input
header.innerHTML =
'<i class="fas fa-chevron-right ldr-chat-steps-chevron"></i>' +