Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix PostgREST query injection in search#92

Open
kourdroid wants to merge 1 commit into
mainfrom
sentinel-fix-query-injection-17391211916239151918
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix PostgREST query injection in search#92
kourdroid wants to merge 1 commit into
mainfrom
sentinel-fix-query-injection-17391211916239151918

Conversation

@kourdroid

Copy link
Copy Markdown
Owner

🚨 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, and pnpm exec tsc --noEmit and confirmed no errors or regressions. Code correctness verified via local code review.


PR created automatically by Jules for task 17391211916239151918 started by @kourdroid

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant