From fdc79eea49249de6db96ce6c7ab81302d1056523 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:01:37 +0000 Subject: [PATCH] Update CSP directives and add detailed security TODOs Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- backend/app/middleware/security.py | 35 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/backend/app/middleware/security.py b/backend/app/middleware/security.py index 6b9d42e..b58d2f6 100644 --- a/backend/app/middleware/security.py +++ b/backend/app/middleware/security.py @@ -52,14 +52,37 @@ class SecurityHeadersMiddleware(BaseHTTPMiddleware): # Content Security Policy (CSP) # Restricts sources of content that can be loaded - # TODO: Remove 'unsafe-inline' and 'unsafe-eval' and use nonces/hashes instead + # + # SECURITY TODO: Current CSP includes 'unsafe-inline' and 'unsafe-eval' which + # weaken XSS protection. To remove these: + # + # For script-src 'unsafe-inline': + # 1. Move all inline