fix(security): close four P0 launch-readiness findings#1586
Merged
Conversation
P0-1 plugin-auth: generateSecret() throws (fails boot) when OS_AUTH_SECRET is unset and NODE_ENV==='production' instead of using a predictable dev-secret-<ts> (session forgery). Dev/test fallback unchanged. P0-2 plugin-security: permission-resolution catch now FAILS CLOSED — logs ERROR and throws PermissionDeniedError rather than return next(), so a degraded metadata service can't bypass RBAC/RLS. System ops still bypass. P0-3 driver-sql: contains/$contains escapes LIKE metacharacters (% _ \) and binds explicit ESCAPE '\' (SQLite needs it) so '%' matches literally, not every row (filter bypass). P0-4 driver-mongodb: field-operator translator rejects unknown $-operators instead of passing them through, blocking $where/$function/$expr (server-side JS execution / query-intent bypass). Each finding was hand-verified against main first. +12 regression tests across the four packages. docs/launch-readiness.md updated: P0-1..4 marked Verify ✅ (fixed), Sign-off left for the team. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes the four code-level P0 blockers from
docs/launch-readiness.md. Each was hand-verified againstmainbefore fixing (per the checklist's Verify-before-fix rule) — all four confirmed real.plugin-authgenerateSecret()throws (fails boot) whenOS_AUTH_SECRETis unset andNODE_ENV==='production'— no more predictabledev-secret-<timestamp>(session forgery). Dev/test fallback unchanged.plugin-securitycatchnow fails closed: logs ERROR + throwsPermissionDeniedErrorinstead ofreturn next(). A degraded metadata service can no longer let authenticated requests bypass RBAC/RLS. System ops still bypass (decided + recorded).driver-sqlcontains/$containsescapes LIKE metacharacters (%_\) and binds an explicitESCAPE '\'(SQLite has no default escape char). A%value now matches literally, not every row.driver-mongodb$-operators instead of passing them through — blocks$where/$function/$expr(server-side JS / query-intent bypass). All legitimate ObjectQL operators stay allowlisted.Tests
+12 regression tests (all four packages green): auth secret prod-throw / dev-fallback / env-set; security fail-closed-denies + system-bypass-preserved; SQL
%/_literal-match; Mongo$where/$function/$exprrejected + allowlist still works.Docs
docs/launch-readiness.mdP0-1..4 marked Verify ✅ (fixed); Sign-off left blank for a human reviewer — the doc's two-gate model is preserved.Notes
🤖 Generated with Claude Code