← All posts
·updated ·11 min read·GuardLayer·how we write

Is Supabase Secure? What's Safe and What's on You

#supabase#rls#security#secrets

Yes — Supabase is secure enough for production. The platform is SOC 2 Type II compliant and ISO 27001 certified, with data encrypted at rest and in transit. Nearly every Supabase "breach" you read about is not a platform vulnerability — it's a misconfiguration in the app on top: a table with Row Level Security left off, a service_role key that reached the browser, or a secret committed to git.

"Is Supabase secure?" is really two questions wearing one coat. Is the platform secure? Yes, and demonstrably so. Is an app built on Supabase secure? That's entirely up to how you configure it — and it's where essentially all the real-world data leaks come from. Conflating the two is how people end up either needlessly afraid of a solid platform or dangerously overconfident about their own app.

Is the Supabase platform secure?

Yes. Supabase runs on Postgres and AWS infrastructure, is SOC 2 Type II compliant and ISO 27001 certified, encrypts data at rest with AES-256, and serves everything over TLS. Those are the same baseline controls you'd expect from any serious cloud data platform, independently audited. If your worry is "will Supabase itself get popped and leak my database," that's not where your risk lives.

Platform-level vulnerabilities do surface — all software has them — and Supabase discloses them as GitHub security advisories. So far there are four CVEs in Supabase's own components, none rated High or Critical. The vulnerabilities that stay open for months, across thousands of apps, are the ones in application configuration that no vendor can patch for you.

Is Supabase safe for production?

Yes, when you treat the anon key as public and protect every table with RLS — those two habits close the door on the overwhelming majority of incidents. Apps leak not because the platform is unsafe, but because Supabase hands you a loaded default and trusts you to handle it.

That default: tables created with SQL ship with Row Level Security turned off. Tables you make in the dashboard get RLS automatically, but migrations and AI coding tools create tables with SQL. On older projects every table in the public schema is also exposed over the auto-generated REST API, reachable with the anon key that lives in your browser bundle. (Since October 30, 2026, Supabase no longer grants brand-new tables to the API roles automatically; see what changed.) Until you enable RLS and write a policy, that table is world-readable and often world-writable. The platform is secure; the default is permissive; the gap between them is your job.

What that gap costs, in the real world. Early in 2026, security firm Wiz found the AI-built social network Moltbook exposing 1.5 million API tokens, 35,000 email addresses, and private messages — its creator said he "didn't write a single line of code." The root cause was textbook: a Supabase key in client-side JavaScript with no RLS policies behind it. It echoes CVE-2025-48757, where researcher Matt Palmer found 303 endpoints across 170 AI-built Supabase apps leaking data to anyone with the public anon key. Same root cause, different year: not the platform — the configuration.

The three things that decide whether your app is secure

If you get these three right, you've handled the failure modes behind nearly every Supabase data leak.

1. Enable RLS on every table in public. This is the big one. RLS is per-table and off for tables created with SQL, so the table that leaks is usually the one you added later and forgot — sitting right next to the ones you secured. The fix is one line after every CREATE TABLE, and it fails closed — with RLS on and no policy, the table denies everyone. Here's a messages table created with no RLS — exactly the Moltbook shape — and what GuardLayer reports on it. This is live engine output, not a mockup:

guardlayer scan · supabase/migrations/0003_messages.sqlLive engine output
Passed with warnings
92/100 · A
  • Warningsupabase/migrations/0003_messages.sql:1

    Table created without enabling RLS

    Add ALTER TABLE <table> ENABLE ROW LEVEL SECURITY; plus access policies right after the CREATE TABLE, and grant anon / authenticated only the privileges the app needs, per table, after RLS is on. A later migration in the same scan that enables RLS (or drops the table) clears this warning. It still shows when the enable is in a file whose run order is unknown (a schema.sql with no version number) or not part of this scan (a pull-request scan sees only the files the PR changes).

That table is now readable and writable by anyone holding your anon key. The scanner flags it before it ships; enabling RLS closes it.

2. Keep the service_role key server-side, always. The anon key is gated by RLS. The service_role key bypasses RLS entirely — it's your master key. The catastrophic mistake is letting it reach the browser, usually via a NEXT_PUBLIC_ prefix. If it ships in your bundle, anyone can read and write every row in every table, RLS or not. It belongs only in server code (Route Handlers, Server Actions, Edge Functions).

3. Don't leak secrets. Beyond the service_role key, the usual suspects: API keys hardcoded in source, database URLs in committed config, .env values that slip into the client. Keeping secrets out of the client and out of git is the third leg.

Is Supabase SOC 2 compliant?

Yes. Supabase is SOC 2 Type 2 compliant and audited every year by an independent auditor. Per its SOC 2 guide, the audit period runs from 1 March to 28 February, and the report is available to Team and Enterprise customers under Legal Documents in the organization dashboard.

The audit covers the platform: Postgres, Storage, Auth, Realtime, Edge Functions and the Data API. Supabase is explicit that its compliance "does not transfer to environments outside of the Supabase product or Supabase's control." If your customers need you to be SOC 2 compliant, you go through your own audit, and Supabase's report becomes one piece of evidence about a vendor. Two things auditors ask about that are yours to set:

  • Connection logging. Supabase turns Postgres connection logging off by default for new projects. If your SOC 2 program needs connection audit evidence, turn it on and decide how long you keep the logs.
  • Your access controls. SOC 2 says Supabase protects the platform. It says nothing about whether your RLS policies let one customer read another's rows.

Is Supabase HIPAA compliant?

The hosted platform can be, with a signed agreement and the right settings. Supabase acts as a business associate under HIPAA, but only once you have signed a Business Associate Agreement (BAA) and enabled the HIPAA add-on. Per its shared responsibility model, you need at least the Team plan to sign a BAA. Self-hosted Supabase doesn't come with these controls.

With the add-on, you mark projects as High Compliance, and the Security Advisor checks them continuously. The required settings include:

  • Point in Time Recovery,
  • SSL enforcement and network restrictions,
  • Postgres connection logging left on,
  • MFA on every Supabase account in the organization,
  • no PHI in public Storage buckets,
  • and no transferring HIPAA projects to an organization without the add-on.

The BAA covers Supabase's infrastructure, not your schema. A table without RLS that holds patient records is readable with your publishable key whether or not you signed a BAA, and so is a public bucket full of uploaded documents. The advisor checks your project settings; whether your policies are right is still your part of the shared responsibility.

Is Supabase encrypted?

Yes. According to Supabase's security page, all customer data is encrypted at rest with AES-256 and in transit with TLS, and sensitive values like access tokens and keys are also encrypted at the application level before they're stored.

What encryption at rest doesn't do is decide who can read your data through the API. It protects the disks and backups. A request with your anon key to a table without RLS gets ordinary, decrypted rows back, exactly like your own app does. Encryption and access control are separate layers, and leaks happen in the second one.

For individual secrets your database uses, such as a third-party API key called from a function, use Supabase Vault. It stores them with authenticated encryption, and backups and replication keep them encrypted. Supabase doesn't recommend pgsodium's transparent column encryption, which is pending deprecation. One caution: a SECURITY DEFINER function that reads vault.decrypted_secrets and can be run by anon hands the secret to anyone. Revoke it from public, anon and authenticated.

Is Supabase more secure than Firebase?

Neither is more secure by default. They use different models, and both leak the same way: through an access rule that's too open.

  • Firebase protects Firestore, Realtime Database and Cloud Storage with Security Rules, a rules language of its own. When you create a database in the console you choose Locked mode or Test mode; Test mode grants access to everyone.
  • Supabase uses Postgres itself: Row Level Security policies in SQL, plus grants on tables, columns and functions. Tables made in the dashboard get RLS; tables made with SQL don't, unless you enable it.

Supabase gives you more power in one place (SQL, joins, column grants, database functions), and with it a few failure modes Firebase doesn't have. RLS picks rows, not columns, so a user who can update their own profile row can change their own role unless a column grant stops them. SECURITY DEFINER functions skip RLS. And the service_role key bypasses everything. In our study of 844 public Supabase projects, 12% let users raise their own rights and 19% exposed a definer function anyone could call. If you're moving from Firebase, this guide maps Security Rules to RLS.

Is the Supabase anon key safe to expose?

Yes — the anon key is designed to be public and ships in your client bundle by design. It's safe because RLS is supposed to be the thing standing between it and your data. That's the catch worth internalizing: the anon key being public is only safe when your RLS is correct. With RLS off, the anon key everyone can see is a skeleton key to the exposed table. The key isn't the vulnerability; the missing policy is.

A 60-second "is my Supabase app secure" check

Run this in the SQL editor to list every public table with RLS still off:

select tablename
from pg_tables
where schemaname = 'public'
  and not rowsecurity;

Anything it returns is reachable by your anon key right now. Then grep your codebase for the two other classics:

# service_role key behind a public prefix?
grep -rn "NEXT_PUBLIC_.*SERVICE_ROLE" .

# hardcoded Supabase keys or URLs in source?
grep -rnE "eyJ[A-Za-z0-9_-]{20,}" --include=*.ts --include=*.tsx .

Clean on all three and you've covered the failure modes behind the incidents above. Or scan the whole repo on every push — GuardLayer checks these (and other Next.js + Supabase footguns) and posts the findings on your PR, so a forgotten table never reaches production.

FAQ

Is Supabase secure? The platform is — it's SOC 2 Type II compliant, ISO 27001 certified, and encrypts data at rest and in transit. Whether an app built on it is secure depends on configuration: enabling RLS on every table, keeping the service_role key server-side, and not leaking secrets. Almost all real-world Supabase data leaks are misconfiguration, not platform flaws.

Is Supabase safe for production? Yes, for production apps that treat the anon key as public and protect every public table with RLS. The platform meets standard enterprise security baselines. The risk is the permissive default — new tables have RLS off — so the work is on you to enable it before launch.

Is Supabase Auth secure? Supabase Auth is a solid, standards-based implementation (JWT sessions, OAuth providers, MFA). As with the database, the security of your usage depends on configuration — verifying sessions server-side, scoping RLS policies with auth.uid(), enabling leaked-password protection, and not trusting a user id sent from the client. Keep Supabase updated to pick up Auth security patches.

Is the Supabase anon key safe to expose? Yes, by design — it's meant to live in your client bundle and is constrained by your RLS policies. It's only safe when RLS is actually enabled and correctly scoped. The service_role key is the opposite: never expose it, ever.

Why do so many Supabase apps get breached then? Because tables created with SQL ship with RLS off, and it's easy to forget — especially in AI-generated code, which is behind incidents like Moltbook and CVE-2025-48757. The platform doesn't leak; the forgotten policy does. For what actually happened in each case, see the roundup of real Supabase security incidents. For how common each mistake is, see our study of 844 Supabase projects.

Can I get Supabase's SOC 2 report? On the Team or Enterprise plan, yes. Download the SOC 2 Type 2 report from Legal Documents in your organization dashboard.

Does Supabase sign a BAA on the Free or Pro plan? No. You need at least the Team plan, plus the HIPAA add-on, to sign a BAA and store PHI.

Is Supabase encrypted? Yes: AES-256 at rest and TLS in transit. Encryption protects disks and backups, not API access; RLS and grants decide who can read your rows.

Is Supabase more secure than Firebase? Neither is more secure by default. Firebase uses Security Rules, Supabase uses Postgres RLS and grants, and both leak through rules that are too open.

live check · read-only

See which of your Supabase tables anyone can read, free

Connect your Supabase project read-only. GuardLayer checks RLS, policies, grants and functions as they are right now, and gives you the SQL to fix each problem. It never reads your rows and can't change anything.

Check my Supabase project

Prefer to check code instead? Scan your repo, no signup.

Keep reading