π‘οΈ Sentinel: [CRITICAL] Fix PostgREST query injection in search#92
π‘οΈ Sentinel: [CRITICAL] Fix PostgREST query injection in search#92kourdroid wants to merge 1 commit into
Conversation
Prevented arbitrary PostgREST operators from being injected into the `.or()` filter in the incident admin service. Sanitized the user-provided search string by escaping double quotes (`""`) and formatting the value as a PostgREST string literal (`"..."`) when building the filter query. Co-authored-by: kourdroid <36898160+kourdroid@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: Interpolating unfiltered user input into Supabase
.or()strings allows attackers to break the string parser and inject arbitrary PostgREST operators, potentially bypassing intended data access limits or crashing queries.π― Impact: Unauthorized filtering and enumeration of data, denial of service via query errors.
π§ Fix: Replaced double quotes with
""in the input and explicitly wrapped the input values in double quotes within the PostgREST string literal syntax (e.g.,ilike."%${safeSearch}%") to ensure strict evaluation as a string.β Verification: Ran
pnpm install,pnpm lint, andpnpm exec tsc --noEmitand confirmed no errors or regressions. Code correctness verified via local code review.PR created automatically by Jules for task 17391211916239151918 started by @kourdroid