Summary
backend/src/main.ts sets up validation, correlation IDs, exception filters, Swagger, CORS, and graceful shutdown - but no helmet() (or equivalent header middleware). The API therefore serves responses without X-Content-Type-Options, Strict-Transport-Security, X-Frame-Options, etc. For an API holding auth tokens and user metadata (a geolocation middleware already enriches requests), these are low-cost wins.
Proposal
- Add the
helmet dependency and app.use(helmet()) early in bootstrap; verify Swagger UI at /api still renders afterwards.
- Gate HSTS behind
NODE_ENV=production using the existing config namespace pattern (app.config.ts).
- Set
crossOriginResourcePolicy compatible with the frontend origin allowlist from the CORS work.
Acceptance criteria
Summary
backend/src/main.tssets up validation, correlation IDs, exception filters, Swagger, CORS, and graceful shutdown - but nohelmet()(or equivalent header middleware). The API therefore serves responses withoutX-Content-Type-Options,Strict-Transport-Security,X-Frame-Options, etc. For an API holding auth tokens and user metadata (a geolocation middleware already enriches requests), these are low-cost wins.Proposal
helmetdependency andapp.use(helmet())early in bootstrap; verify Swagger UI at/apistill renders afterwards.NODE_ENV=productionusing the existing config namespace pattern (app.config.ts).crossOriginResourcePolicycompatible with the frontend origin allowlist from the CORS work.Acceptance criteria
/apistill loads locally.X-Content-Type-Options: nosniff).