Skip to content

fix: add Helmet middleware for HTTP security headers (closes #17)#47

Merged
LucasMaupin merged 1 commit into
mainfrom
fix/issue-17-helmet-security-headers
Jun 10, 2026
Merged

fix: add Helmet middleware for HTTP security headers (closes #17)#47
LucasMaupin merged 1 commit into
mainfrom
fix/issue-17-helmet-security-headers

Conversation

@LucasMaupin

Copy link
Copy Markdown
Collaborator

Summary

  • Imported @fastify/helmet (already present in dependencies) into src/server.ts
  • Registered the Helmet plugin before CORS so security headers are applied to every response
  • Configured contentSecurityPolicy with defaultSrc: 'none' and connectSrc: 'self' (appropriate for a pure API server)
  • Set crossOriginResourcePolicy: cross-origin to stay consistent with the existing CORS origin: '*' setting

This adds X-Frame-Options, X-Content-Type-Options: nosniff, Strict-Transport-Security, Referrer-Policy, and Content-Security-Policy headers to all responses, closing the OWASP A05 finding.

Closes #17

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY][LOW] No HTTP security headers — missing Helmet/CSP/X-Frame-Options/HSTS

1 participant