Skip to content

SEC: Missing HTTP Security Headers — nginx config hardening #549

Closed

Description

@vybe

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

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

Activity

  1. added
    priority-p2
    security
    pentest
    severity-low
    on Apr 28, 2026
  2. added
    status-in-progress
    on May 4, 2026
  3. self-assigned this
    on May 4, 2026
  4. added
    status-in-dev
    and removed
    status-in-progress
    on May 5, 2026
  5. vybe commented on Jun 1, 2026

    @vybe
    ContributorAuthor

    Shipped in v0.6.0 (released via #998).

  6. added
    complexity-low
    theme-security
    and removed
    status-in-dev
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpentestpriority-p2securityseverity-lowtheme-security

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions