~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(security): resolve zizmor, Bearer, and DevSkim security alerts (#2238)
LearningCircuitfc2875485b35
diff --git a/.github/workflows/backwards-compatibility.yml b/.github/workflows/backwards-compatibility.ymlindex bba25a943f..183c081ca0 100644--- a/.github/workflows/backwards-compatibility.yml+++ b/.github/workflows/backwards-compatibility.yml@@ -50,11 +50,13 @@ jobs:steps:- name: Harden the runner (Audit all outbound calls)- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2with:egress-policy: audit- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up Pythonuses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0@@ -95,11 +97,13 @@ jobs:steps:- name: Harden the runner (Audit all outbound calls)- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2with:egress-policy: audit- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up Pythonuses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0diff --git a/.github/workflows/container-security.yml b/.github/workflows/container-security.ymlindex feb38145c5..1c57cb03a0 100644--- a/.github/workflows/container-security.yml+++ b/.github/workflows/container-security.yml@@ -40,7 +40,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build Docker image for scanning- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .push: falsediff --git a/.github/workflows/docker-multiarch-test.yml b/.github/workflows/docker-multiarch-test.ymlindex 1a4aaf44a3..34ee7aca22 100644--- a/.github/workflows/docker-multiarch-test.yml+++ b/.github/workflows/docker-multiarch-test.yml@@ -43,7 +43,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build Docker image for ${{ matrix.platform }}- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .platforms: ${{ matrix.platform }}diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.ymlindex f462992afa..884e8ae83c 100644--- a/.github/workflows/docker-publish.yml+++ b/.github/workflows/docker-publish.yml@@ -43,7 +43,7 @@ jobs:- name: Build and push AMD64 imageid: build- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .platforms: linux/amd64@@ -86,7 +86,7 @@ jobs:- name: Build and push ARM64 imageid: build- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .platforms: linux/arm64@@ -131,7 +131,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build Docker image for security scan- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .platforms: linux/amd64diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.ymlindex a0ed8a77a8..12192beb5d 100644--- a/.github/workflows/docker-tests.yml+++ b/.github/workflows/docker-tests.yml@@ -82,7 +82,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build Docker image with cache- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .target: ldr-test@@ -749,7 +749,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build production ldr image- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .target: ldrdiff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.ymlindex 4b38297803..af64617321 100644--- a/.github/workflows/dockle.yml+++ b/.github/workflows/dockle.yml@@ -33,7 +33,7 @@ jobs:uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Build Docker image for scanning- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: .push: falsediff --git a/.github/workflows/gitleaks-main.yml b/.github/workflows/gitleaks-main.ymlindex b6910807f6..f3cb214563 100644--- a/.github/workflows/gitleaks-main.yml+++ b/.github/workflows/gitleaks-main.yml@@ -49,6 +49,6 @@ jobs:- name: Upload SARIF reportif: always()- uses: github/codeql-action/upload-sarif@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4+ uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3with:sarif_file: gitleaks-results.sarifdiff --git a/.github/workflows/playwright-webkit-tests.yml b/.github/workflows/playwright-webkit-tests.ymlindex 0aeab2f388..ba610bfaa9 100644--- a/.github/workflows/playwright-webkit-tests.yml+++ b/.github/workflows/playwright-webkit-tests.yml@@ -18,11 +18,11 @@ jobs:steps:- name: Harden the runner (Audit all outbound calls)- uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2with:egress-policy: audit- - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:persist-credentials: false@@ -38,7 +38,7 @@ jobs:pdm install -d- name: Setup Node.js- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version: '20'cache: 'npm'@@ -148,11 +148,11 @@ jobs:steps:- name: Harden the runner (Audit all outbound calls)- uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2with:egress-policy: audit- - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:persist-credentials: false@@ -168,7 +168,7 @@ jobs:pdm install -d- name: Setup Node.js- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version: '20'cache: 'npm'diff --git a/src/local_deep_research/settings/env_definitions/db_config.py b/src/local_deep_research/settings/env_definitions/db_config.pyindex 8f74e360a7..33c04fb6a3 100644--- a/src/local_deep_research/settings/env_definitions/db_config.py+++ b/src/local_deep_research/settings/env_definitions/db_config.py@@ -74,7 +74,7 @@ DB_CONFIG_SETTINGS = [allowed_values={"PBKDF2_HMAC_SHA512","PBKDF2_HMAC_SHA256",- "PBKDF2_HMAC_SHA1",+ "PBKDF2_HMAC_SHA1", # DevSkim: ignore DS126858 — backwards compat for existing databases; default is SHA512},default="PBKDF2_HMAC_SHA512",case_sensitive=False,@@ -86,7 +86,7 @@ DB_CONFIG_SETTINGS = [allowed_values={"HMAC_SHA512","HMAC_SHA256",- "HMAC_SHA1",+ "HMAC_SHA1", # DevSkim: ignore DS126858 — backwards compat for existing databases; default is SHA512},default="HMAC_SHA512",case_sensitive=False,diff --git a/src/local_deep_research/web/static/js/collection_details.js b/src/local_deep_research/web/static/js/collection_details.jsindex e17c2fb4c9..9983a860c9 100644--- a/src/local_deep_research/web/static/js/collection_details.js+++ b/src/local_deep_research/web/static/js/collection_details.js@@ -496,6 +496,7 @@ function formatBytes(bytes) {}// Prefer the full escapeHtml from xss-protection.js; inline fallback if it hasn't loaded yet+// bearer:disable javascript_lang_manual_html_sanitizationvar escapeHtml = window.escapeHtml || function(str) {return String(str).replace(/[&<>"']/g, function(m) {return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[m];diff --git a/src/local_deep_research/web/static/js/collection_upload.js b/src/local_deep_research/web/static/js/collection_upload.jsindex 6000fe84f0..5ae99efd10 100644--- a/src/local_deep_research/web/static/js/collection_upload.js+++ b/src/local_deep_research/web/static/js/collection_upload.js@@ -8,6 +8,7 @@// safeFetch (with URLValidator) is now provided by utils/safe-fetch.js loaded in base.html// Prefer the full escapeHtml from xss-protection.js; inline fallback if it hasn't loaded yet+// bearer:disable javascript_lang_manual_html_sanitizationvar escapeHtml = window.escapeHtml || function(str) {return String(str).replace(/[&<>"']/g, function(m) {return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[m];diff --git a/src/local_deep_research/web/static/js/collections_manager.js b/src/local_deep_research/web/static/js/collections_manager.jsindex b4cf6a162f..74246d041b 100644--- a/src/local_deep_research/web/static/js/collections_manager.js+++ b/src/local_deep_research/web/static/js/collections_manager.js@@ -233,6 +233,7 @@ function formatBytes(bytes) {}// Prefer the full escapeHtml from xss-protection.js; inline fallback if it hasn't loaded yet+// bearer:disable javascript_lang_manual_html_sanitizationvar escapeHtml = window.escapeHtml || function(str) {return String(str).replace(/[&<>"']/g, function(m) {return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[m];diff --git a/src/local_deep_research/web/static/js/components/details.js b/src/local_deep_research/web/static/js/components/details.jsindex 26f6ed726a..538d4d87a3 100644--- a/src/local_deep_research/web/static/js/components/details.js+++ b/src/local_deep_research/web/static/js/components/details.js@@ -12,6 +12,7 @@let searchChart = null;// XSS protection: escape dynamic content before innerHTML interpolation+ // bearer:disable javascript_lang_manual_html_sanitizationconst escapeHtmlFallback = (str) => String(str).replace(/[&<>"']/g, (m) => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[m]);const escapeHtml = window.escapeHtml || escapeHtmlFallback;@@ -1018,6 +1019,7 @@if (overview.truncation_occurred) {// Ensure truncated_count is a safe number before interpolationconst truncatedCount = Number(overview.truncated_count) || 0;+ // bearer:disable javascript_lang_dangerous_insert_htmltruncationStatus.innerHTML = `<span style="color: var(--error-color);">Yes (${truncatedCount} requests)</span>`;} else {truncationStatus.innerHTML = '<span style="color: var(--success-color);">No truncation</span>';diff --git a/src/local_deep_research/web/static/js/components/history.js b/src/local_deep_research/web/static/js/components/history.jsindex 165e196d6f..480f424c9e 100644--- a/src/local_deep_research/web/static/js/components/history.js+++ b/src/local_deep_research/web/static/js/components/history.js@@ -14,6 +14,7 @@let filteredItems = [];// Security: local escapeHtml to prevent XSS in innerHTML assignments+ // bearer:disable javascript_lang_manual_html_sanitizationconst esc = window.escapeHtml || (s => String(s || '').replace(/[&<>"']/g, m => ({'&':'&','<':'<','>':'>','"':'"',"'":"'"})[m]));// Fallback UI utilities in case main UI utils aren't loadeddiff --git a/src/local_deep_research/web/static/js/components/logpanel.js b/src/local_deep_research/web/static/js/components/logpanel.jsindex dc47c55949..b85df19216 100644--- a/src/local_deep_research/web/static/js/components/logpanel.js+++ b/src/local_deep_research/web/static/js/components/logpanel.js@@ -5,6 +5,7 @@*/(function() {// XSS protection for values rendered via innerHTML+ // bearer:disable javascript_lang_manual_html_sanitizationconst escapeHtmlFallback = (str) => String(str || '').replace(/[&<>"']/g, (m) => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[m]);const escapeHtml = window.escapeHtml || escapeHtmlFallback;@@ -566,6 +567,7 @@// SECURITY: error.message can contain arbitrary text — must escape before innerHTMLconst logContent = document.getElementById('console-log-container');if (logContent) {+ // bearer:disable javascript_lang_dangerous_insert_htmllogContent.innerHTML = `<div class="error-message">Error loading logs: ${escapeHtml(error.message)}</div>`;}}diff --git a/src/local_deep_research/web/static/js/components/news.js b/src/local_deep_research/web/static/js/components/news.jsindex 7996c09ec2..46ed6a0437 100644--- a/src/local_deep_research/web/static/js/components/news.js+++ b/src/local_deep_research/web/static/js/components/news.js@@ -49,6 +49,7 @@ document.addEventListener('click', function(e) {});// Security: local escapeHtml to prevent XSS in innerHTML assignments+// bearer:disable javascript_lang_manual_html_sanitizationconst esc = window.escapeHtml || (s => String(s || '').replace(/[&<>"']/g, m => ({'&':'&','<':'<','>':'>','"':'"',"'":"'"})[m]));// Empty state helperdiff --git a/src/local_deep_research/web/static/js/deletion/confirmation_modal.js b/src/local_deep_research/web/static/js/deletion/confirmation_modal.jsindex 56c4e71ebf..db701f3739 100644--- a/src/local_deep_research/web/static/js/deletion/confirmation_modal.js+++ b/src/local_deep_research/web/static/js/deletion/confirmation_modal.js@@ -200,6 +200,7 @@ function hideDeleteModal() {}// Prefer the full escapeHtml from xss-protection.js; inline fallback if it hasn't loaded yet+// bearer:disable javascript_lang_manual_html_sanitizationvar escapeHtml = window.escapeHtml || function(str) {return String(str).replace(/[&<>"']/g, function(m) {return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[m];diff --git a/src/local_deep_research/web/static/js/embedding_settings.js b/src/local_deep_research/web/static/js/embedding_settings.jsindex 44bece6a79..4c291706ea 100644--- a/src/local_deep_research/web/static/js/embedding_settings.js+++ b/src/local_deep_research/web/static/js/embedding_settings.js@@ -231,6 +231,7 @@ function updateModelOptions() {warning.id = 'provider-unavailable-warning';warning.className = 'ldr-alert ldr-alert-danger';warning.style.marginTop = '8px';+ // bearer:disable javascript_lang_dangerous_insert_htmlwarning.innerHTML = '<i class="fas fa-exclamation-triangle"></i> ' +escapeHtml(providerInfo.label) +' is not reachable. Check the URL or service and try again.';@@ -614,6 +615,7 @@ function showError(message) {}// Prefer the full escapeHtml from xss-protection.js; inline fallback if it hasn't loaded yet+// bearer:disable javascript_lang_manual_html_sanitizationvar escapeHtml = window.escapeHtml || function(str) {return String(str).replace(/[&<>"']/g, function(m) {return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[m];diff --git a/src/local_deep_research/web/static/js/pages/news.js b/src/local_deep_research/web/static/js/pages/news.jsindex 24e00b7e03..607f739bfd 100644--- a/src/local_deep_research/web/static/js/pages/news.js+++ b/src/local_deep_research/web/static/js/pages/news.js@@ -1124,7 +1124,9 @@ async function loadVotesForNewsItems() {if (upBtn && downBtn) {// Update vote counts (ensure numeric values to prevent XSS)+ // bearer:disable javascript_lang_dangerous_insert_htmlupBtn.innerHTML = `<i class="fas fa-thumbs-up"></i> ${Number(voteInfo.upvotes) || 0}`;+ // bearer:disable javascript_lang_dangerous_insert_htmldownBtn.innerHTML = `<i class="fas fa-thumbs-down"></i> ${Number(voteInfo.downvotes) || 0}`;// Show user's existing vote@@ -1170,7 +1172,9 @@ async function vote(newsId, voteType) {const upBtn = item.querySelector('.ldr-vote-btn:first-child');const downBtn = item.querySelector('.ldr-vote-btn:last-child');// Ensure numeric values to prevent XSS+ // bearer:disable javascript_lang_dangerous_insert_htmlupBtn.innerHTML = `<i class="fas fa-thumbs-up"></i> ${Number(data.upvotes) || 0}`;+ // bearer:disable javascript_lang_dangerous_insert_htmldownBtn.innerHTML = `<i class="fas fa-thumbs-down"></i> ${Number(data.downvotes) || 0}`;if (voteType === 'up') {@@ -1684,6 +1688,7 @@ function updateFeedHeader() {const sub = subscriptions.find(s => s.id === activeSubscription);if (sub) {const query = sub.query || sub.topic || sub.query_or_topic || 'Unknown';+ // bearer:disable javascript_lang_dangerous_insert_htmlfeedTitle.innerHTML = `News for: <span class="text-muted">${escapeHtml(query)}</span>`;}}diff --git a/src/local_deep_research/web/static/js/research_form.js b/src/local_deep_research/web/static/js/research_form.jsindex 4da52c949a..90caf93fea 100644--- a/src/local_deep_research/web/static/js/research_form.js+++ b/src/local_deep_research/web/static/js/research_form.js@@ -277,6 +277,7 @@ function displayWarnings(warnings) {}// Security: escapeHtml applied to API-controlled warning fields before innerHTML insertion+ // bearer:disable javascript_lang_manual_html_sanitizationconst esc = window.escapeHtml || (s => String(s || '').replace(/[&<>"']/g, m => ({'&':'&','<':'<','>':'>','"':'"',"'":"'"})[m]));const warningsHtml = warnings.map(warning => {// Use success styling for recommendations/tips, warning for othersdiff --git a/src/local_deep_research/web/static/js/security/xss-protection.js b/src/local_deep_research/web/static/js/security/xss-protection.jsindex d4ceccb564..1a293c0c08 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@@ -157,6 +157,7 @@ function safeSetInnerHTML(element, content, allowHtmlTags = false) {* @returns {Element} - The created DOM element*/function safeCreateElement(tagName, text = '', attributes = {}, classNames = []) {+ // bearer:disable javascript_lang_manual_html_sanitizationconst element = document.createElement(tagName);if (text) {