# Show HN: Read-only scanner for exposed Supabase RLS tables and bundle keys

> Source: <https://breachsweep.com/supabase-rls-scanner>
> Published: 2026-11-24 19:53:13+00:00

**Key takeaway:** Run the free read-only scan against a deployed bundle to find exposed anon and service_role keys and unauthenticated PostgREST tables, then apply the generated SQL that enables RLS and scopes SELECT, INSERT, UPDATE and DELETE to an explicit tenant predicate.

Free · Read-only · PostgREST & JS Bundle Check

# Free Supabase RLS scanner

Supabase ships a public `anon` JWT to the browser by design. That architecture is only safe when PostgreSQL Row Level Security (RLS) is enabled and strictly scoped on every exposed table. BreachSweep’s free Supabase RLS scanner inspects your deployed frontend bundle, identifies your Supabase project and keys, and checks whether public PostgREST endpoints leak table schemas or rows without authentication.

Paste any URL you own or are authorized to test. The check is strictly read-only, requires no sign-up, and returns copyable SQL RLS migrations and AI fix prompts.

Paste a URL you own or are authorized to test. Placeholder examples: `target-app.com`, `my-app.lovable.app`, or `app.vercel.app`.

## What this Supabase RLS scanner checks

When you submit a deployed URL, the engine inspects the exact public surface an unauthenticated attacker sees in a browser:

- **Supabase project & key extraction:** Locates`*.supabase.co` URLs, public`anon` tokens, and accidentally shipped`service_role` keys in compiled Next.js or Vite bundles.
- **PostgREST OpenAPI & table exposure:** Probes`/rest/v1/` using the public anon key to detect tables reachable without a user session or missing RLS enforcement.
- **Leaked client secrets alongside Supabase:** Checks the same JavaScript chunks for Stripe secret keys, OpenAI/Anthropic keys, and misconfigured`NEXT_PUBLIC_` /`VITE_` variables.
- **Drop-in SQL & editor fix prompts:** Outputs concrete PostgreSQL RLS migration templates and 1-click prompts for Cursor, Lovable, and Claude Code.

## Baseline PostgreSQL RLS fix pattern

If a table in the `public` schema returns rows to the `anon` role, enable RLS immediately and lock every verb (`SELECT`, `INSERT`, `UPDATE`, `DELETE`) to an explicit ownership or tenant predicate:

```
ALTER TABLE public.workspace_records ENABLE ROW LEVEL SECURITY;

CREATE POLICY "tenant_members_read_own_records"
  ON public.workspace_records
  FOR SELECT
  TO authenticated
  USING (
    workspace_id IN (
      SELECT workspace_id
      FROM public.workspace_members
      WHERE user_id = auth.uid()
    )
  );
```

## Where public RLS checks stop — and real breaches still happen

Passing an unauthenticated RLS check does not guarantee multi-tenant safety. In real SaaS audits, we regularly find Supabase breaches behind login where the anon role is completely locked down:

- **Authenticated cross-tenant policies:** Policies written as`TO authenticated USING (true)` block anonymous scanners but let any signed-up user read every other customer’s rows.
- **Backend `service_role` bypasses:** Next.js API routes, Server Actions, and Supabase Edge Functions that instantiate the admin client bypass RLS completely — turning a single missing`.eq("org_id", ...)` filter into a full cross-tenant IDOR.
- **`SECURITY DEFINER` RPCs & Storage buckets:** Custom Postgres functions and storage policies often outlive table migrations and expose another tenant’s records or signed uploads.

To verify authenticated tenant boundaries across two real test accounts, book a [tenant isolation test](https://breachsweep.com/tenant-isolation-testing) or a [Deep Logic Sprint ($349)](https://breachsweep.com/start) — delivered with reproducible cURL PoCs, drop-in SQL/TypeScript fixes, and a free 30-day retest.

## Related Security Research

[All research articles](https://breachsweep.com/blog)

### The Supabase Service-Role Trap: How Misplaced Keys Silently Disable PostgreSQL RLSUsing Supabase or PostgreSQL Row-Level Security? In Next.js Server Components, one misplaced service_role key turns your multi-tenant database into an open leak. Here is how it happens and the zero-trust fix.
### Batch API IDOR: Why Bulk Endpoints Are a Common Multi-Tenant Data Leak in Modern SaaSSingle-record endpoints often pass authorization checks, but bulk endpoints (/api/items/batch-delete, GraphQL bulk mutations) frequently loop over unscoped arrays. Here is how attackers exploit batch routes to drain competitor data—and the SQL/Prisma fix.
### The UUID Fallacy: Why Unguessable IDs Don't Protect SaaS from BOLA/IDORMany SaaS teams assume UUIDv4 primary keys eliminate Insecure Direct Object References. Here is how UUIDs leak, why ORMs make cross-tenant data leaks effortless, and how to fix it in Prisma and PostgreSQL.

## FAQ

## Is exposing the Supabase anon key in my frontend a vulnerability?+

Not by itself. The Supabase anon key is designed to ship to browsers when Row Level Security (RLS) is enabled and correctly scoped on every table. Exposure becomes critical when RLS is disabled, policies are overly broad, or a service_role key ships to the client bundle.

## What does the free Supabase RLS scanner check?+

It fetches publicly reachable pages and compiled JavaScript bundles from a URL you authorize, extracts Supabase project URLs and client keys, checks for leaked service_role credentials, and runs non-destructive read-only PostgREST checks for publicly readable tables and schema metadata.

## Will this scan modify rows or write to my Supabase database?+

No. The public scanner performs read-only HTTP checks only. It does not insert, update, delete, or run destructive load tests against your project.

## If my tables require login, can the public RLS scanner verify tenant isolation?+

No. An unauthenticated scan only sees what is reachable with the public anon role. Authenticated cross-tenant RLS bugs — such as USING (true) for logged-in users, SECURITY DEFINER RPC leaks, or backend service_role bypasses — require an authorized two-tenant test.

## How do I fix an exposed Supabase table quickly?+

Enable RLS with ALTER TABLE public.<table_name> ENABLE ROW LEVEL SECURITY, create explicit SELECT/INSERT/UPDATE/DELETE policies tied to auth.uid() or a verified tenant claim, and rotate any service_role key that ever appeared in a client JS chunk.

## When should I upgrade from the free RLS scan to a Deep Logic Sprint?+

Upgrade when you have paying multi-tenant customers, custom Edge Functions, Next.js Server Actions using the service_role client, or Stripe billing workflows. The Deep Logic Sprint tests authenticated tenant boundaries and delivers reproducible cURL PoCs and drop-in fixes.
