chore: production roadmap + P0 security hardening#29
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51796f76a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const originHeader = parseOrigin(request.headers.get('origin')); | ||
| if (originHeader) { | ||
| return originHeader === expectedOrigin; |
There was a problem hiding this comment.
Reject unparseable Origin headers
In isAllowedRequestOrigin, a present but unparseable Origin value (for example Origin: null, which browsers can send from sandboxed contexts) is treated as if no origin was provided and is therefore allowed. Since the Stripe checkout/portal POST handlers rely on this helper in production, that fallthrough can bypass the new same-origin protection and still run with authenticated cookies. Requests that include an invalid origin header should be rejected rather than accepted as "missing".
Useful? React with 👍 / 👎.
| const detail = error instanceof Error ? error.message : 'db_probe_failed'; | ||
| return { ok: false as const, detail }; |
There was a problem hiding this comment.
Avoid exposing DB error details in health response
The new unauthenticated /api/health endpoint stores error.message from the DB probe and returns it to clients via checks.database.detail. Connection/library error strings commonly include internal diagnostics (hostnames, driver details, schema hints), so this leaks operational information to any caller. For a public health check, return a generic failure detail and keep the raw error only in server logs.
Useful? React with 👍 / 👎.
Summary
Validation