Supabase Multi-Tenant Security

Your Lovable app
is leaking
user data.

89% of AI-built apps ship with exposed databases. Most developers don't find out their tenants are reading each other's data until they get the breach email.

89%
of vibe-coded apps ship with vulnerabilities
170+
Lovable apps hit by CVE-2025-48757
13K
Users exposed in a single RLS leak
3 days
Before a "working" Lovable app got compromised

Recognize this code?
Your database is public.

Lovable creates your tables. Lovable connects your auth. Lovable doesn't turn on Row Level Security — and when you're multi-tenant, RLS alone isn't even enough.

What Lovable generated
-- Lovable's output. No RLS. No tenant isolation.
CREATE TABLE public.projects (
  id       UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  user_id  UUID REFERENCES auth.users(id),
  name     TEXT NOT NULL,
  data     JSONB
);
-- That's it. Any authenticated user can:
-- SELECT * FROM projects;  ← all tenants' data
-- DELETE FROM projects;    ← everyone's records

-- And if service_role is in client code:
const supabase = createClient(url,
  process.env.NEXT_PUBLIC_SERVICE_ROLE_KEY
)  // ← bypasses ALL security
What it should look like
-- Multi-tenant isolation, done properly
CREATE TABLE public.projects (
  id         UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  tenant_id  UUID NOT NULL REFERENCES tenants(id),
  user_id    UUID REFERENCES auth.users(id),
  name       TEXT NOT NULL,
  data       JSONB
);

ALTER TABLE projects ENABLE ROW LEVEL SECURITY;

CREATE POLICY "tenant_isolation" ON projects
  FOR ALL TO authenticated
  USING (
    tenant_id = (auth.jwt() ->> 'tenant_id')::uuid
    AND user_id = auth.uid()
  );

This isn't theoretical.
It's already happened.

CVE-2025-48757
170+ apps. One vulnerability.
Lovable-generated apps shipped with missing RLS policies. Any authenticated user could read, modify, or delete every other user's data — no exploit needed, just a direct API call. The anon key you intentionally put in client code became a master key to your entire database.
Real startup, 2025
13,000 users. 3 days to breach.
A developer built a "fully functional" social media app in 5 hours using Lovable and Supabase. Three days later, user data was leaking and API keys were exposed. The app was compromised before they had their first 100 users.
OpenAI key exposure
Surprise $XX,000 bill.
A startup had their OpenAI API key exposed in Lovable-generated client-side JavaScript. They discovered it only after receiving a massive unexpected bill from unauthorized usage. Lovable puts secrets behind VITE_ and NEXT_PUBLIC_ prefixes — bundled into browser JS, readable by anyone.
Supabase MCP + AI Assistants, 2025
Your AI coding tool is the attack vector.
Security researcher Simon Willison documented how AI coding assistants given service_role access to Supabase bypass RLS entirely through prompt injection — a malicious string in your database content can instruct the AI to exfiltrate data or drop tables. If you've connected Cursor or Claude to your Supabase MCP with service_role, every table in your database is one prompt away from exposure.

RLS enabled ≠ tenants isolated.

Most developers think enabling RLS means their app is secure. It doesn't validate that your tenant boundaries are actually enforced. A policy that says auth.uid() = user_id gives users access to their own rows — but still lets Tenant A read Tenant B's data if they share the same user across tenants.

✗  What most apps look like
🏢 Tenant A — sees all rows
🏢 Tenant B — sees all rows
🏢 Tenant C — sees all rows
Single shared table · No tenant_id · RLS checks uid only
VibeFixr.dev
✓  What it should look like
🏢 Tenant A — own rows only
🏢 Tenant B — own rows only
🏢 Tenant C — own rows only
tenant_id column · JWT claims · Isolated per tenant

You need a specialist,
not a generalist.

What you need done
Generic freelancer
VibeFixr.dev
Understands multi-tenant Supabase patterns
✗ Rarely
Specialised in it
Validates tenant isolation logic end-to-end
✗ No
Yes
Audits JWT claims for multi-tenancy
✗ No
Yes
Rewrites schema with correct RLS patterns
✗ No
Yes
Knows vibe-coded app architecture (Lovable, Bolt, v0)
✗ Unlikely
Yes — seen it all
Writes the actual fix for your codebase
~ Maybe, slowly
Yes — fast turnaround

Not a report. A fix.

01
Schema Audit
Every table reviewed for missing RLS, absent tenant_id columns, service_role misuse, and exposed secrets. You get a prioritised list of exactly what's broken and why it matters.
02
Tenant Isolation Analysis
We trace your entire auth flow — JWT claims, Supabase policies, how users map to tenants — and find every place data can cross tenant boundaries. The thing most developers never think to check.
03
Production-Ready Policies
The actual SQL. Correct RLS policies, tenant_id columns, JWT helpers, and migration scripts written for your specific schema. Paste-and-run, not documentation to wade through.
04
Implementation Support
If you need help deploying the fixes, I'm available for implementation. Most clients go from broken schema to production-safe multi-tenant setup in under a week.

Everyone's talking about it.
Few are fixing it.

"I watched a developer build what appeared to be a fully functional social media app in just 5–6 hours using Lovable and Supabase. Three days later, that same app was compromised. User data leaked, API keys exposed."
SB
Somanath Balakrishnan Medium · Aug 2025
"89% of apps didn't have RLS. Eighty-nine percent. Lovable sometimes initializes the Supabase client with the service role key instead of the anon key — that bypasses ALL security."
TG
Tomer Goldstein DEV Community · Apr 2026
"The scariest bugs in AI-generated code are invisible from the outside — backwards auth middleware, IDOR issues, broken tenant isolation. You need someone who actually reads the source."
SS
ShipSafe Builder DEV Community · Mar 2026

Find out if your
app is exposed — free.

Describe your app and what you've built. I'll personally review your setup and tell you exactly what's broken and what it takes to fix it. Human review, not an automated report.

✉️
Email
💼
Upwork
What to send
Describe your app, your stack, and what your multi-tenant setup looks like — I'll take it from there

Free audit · No commitment · Response within 24h