Skip to content

fix(api): add default security headers - #16

Closed
thomasorgeval wants to merge 1 commit into
mainfrom
sentinel-security/harden-api-headers
Closed

fix(api): add default security headers#16
thomasorgeval wants to merge 1 commit into
mainfrom
sentinel-security/harden-api-headers

Conversation

@thomasorgeval

Copy link
Copy Markdown
Member

Summary

  • Add API-wide browser hardening headers for content sniffing, referrer leakage, framing, and sensitive browser capabilities.
  • Replace the upload-only nosniff hook with a reusable Hono middleware.
  • Cover the middleware with a focused Vitest regression test.

Expected impact

  • Reduces clickjacking exposure on API/auth responses.
  • Keeps uploaded logo responses protected by nosniff while extending the same default to every API response.
  • Narrows passive browser data leakage via referrer and permissions defaults without changing API behavior.

Verification

  • pnpm nx test api
  • pnpm nx lint api
  • pnpm nx typecheck api
  • pnpm format:check apps/api/src/app.ts apps/api/src/http/security-headers.ts apps/api/src/http/security-headers.spec.ts
  • pnpm nx build api

@thomasorgeval
thomasorgeval deleted the sentinel-security/harden-api-headers branch June 26, 2026 14:13
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.

1 participant