RLS Séance is an in-browser bug-hunt arena for Supabase/PostgreSQL Row Level Security. You summon a ghost — the anon or authenticated role — against a schema, and watch real PostgreSQL 17.5 (running as WASM through PGlite) return a verdict for every attack vector: LEAK or BLOCKED, with the actual rows as evidence.

Most Supabase apps ship with GRANT SELECT done and ROW LEVEL SECURITY half-understood. Séance turns that gap into a 30-second séance: pick a fixture, run the named attack battery, see exactly which rows the ghost can read — before your users' data is the proof.

WHAT MAKES IT DIFFERENT

• Real verdicts, not guesses. Every claim is produced by a live PostgreSQL 17.5 instance running inside your browser tab — the same engine your database runs. No simulated policy logic, no static-analyzer heuristics. • Row-level evidence. Each attack shows the SQL that ran, the role it ran as, and the exact rows that came back (or the permission error that stopped it). • Broken vs fixed, side by side. Every fixture ships the policy set as it is commonly shipped and the corrected policy set, so the fix is visible rather than promised. • Bring your own schema. Paste your schema and policies into the Custom tab and run the same battery against it. Everything stays in your tab — no account, no backend, no network calls. • Zero install. It is a static site. Judges can open the URL and be in a séance in one click.

THE ATTACK BATTERY

Ten named vectors, each with a documented strategy:

• anon-read-scan — can the public key read rows it should not? • cross-tenant-read — can tenant A read tenant B's rows? • withcheck-injection — can the ghost insert rows it cannot read? • security-definer-bypass — does a SECURITY DEFINER function re-open a locked table? • grant-without-policy — RLS enabled but no matching policy: permitted or blocked? • insert-without-grant — explicit GRANT missing: error or silent allow? • update-foreign-row — can UPDATE cross a tenant boundary through a USING-only policy? • delete-foreign-row — the same boundary in the destructive direction. • rpc-function-scan — do exposed RPC functions leak table contents? • view-owner-leak — do views owned by a privileged role bypass RLS?

HOW A VERDICT IS DECIDED

Nothing is hardcoded. Each vector runs a set of probes as a specific role inside the live database, and the observed verdict is derived mechanically from what the database actually did: a probe that returns rows the ghost must not see is a LEAK; zero rows or a permission error is a BLOCKED, with the error text preserved as evidence. The engine compares that observation to the fixture's expected verdict, and any mismatch is surfaced in the UI instead of being hidden. A permission error is treated as evidence of enforcement, not as a crash.

TEN FIXTURES

Each fixture is a self-contained scenario distilled from a real-world failure pattern: a notes app, a multi-tenant SaaS, a chat backend, comments, billing, file storage, webhooks, user profiles, feature flags, and an API-key store. Every fixture ships:

• schema.sql — tables, roles and grants • policies-broken.sql — the policy set as commonly shipped • policies-fixed.sql — the corrected policy set • attacks.ts — the applicable vectors and their expected verdicts • notes.md — what went wrong, why the fix works, and the residual risk

WHAT JUDGES WILL SEE

• The live arena on GitHub Pages — pick a fixture, choose the anon or authenticated ghost, hit Summon, and read the verdicts with row-level evidence. • The Custom tab — paste your own schema and policies and run the same battery against them. • A Markdown and JSON report export, with fixture and vector names (not just counts) and engine identification, so a finding can be pasted straight into a security ticket or a bug bounty report.

TECHNICAL NOTES

• PostgreSQL 17.5 in WebAssembly via @electric-sql/pglite 0.3.16 — the database runs entirely in the browser, so nothing about your schema ever leaves the tab. (The version string is measured at runtime with SELECT version(), not hardcoded.) • Vite + React 18 + TypeScript (strict), plain CSS, no backend, no telemetry. • Unit tests, fixture regression tests and fast-check property tests cover the engine; CI runs lint, typecheck and tests on every push. • MIT licensed. The repository contains the full .kiro directory — steering docs, specs, hooks and custom agents — because the way it was built is part of the submission.

Built With

Share this project:

Updates

Submission history