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: add missing frame-ancestors CSP directive

LearningCircuit082247bb7b2e
diff --git a/src/local_deep_research/security/security_headers.py b/src/local_deep_research/security/security_headers.py
index 0a31d04439..9957234cd5 100644
--- a/src/local_deep_research/security/security_headers.py
+++ b/src/local_deep_research/security/security_headers.py
@@ -105,6 +105,7 @@ class SecurityHeaders:
"worker-src blob:; "
"child-src 'self' blob:; "
"frame-src 'self'; "
+ "frame-ancestors 'self'; "
"manifest-src 'self'; "
"object-src 'none'; "
"base-uri 'self'; "
diff --git a/tests/security/test_security_headers.py b/tests/security/test_security_headers.py
index db17b13e03..7e8d738a3a 100644
--- a/tests/security/test_security_headers.py
+++ b/tests/security/test_security_headers.py
@@ -417,6 +417,22 @@ class TestCspPolicy:
assert "manifest-src 'self'" in csp
+ def test_csp_includes_frame_ancestors(self):
+ """CSP should include frame-ancestors directive (no fallback to default-src)."""
+ from flask import Flask
+ from local_deep_research.security.security_headers import (
+ SecurityHeaders,
+ )
+
+ app = Flask(__name__)
+ app.config["SECRET_KEY"] = "test-key"
+
+ sh = SecurityHeaders(app)
+ csp = sh.get_csp_policy()
+
+ # frame-ancestors is required because it doesn't fall back to default-src
+ assert "frame-ancestors 'self'" in csp
+
class TestPermissionsPolicy:
"""Tests for get_permissions_policy method."""