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.

security: Add missing HTTP security headers

LearningCircuit768e384df3c7
diff --git a/src/local_deep_research/web/app_factory.py b/src/local_deep_research/web/app_factory.py
index e08d656835..9db5b81595 100644
--- a/src/local_deep_research/web/app_factory.py
+++ b/src/local_deep_research/web/app_factory.py
@@ -332,6 +332,24 @@ def apply_middleware(app):
response.headers["Content-Security-Policy"] = csp
response.headers["X-Content-Security-Policy"] = csp
+ # Add additional security headers
+ response.headers["X-Frame-Options"] = "SAMEORIGIN"
+ response.headers["X-Content-Type-Options"] = "nosniff"
+ response.headers["Referrer-Policy"] = "strict-origin-when-cross-origin"
+ response.headers["Permissions-Policy"] = (
+ "geolocation=(), microphone=(), camera=()"
+ )
+
+ # Add HSTS header only if using HTTPS
+ if (
+ request.is_secure
+ or app.config.get("PREFERRED_URL_SCHEME") == "https"
+ ):
+ # max-age=31536000 is 1 year, includeSubDomains applies to all subdomains
+ response.headers["Strict-Transport-Security"] = (
+ "max-age=31536000; includeSubDomains"
+ )
+
# Add CORS headers for API requests
if request.path.startswith("/api/") or request.path.startswith(
"/research/api/"