From 58875a885eea50a21fb621dbe7e0505a2403b8bc Mon Sep 17 00:00:00 2001 From: wicky <130177258+wicky-zipstack@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:22:12 +0530 Subject: [PATCH 1/2] fix: add security headers to nginx config (VAPT findings #3, #4) --- frontend/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 492eba6..e022093 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -50,6 +50,12 @@ http { root /usr/share/nginx/html; include /etc/nginx/mime.types; + # Security headers + add_header X-Frame-Options "DENY" always; + add_header X-Content-Type-Options "nosniff" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://*.visitran.com wss://*.visitran.com; object-src 'none'; base-uri 'self'; frame-ancestors 'none';" always; + # If a react app URI is directly accessed we will get 404 # since there will be no file representing that path. # Below config will load index.html file in such case and From d7df4e633a4d5581c2a13eaf76f5d9b57c264a76 Mon Sep 17 00:00:00 2001 From: wicky <130177258+wicky-zipstack@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:26:12 +0530 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20make=20CSP=20generic=20for=20OSS=20?= =?UTF-8?q?=E2=80=94=20remove=20visitran.com-specific=20domains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index e022093..e41dfa0 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -54,7 +54,7 @@ http { add_header X-Frame-Options "DENY" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://*.visitran.com wss://*.visitran.com; object-src 'none'; base-uri 'self'; frame-ancestors 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' wss: ws:; object-src 'none'; base-uri 'self'; frame-ancestors 'none';" always; # If a react app URI is directly accessed we will get 404 # since there will be no file representing that path.