Security Analysis

Is Supabase Safe?

Last updated: January 12, 2026

An honest security analysis of Supabase for developers considering it for their projects.

Quick Answer

Safe when RLS is enabled - most breaches are misconfigurations

Supabase is secure when Row Level Security (RLS) is properly configured. 83% of Supabase database exposures involve RLS misconfiguration (Escape.tech). The anon key is PUBLIC BY DESIGN - security comes from RLS policies, not hiding keys. Never expose the service_role key.

Security Assessment

Security Strengths

  • PostgreSQL RLS is battle-tested enterprise technology (unlike Firebase's proprietary rules)
  • SOC 2 Type II compliant with regular third-party security audits
  • Two-key architecture: anon key (public) vs service_role key (secret) makes security explicit
  • SQL-based policies are version-controllable and reviewable in code
  • Edge Functions keep server-side logic truly server-side

Security Concerns

  • 83% of Supabase exposures involve RLS misconfiguration (Escape.tech research)
  • RLS is NOT enabled by default - tables are publicly accessible until you enable it
  • Developers confuse anon key (safe to expose) with service_role key (NEVER expose)
  • Using auth.uid() instead of (select auth.uid()) causes performance issues at scale
  • CVE-2025-48757 showed 170+ Lovable apps with RLS misconfiguration

Security Checklist for Supabase

  • 1
    Enable RLS: ALTER TABLE your_table ENABLE ROW LEVEL SECURITY;
  • 2
    Write policies using (select auth.uid()) pattern: USING ((select auth.uid()) = user_id)
  • 3
    Search codebase for 'service_role' - must NEVER appear in frontend code
  • 4
    Test RLS: In Supabase SQL editor, run SELECT * FROM your_table; - should return 0 rows
  • 5
    Check Authentication → Policies in Supabase dashboard - every table should have policies
  • 6
    For Edge Functions: use createClient with service_role key only in server-side code

The Verdict

Supabase is enterprise-grade secure, but RLS misconfiguration is the #1 cause of data breaches. Unlike Firebase (proprietary Security Rules), Supabase uses standard PostgreSQL RLS - powerful but requires understanding. The anon key is meant to be public; the service_role key must stay secret. Use VAS to verify your RLS before launch.

Security Research & Industry Data

Understanding Supabase security in the context of broader industry trends and research.

10.3%

of Lovable applications (170 out of 1,645) had exposed user data in the CVE-2025-48757 incident

Source: CVE-2025-48757 security advisory

91%

of data breaches involve databases with misconfigured access controls

Source: Verizon Data Breach Investigations Report

4.45 million USD

average cost of a data breach in 2023

Source: IBM Cost of a Data Breach Report 2023

What Security Experts Say

Vibe coding your way to a production codebase is clearly risky. Most of the work we do as software engineers involves evolving existing systems, where the quality and understandability of the underlying code is crucial.

Simon WillisonSecurity Researcher, Django Co-creator

The problem with AI-generated code isn't that it doesn't work - it's that it works just well enough to ship, but contains subtle security flaws that are hard to spot.

Security Research CommunityCollective wisdom from security researchers

Frequently Asked Questions

Is Supabase safe for production?

Yes, Supabase is SOC 2 Type II compliant and used by production apps serving millions of users. However, 83% of Supabase security incidents involve RLS misconfiguration. The platform is secure; your configuration determines whether your app is secure.

Is my Supabase anon key supposed to be public?

Yes. The anon key is designed to be embedded in frontend code - it's not a secret. It can only access data that your RLS policies allow. Think of it as a 'guest pass' with restricted access. The service_role key is the secret one that bypasses RLS.

What's the difference between anon and service_role keys?

The anon key respects RLS policies and is safe to expose in frontend code. The service_role key bypasses ALL RLS and should ONLY be used in server-side code (Edge Functions, backend APIs). Exposing service_role gives attackers full database access.

How is Supabase RLS different from Firebase Security Rules?

Supabase uses standard PostgreSQL Row Level Security (SQL-based, battle-tested, version-controllable). Firebase uses proprietary Security Rules (JSON-like syntax, Firebase-specific). Both achieve the same goal but RLS is more powerful for complex queries and is industry-standard.

Why use (select auth.uid()) instead of auth.uid()?

Using (select auth.uid()) wraps the call in a subquery, which PostgreSQL evaluates once per query instead of once per row. At scale, auth.uid() without the select wrapper causes significant performance degradation. Always use the select wrapper in RLS policies.

Verify Your Supabase App Security

Don't guess - scan your app and know for certain. VAS checks for all the common security issues in Supabase applications.