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: validate query parameter type in quick_summary endpoint (#2049)

LearningCircuit540f70fd06ac
diff --git a/src/local_deep_research/web/api.py b/src/local_deep_research/web/api.py
index 29ccb47e4a..42a4122b15 100644
--- a/src/local_deep_research/web/api.py
+++ b/src/local_deep_research/web/api.py
@@ -238,6 +238,8 @@ def api_quick_summary():
# Extract query and optional parameters
query = data.get("query")
+ if not isinstance(query, str):
+ return jsonify({"error": "Query must be a string"}), 400
params = {k: v for k, v in data.items() if k != "query"}
logger.debug(
f"Query length: {len(query) if query else 0}, params keys: {list(params.keys()) if params else 'None'}"
diff --git a/tests/security/test_api_security.py b/tests/security/test_api_security.py
index d92019150a..d63e7f4dca 100644
--- a/tests/security/test_api_security.py
+++ b/tests/security/test_api_security.py
@@ -324,9 +324,8 @@ class TestAPIInputValidation:
content_type="application/json",
)
- # Should validate data types (400/422)
- # Current implementation may return 500 for edge cases
- assert response.status_code in [200, 400, 422, 500]
+ # Should validate data types and reject non-string query
+ assert response.status_code in [400, 422]
def test_boundary_value_validation(self, client):
"""Test validation of boundary values."""