~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): make Bearer SQLi suppressions in migrations 0013/0008 actually work (#4792)
LearningCircuit840e1b34f5d6
diff --git a/src/local_deep_research/database/migrations/versions/0008_fix_research_strategy_fk.py b/src/local_deep_research/database/migrations/versions/0008_fix_research_strategy_fk.pyindex 1a243ecd14..4a5ebae0d0 100644--- a/src/local_deep_research/database/migrations/versions/0008_fix_research_strategy_fk.py+++ b/src/local_deep_research/database/migrations/versions/0008_fix_research_strategy_fk.py@@ -48,9 +48,14 @@ depends_on = Nonedef _table_row_count(bind, table_name: str) -> int:+ # ``table_name`` is always a hardcoded literal, never user input — so this+ # f-string SQL is a false positive. Bearer honors the directive ONLY on its+ # own line directly above the statement with the rule id alone; a same-line+ # directive, or any trailing prose after the rule id, is silently ignored.+ # bearer:disable python_lang_sql_injectionreturn (bind.execute(- text(f"SELECT COUNT(*) FROM {table_name}") # noqa: S608 — hardcoded name # bearer:disable python_lang_sql_injection — table_name is always a hardcoded literal+ text(f"SELECT COUNT(*) FROM {table_name}") # noqa: S608 — hardcoded name).scalar()or 0)diff --git a/src/local_deep_research/database/migrations/versions/0013_remove_meta_search_engines.py b/src/local_deep_research/database/migrations/versions/0013_remove_meta_search_engines.pyindex 530b2cba99..c2b1a1d8f2 100644--- a/src/local_deep_research/database/migrations/versions/0013_remove_meta_search_engines.py+++ b/src/local_deep_research/database/migrations/versions/0013_remove_meta_search_engines.py@@ -170,8 +170,14 @@ def _rewrite_queued_research_snapshots(conn) -> None:def _rewrite_benchmark_search_configs(conn, table: str) -> None:+ # ``table`` is always a hardcoded literal ("benchmark_runs" /+ # "benchmark_configs"), never user input — so this f-string SQL is a false+ # positive. Bearer honors the directive ONLY on its own line directly above+ # the statement with the rule id alone; a same-line directive, or any+ # trailing prose after the rule id, is silently ignored.+ # bearer:disable python_lang_sql_injectionrows = conn.execute(- sa.text(f"SELECT id, search_config FROM {table}") # noqa: S608 # bearer:disable python_lang_sql_injection — table is always a hardcoded literal ("benchmark_runs"/"benchmark_configs")+ sa.text(f"SELECT id, search_config FROM {table}") # noqa: S608).fetchall()rewritten = 0@@ -183,9 +189,15 @@ def _rewrite_benchmark_search_configs(conn, table: str) -> None:continueif config.get("search_tool") in REMOVED_ENGINES:config["search_tool"] = REPLACEMENT_ENGINE+ # ``table`` is always a hardcoded literal ("benchmark_runs" /+ # "benchmark_configs"), never user input — so this f-string SQL is a+ # false positive. Bearer honors the directive ONLY on its own line+ # directly above the statement with the rule id alone; a same-line+ # directive, or any trailing prose after the rule id, is ignored.+ # bearer:disable python_lang_sql_injectionconn.execute(sa.text(- f"UPDATE {table} SET search_config = :config " # noqa: S608 # bearer:disable python_lang_sql_injection — table is always a hardcoded literal ("benchmark_runs"/"benchmark_configs")+ f"UPDATE {table} SET search_config = :config " # noqa: S608"WHERE id = :id"),{"config": json.dumps(config), "id": row_id},