Supabase Postgres (PostgreSQL RLS) · CWE-89

Supabase Postgres: SQL & ORM Query Injection (Code Remediation)

Implement fail-closed guards and safe data filters. Stop concatenated user input from altering SQL predicates, sort keys, or raw query calls. Tailored for Supabase Postgres: Enable ROW LEVEL SECURITY on all tables and match USING + WITH CHECK to auth.uid().

Primary AegisSec skill
owasp-web-audit ->
Companion: zap-active-daemon-triage
Coverage ledger tracking key
surface:supabase-postgres::boundary:sql-injection::angle:remediation
ZAP 40018 SQL Injection safe staging policy
Risk boundary
// Unverified Supabase Postgres path (CWE-89 · Code Remediation)
// Handler accepts input without validating auth.uid().
Hardened guard
// Hardened Supabase Postgres (CWE-89 · Code Remediation)
// 1. Enable ROW LEVEL SECURITY on all tables and match USING + WITH CHECK to auth.uid()
// 2. Use parameterized bindings everywhere and strict allowlists for dynamic column names.

Verification steps

  1. 01Seed coverage-ledger.json for every Supabase Postgres handler touching SQL & ORM Query Injection.
  2. 02Trace request parameters through auth.uid() validation down to the sink.
  3. 03Verify with paired positive/negative evidence via zap-active-daemon-triage.