Repository navigation
Closed
Labels
complexity-lowComplexity: low (board points 1-3)pentestFrom penetration testing reportpriority-p2ImportantsecuritySecurity vulnerabilityseverity-lowLow severity security findingtheme-securityTheme: Security
Description
Summary
Trinity's nginx reverse proxy returns zero of the 9 standard HTTP security headers, and exposes the `Server: uvicorn` header which leaks the backend tech stack. This was flagged as Unfixed (Informational) in the April 2026 UnderDefense remediation pentest.
Context
UnderDefense finding 3.4.2 identified the following missing headers:
- `X-Frame-Options: DENY` — prevents clickjacking
- `X-Content-Type-Options: nosniff` — prevents MIME sniffing
- `Content-Security-Policy` — XSS defense
- `Strict-Transport-Security` — enforces HTTPS
- `Referrer-Policy: strict-origin-when-cross-origin`
- `Permissions-Policy`
- `Cross-Origin-Resource-Policy`
- `Cross-Origin-Embedder-Policy`
- `Cross-Origin-Opener-Policy`
Additionally, the `Server: uvicorn` response header discloses the backend framework.
Trinity received Grade A overall in the April 2026 pentest, but this item was left unfixed as Informational. Adding these headers is a low-effort, high-signal hardening step.
Acceptance Criteria
- All 9 security headers added to nginx config (or FastAPI middleware for non-nginx deployments)
- `Server` header suppressed or overridden to a non-identifying value
- Headers verified present in `curl -I http://localhost\` output
- CSP policy allows the Vue.js frontend to function correctly (no console CSP errors)
- HSTS only applied in production (not localhost dev)
Technical Notes
- nginx config: `docker/nginx/nginx.conf` (or equivalent in `config/`)
- Can also be added via FastAPI middleware if a single-service deployment is preferred
- CSP needs careful tuning for Vue.js inline styles and script evaluation — start with report-only mode if needed
- HSTS should be conditional on `$scheme = "https"` to avoid breaking local HTTP dev
Metadata
Metadata
Assignees
Labels
complexity-lowComplexity: low (board points 1-3)pentestFrom penetration testing reportpriority-p2ImportantsecuritySecurity vulnerabilityseverity-lowLow severity security findingtheme-securityTheme: Security
Activity
fix(security): add missing HTTP security headers across all surfaces (#…
vybe commentedon Jun 1, 2026
Shipped in v0.6.0 (released via #998).
fix(frontend): allow blob: in CSP for Files-tab preview (#1400) (#1403)