Skip to content

security: helmet headers + express-rate-limit (#127, #128)#149

Merged
sacha-l merged 1 commit into
developfrom
chore/security-hardening
May 22, 2026
Merged

security: helmet headers + express-rate-limit (#127, #128)#149
sacha-l merged 1 commit into
developfrom
chore/security-hardening

Conversation

@sacha-l
Copy link
Copy Markdown
Collaborator

@sacha-l sacha-l commented May 22, 2026

Summary

Two quick hardening wins from the post-audit backlog, especially relevant now that we have public program/projects endpoints.

Files

  • server/server.js — helmet + limiters + trust proxy
  • server/package.json + package-lock.json — add helmet, express-rate-limit

Test plan

  • node --check server.js — syntax OK.
  • npm test (server) — 257 passed (no test imports server.js, so behavior is unchanged for handlers).
  • Verified helmet(...) + rateLimit(...) construct + mount cleanly against the installed v8 packages (throwaway app).
  • Post-deploy: confirm /api/health still 200 with new headers; hammer /api/admin/session >10/min from one IP → 429.

Notes

  • npm audit reports pre-existing tree vulnerabilities unrelated to these two well-maintained packages; not addressed here.
  • No test imports server.js today (see ci: add a server boot smoke test (would have caught #117) #133 — a boot smoke test would cover middleware wiring; out of scope here).
  • Per CLAUDE.md §6: draft, never merging.

- helmet for X-Frame-Options / X-Content-Type-Options / etc. CSP disabled
  (JSON API, no HTML) and crossOriginResourcePolicy set to 'cross-origin'
  so the separately-hosted SPA can still read responses.
- express-rate-limit: app-wide 200/min/IP default + a tight 10/min/IP on
  the unauthenticated, signature-verifying /api/admin/session endpoint.
- trust proxy = 1 so client IPs are correct behind Railway's proxy.

helmet + express-rate-limit added to deps.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment May 22, 2026 2:22am

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