Escape agent and candidate search filters#450
Conversation
Greptile SummaryFixes a PostgREST filter injection vulnerability where the raw
Confidence Score: 5/5This PR makes a focused, correct security fix with no regressions introduced; safe to merge. The change is minimal — two one-liner additions that route No files require special attention; all four changed files are straightforward. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Search Request] --> B{q present?}
B -- No --> D[Skip .or filter]
B -- Yes --> C[escapePostgrestSearchValue q]
C --> E[Escape: \\ % * _ , . parens]
E --> F["Build .or(...ilike.%safeQuery%...)"]
F --> G[PostgREST / Supabase]
G --> H[(PostgreSQL LIKE)]
D --> G
Reviews (1): Last reviewed commit: "Escape agent and candidate search filter..." | Re-trigger Greptile |
|
CI is green now: build, test, Greptile, Socket, and security checks all passed. |
Fixes #449.
What changed
qbefore interpolating it into agent profile.or(...)filters.Validation
./node_modules/.bin/vitest.cmd run src/lib/queries/agents.test.ts src/lib/queries/candidates.test.ts./node_modules/.bin/tsc.cmd --noEmit