security: helmet headers + express-rate-limit (#127, #128)#149
Merged
Conversation
- 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two quick hardening wins from the post-audit backlog, especially relevant now that we have public program/projects endpoints.
crossOriginResourcePolicyis set tocross-originso the separately-hosted SPA (stadium.joinwebzero.com / *.vercel.app) can still read responses./api/admin/session(unauthenticated and runs ~50–200ms of SIWS signature verification per call).trust proxy = 1so client IPs are correct behind Railway's TLS-terminating proxy (and to satisfy express-rate-limit's trust-proxy validation).Files
server/server.js— helmet + limiters + trust proxyserver/package.json+package-lock.json— addhelmet,express-rate-limitTest plan
node --check server.js— syntax OK.npm test(server) — 257 passed (no test importsserver.js, so behavior is unchanged for handlers).helmet(...)+rateLimit(...)construct + mount cleanly against the installed v8 packages (throwaway app)./api/healthstill 200 with new headers; hammer/api/admin/session>10/min from one IP → 429.Notes
npm auditreports pre-existing tree vulnerabilities unrelated to these two well-maintained packages; not addressed here.server.jstoday (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).