Skip to content
Product Building

The Supabase Security Flaw Leaving Your Lovable App Wide Open

AI builders ship B2B portals in days, but frequently leave the database completely unlocked.

A laptop screen showing a Supabase dashboard with a yellow 'RLS disabled' warning next to database tables on an operations desk.
Checking the Supabase Table Editor takes five minutes, but ignoring the warning can expose your entire client database.
Shreyansh Doshi Founder, Samvara Published Reviewed Read 7 min

What You Need to Know

AI builders like Lovable rely on Supabase for data storage, but new tables default to Row Level Security (RLS) being turned off. This means anyone with your public website key can read, modify, or delete your entire database. You must manually enable RLS and write specific access policies before launching.

At a Glance

Core Risk
Unauthorised data access and deletion
Default Status
RLS disabled on new tables
Audit Time
5 minutes via Supabase dashboard
Hardening Cost
Starts at £199

Best For

  • Founders using AI tools to build B2B MVPs
  • Operations managers overseeing custom software builds
  • Teams preparing to launch a Lovable or Supabase-backed portal

Not For

  • ×Consumer app developers
  • ×Founders not using Supabase or AI code generators
  • ×Enterprise IT teams managing legacy on-premise databases

Key Takeaways

  • New Supabase tables have Row Level Security (RLS) turned off by default.
  • AI tools like Lovable frequently skip RLS setup to keep development moving quickly.
  • With RLS off, anyone can use your public anon key to read, modify, or delete your data.
  • You can verify your security status in 5 minutes by checking the Supabase Table Editor.
  • Writing multi-tenant B2B security policies often breaks AI tools and requires human hardening.

You just used Lovable to generate a functional B2B portal. It logs people in, handles user profiles, and processes commercial quotes. It looks professional, the frontend works perfectly, and you shipped it in a fraction of the time a traditional build would have taken.

But if you did not explicitly prompt the AI to secure your database tables, your Supabase backend is likely completely exposed.

We saw a distinct pattern emerge throughout the latest wave of AI application development: thousands of functional, impressive Lovable apps shipped with Row Level Security (RLS) disabled. This is not a theoretical vulnerability requiring a sophisticated hacker. It means anyone with an internet connection and your public website key can read, modify or delete your entire database.

In B2B software, where your database holds commercial invoices, wholesale pricing matrices, or exhibitor contact lists, an open database is a catastrophic breach waiting to happen.

Here is exactly why AI builders leave this door open, how to check your Supabase dashboard in five minutes, and what you need to do to lock it down before you onboard a single paying client.

The Architecture of an AI-Generated App

To understand the flaw, you have to understand how modern web applications are built.

Tools like Lovable typically build Single Page Applications (SPAs) using frameworks like React or Vue. This is the frontend—the part your user sees in their browser.

Because the frontend needs somewhere to store data, it talks directly to a Backend-as-a-Service (BaaS), and Supabase is currently the undisputed king of this space for AI-generated code.

When your frontend wants to fetch a list of invoices for the logged-in user, it sends a request over the internet to your Supabase database.

To prove it is allowed to talk to your database, the frontend sends along an API key. Specifically, it uses the anon (anonymous) key.

The Reality of the Anon Key

The anon key is designed to be public. It is baked directly into your frontend code. Anyone who right-clicks your website, opens Chrome Developer Tools, and looks at the network traffic can copy your Supabase URL and your anon key in about ten seconds.

This is completely normal and intentional. The anon key is simply the front door key to the building. It says, "I am an application trying to speak to this database."

But once someone is inside the building, what stops them from walking into any room they want?

That is where Row Level Security (RLS) comes in.

Why Your Tables Are Wide Open

Row Level Security is a PostgreSQL feature that acts as a bouncer for every single row of data in your database. When a user requests data, RLS checks a specific policy to see if they are authorised to view or edit it.

If the policy says "User ID 5 can only see rows where the owner is User ID 5", the database filters the results before sending them back.

But here is the critical failure point: when you create a new table in Supabase, RLS is turned OFF by default.

If RLS is off, the database assumes anyone with the anon key has full administrative rights to that specific table.

When you use an AI builder like Lovable to add a feature—say, asking it to "create an exhibitor list for the upcoming trade show"—the AI writes the code to create the exhibitors table in Supabase. It makes the frontend look great. It makes the forms work.

But unless you specifically commanded the AI to "enable Row Level Security on the exhibitors table and write policies restricting access to authenticated users based on their company ID," the AI skips it. It prioritises making the application functional over making it secure.

As we noted when evaluating Which Vibe Coding Platform Survives B2B Operations?, AI tools will frequently take the path of least resistance to deliver a working prototype. Writing complex database policies introduces errors, so the AI simply avoids them.

What an Attacker Can Do

If RLS is disabled, someone does not need to hack your servers. They simply ask your database for your data, and your database hands it over.

An attacker can take your public anon key, open a standard command-line terminal, and write a simple network request:

  1. Read everything: They can ask for SELECT * FROM invoices. Your database will return every invoice for every client you have.
  2. Modify data: They can send an UPDATE command to change the banking details on pending invoices to their own.
  3. Destroy the business: They can send a DELETE FROM clients command, wiping your primary data structures instantly.

They do not need a login. They do not need to exploit a zero-day vulnerability. They are just using the front door you left wide open.

The Five-Minute Supabase Check

You do not need to be a developer to check if your application is exposed. If you are the owner or operator of the project, you can verify your security posture right now.

  1. Log into your Supabase dashboard. Open your project.
  2. Navigate to the Table Editor. Click the grid icon on the left-hand menu to view your database tables.
  3. Look for the warning. In the top right of the table view, or next to the table names, look for a shield icon or a warning tag.

If you see a grey or yellow tag that says "RLS disabled", that specific table is entirely public to the internet for reading, writing, and deletion.

Check every table that holds business logic: users, profiles, invoices, quotes, organisations. If any of them have RLS disabled, your application is currently leaking data.

How to Lock Down a B2B Application

Turning RLS on is easy. Writing the policies that make your app work securely is where the complexity spikes.

If you click the "RLS disabled" warning in Supabase, you can toggle it on immediately. However, doing so will instantly break your application. Your Lovable frontend will suddenly start returning empty screens and "unauthorised" errors, because the database is now blocking all traffic by default.

To let legitimate traffic back in, you have to write Policies.

The Consumer App vs B2B App Security Gap

In a simple consumer app, policies are straightforward. You tell the database: "Only let the user read a row if their unique authentication ID matches the user_id column on that row."

But B2B software relies heavily on multi-tenant architecture.

If you are building a wholesale ordering portal, a user does not just own their own data. They belong to a Company. That Company has multiple staff members. A staff member with an 'Admin' role should see all invoices for the Company. A staff member with a 'Viewer' role should only see the catalogue.

Writing an RLS policy for this requires cross-referencing tables. The database has to check: Who is asking? What company do they belong to? What role do they have in that company? Does that role have permission to view this specific invoice?

This is precisely where AI coding tools break down. When you ask an AI to write a multi-tenant RLS policy, it frequently creates circular dependencies (where table A checks table B, which checks table A) resulting in infinite loops that crash the database query.

This is why B2B operations require strict adherence to The Single-Transaction Rule for MVP Software Development—you must tightly define and secure core data interactions before expanding the feature set.

The £199 Hardening Step

You can use AI to build 90% of your B2B MVP. It remains the fastest, most cost-effective way to validate an operations tool or client portal.

But the final 10%—specifically the database security, authentication flow, and multi-tenant data isolation—requires human intervention. You cannot rely on an LLM to reliably secure enterprise data structures without explicit supervision.

If your Supabase dashboard shows RLS disabled across your core tables, stop building features immediately.

Fixing this is not a multi-month development project. A competent engineer can review your database schema, map out the required multi-tenant relationships, enable RLS, and write the custom SQL policies in an afternoon.

At Samvara, a standard security review and RLS hardening for a typical B2B MVP starts at £199. It is a single, contained expense that transforms a dangerous prototype into a production-ready system.

Do not let the speed of AI development trick you into skipping fundamental database security. Check your Supabase dashboard today, find the gaps, and lock them down before your first commercial user logs in.

Useful tool

Try Samvara's Document Readiness Checklist — Export/import docs by mode.

Quick Comparison

Feature Default AI Build (RLS Off) Hardened Build (RLS On)
Data Visibility Public to anyone with anon key Restricted by user ID or company role
Deletion Risk Total (Anyone can drop rows) Zero (Blocked by default policies)
Setup Speed Instant (App works immediately) Requires manual policy writing
B2B Compliance Fails basic security audits Passes standard commercial reviews

Frequently Asked Questions

What is Row Level Security (RLS) in Supabase?
RLS is a database feature that acts as a gatekeeper for individual rows of data. It ensures that a user can only read, update, or delete data they are specifically authorised to access, based on policies you define.
Why does my Lovable app have RLS disabled?
Supabase disables RLS by default on new tables. AI coding tools like Lovable prioritise making the application function over securing it, so unless you explicitly prompt the AI to write security policies, it will leave the tables unlocked.
Can someone hack my app if they have the anon key?
Yes. The anon key is public and visible in your website's code. If RLS is disabled, anyone with that key can query your database directly to read, change, or delete any data in your system.
How do I fix the 'RLS disabled' warning?
You must turn RLS on in the Supabase dashboard and write SQL policies for each table. These policies dictate exactly which users or roles are allowed to run SELECT, INSERT, UPDATE, or DELETE commands.

Bottom line

Do not ship a vibe-coded MVP to paying clients without a manual database audit. Check your Supabase dashboard for the 'RLS disabled' warning, turn it on, and pay the £199 to have an engineer write secure, multi-tenant access policies before your first user logs in.

How Samvara researches this guide

We write for exhibition organisers and import/export operators in Australia, the UK, Europe, the US and India. Guides favour specific, verifiable operational advice over generic tips — grounded in systems we have shipped, client workflows, and current industry practice. We revisit articles as tooling and regulations change.

Written by

Shreyansh Doshi, Founder of Samvara

Shreyansh Doshi is the founder of Samvara Technologies, a product studio building operator software and SaaS products for exhibition, import/export, travel and fitness businesses in the UK and Australia. He writes about product delivery, operations systems, and where AI does and does not belong in a real workflow.

Keep Reading

Popular in Product Building

Guides readers open next

Free tool for this guide

Document Readiness Checklist

Export/import docs by mode — open it in your browser, no signup.

Open tool
All tools