Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 2 min read

Supabase RLS off or set to true: how AI-built apps leak every row (proofforge.live)

Supabase puts a database API on the public internet. The anon key ships in your frontend by design. What stops a stranger from reading or editing every row is Row Level Security (RLS). If a table has RLS off, or has a po

Supabase puts a database API on the public internet. The anon key ships in your frontend by design. What stops a stranger from reading or editing every row is Row Level Security (RLS). If a table has RLS off, or has a policy that says using (true), anyone with your public URL and anon key can query it.

AI code generators create tables quickly and often leave RLS for later. Later does not always come.

How to check your own project

  1. In the Supabase dashboard, open Table Editor. Tables with RLS disabled show a warning. Turn it on for every table in the public schema.
  2. Open Authentication, then Policies. Read each policy. using (true) on select means everyone can read. with check (true) on insert or update means everyone can write.
  3. Test from outside. With your project URL and anon key, call https://YOUR_PROJECT.supabase.co/rest/v1/your_table?select=* with the headers apikey: ANON_KEY and Authorization: Bearer ANON_KEY. If you get rows back while logged out, the table is open.

Only test projects you own.

Common mistakes

  • RLS enabled but with a blanket allow policy added to make an error go away.
  • Policies that check a column the user can edit themselves.
  • Views and functions that bypass RLS.
  • The service_role key placed in frontend code. That key skips RLS completely and must stay on the server.

Fix

Enable RLS on every table. Write policies tied to the user, for example using (auth.uid() = user_id). Keep service_role server-side only, and rotate it if it was ever in client code.

Check your own app from the outside, free. Run the free ProofForge scan on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: see pricing. Building with an AI agent? There is an MCP server so it can check before it deploys.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.