AI APP RESCUE · DATA EXPOSURE
AI App Data Exposure Fix (RLS & Access Control)
One user can open another user's records. A customer reports seeing someone else's orders. A security researcher emails you a list of your own users. Or you simply don't know whether your Lovable, Bolt or Base44 app is protecting the data it stores.
Codersarts engineers find and close data exposure in AI-built apps: Supabase Row Level Security (RLS) that is off or too open, Firebase rules left in test mode, service keys shipped to the browser, and API routes that never check who is asking. We fix it without breaking the features that depend on that data.
Free first review · NDA available · Priority response for live exposure
What is data exposure in an AI-built app? Data exposure happens when an app lets someone read or change data they shouldn't have access to, often without logging in. In apps built with AI tools, it usually comes from database access rules that were never enabled, rules that allow everyone, secret keys placed in frontend code, or backend endpoints that skip permission checks.
Is Your App Exposing Data Right Now?
Check these signs. If any apply, treat the data as exposed until it's confirmed otherwise.
A user can see or edit records that belong to another account
Changing an ID in the URL or API request shows someone else's data
Supabase tables show RLS disabled, or policies use USING (true)
The service_role key, or another secret key, appears in your frontend code or browser network requests
Firebase Firestore or Realtime Database rules still allow open read or write access
"Private" pages or files load without logging in
You disabled RLS because a query stopped working, and never turned it back on
You received a vulnerability report or a ransom-style email about your data
Why AI-Built Apps Leak Data So Often
AI app builders generate working screens and tables quickly, but whether each table is locked down is left to you. Public disclosures and scans show how common this is:
Finding | Source |
303 endpoints across 170 Lovable-generated apps had Supabase tables readable through the public anon key because RLS was never enabled | Public disclosure, May 2025 |
57% of reachable Supabase-backed vibe-coded apps allowed unauthenticated table reads | Reeve, Aug 2026 |
Broken access control was the most common vulnerability class in an audit of 200 deployed vibe-coded repositories | Understanding the (In)Security of Vibe-Coded Applications, Aug 2026 |
The pattern behind most leaks: a Supabase app's anon key is public by design, so the only thing standing between the internet and your tables is RLS. When RLS is off, or a policy allows everyone, anyone with that key can query your data directly, without using your app at all.
The Most Common Causes We Fix
Supabase RLS Disabled
Tables created through SQL or migrations have no row-level protection until RLS is switched on. Every row is readable, and often writable, through the public API. → Supabase
RLS Policies That Allow Everyone
Policies such as USING (true) make RLS look enabled while still letting anyone read every row. AI tools often write these to make a broken query "work".
RLS Turned Off to Fix a Bug
When a query fails because of RLS, the AI suggests disabling it. The feature starts working and the data becomes public.
Service Role Key in the Frontend
The service_role key bypasses every policy. If it's in client code or a public repository, your database is fully open regardless of RLS.
Firebase Rules Left in Test Mode
Firestore and Realtime Database rules that allow open read or write expose the whole database to anyone with the project config.
API Routes Without Permission Checks
Backend endpoints that trust a user ID sent from the browser let anyone fetch another user's data by changing one value (an IDOR flaw).
Public Storage Buckets
Uploaded documents, invoices and images stored in public buckets can be opened by anyone with, or guessing, the URL.
Multi-Tenant Mix-Ups
In B2B apps, missing organization or tenant checks let one company's users see another company's records.
What We Do
1. Contain
We confirm exactly what is exposed and close the open path first, safely, so the app keeps working for legitimate users.
2. Fix Access Control Properly
We enable RLS on every table, write policies scoped to the right user, role or organization, lock down storage buckets and Firebase rules, and add authorization checks to every API route and backend function.
3. Rotate Secrets
We move privileged keys server-side, rotate any key that was exposed, and remove secrets from the repository history.
4. Review What Happened
We check database and API logs for signs that the exposed data was accessed, and document what was exposed, for how long and to whom, so you can make informed decisions about next steps.
5. Test & Prevent
We add automated tests that prove one user can't access another user's data, and checks that flag new tables without RLS before they ship.
Note: if personal data may have been accessed, you may have notification obligations under laws such as GDPR. We provide the technical findings; check your obligations with a legal advisor.
What a Correct Fix Looks Like
Enabling RLS is not enough on its own. A table with RLS on and no policies blocks your app; a table with a policy that allows everyone is still exposed. The fix is a policy that grants exactly the access each user needs, for example:
alter table public.orders enable row level security;
create policy "Users read their own orders"
on public.orders for select
to authenticated
using ( (select auth.uid()) = user_id );
Real apps need this for every table and every operation (select, insert, update, delete), plus rules for admins, teams and shared records. That's where most AI-generated policies go wrong, and where we spend our time.
Apps We Fix
Built with | Typical exposure |
Lovable + Supabase | RLS off or USING (true), keys in client, public storage |
Supabase or Firebase rules open, unchecked API routes | |
Entity permissions and private pages not enforced per user | |
Backend routes without auth checks, secrets in code | |
Cursor, Claude Code, v0 | IDOR in API routes, missing tenant checks, service keys in frontend |
Firebase apps | Firestore or Realtime Database rules left open |
How It Works
01 — Tell us what you've seen Send the app URL, project or repository access, and what you've noticed. Mark it urgent if data is exposed right now. We can sign an NDA first.
02 — Exposure check Engineers test access to every table, bucket and endpoint, and tell you what's exposed and how severe it is. → Security Audit
03 — Containment and fix We close live exposure first, then complete policies, key rotation and authorization checks across the app.
04 — Verify We re-test as an anonymous visitor, as a normal user and as another user, and confirm nothing leaks.
05 — Report and guardrails You receive a written report of what was exposed and fixed, plus tests and checks that stop it from coming back.
Start With the Help You Need
Your situation | Start here |
One specific leak or open table | |
Not sure if anything is exposed | Security Audit → https://www.codersarts.com/engineering/ai-app-rescue/security-audit |
Login and roles are also broken | Authentication → https://www.codersarts.com/engineering/ai-app-rescue/authentication |
Supabase issues across the app | Supabase Rescue → https://www.codersarts.com/engineering/ai-app-rescue/supabase |
Many problems beyond security |
Why Codersarts
Fix without breaking. We tighten access in a way that keeps your app's features working, rather than switching RLS on and leaving you with a broken app.
Root cause, every table. We review every table, bucket and endpoint, not only the one someone reported.
Proof, not promises. We test as different users and show you the result.
Clear written findings. You get a plain-language report of what was exposed and what changed.
You own everything. Your data, accounts and credentials stay in your name; access can be revoked any time.
Data Exposure
How do I know if my Supabase data is exposed?
Open the Supabase dashboard and check each table for an RLS warning, then review the policies on tables that have RLS on. Any table with RLS disabled, or a policy that uses true as its condition, can be read by anyone with your public anon key. Also check that the service_role key never appears in your frontend code. A security check tests this from the outside, the way an attacker would.
Why can users see other users' data in my app?
Usually because the database or API returns every record and relies on the frontend to show only the right ones. Anyone who calls the database or API directly, or changes an ID in a request, gets everything. The fix is enforcing access on the server side, through RLS policies or authorization checks, so the data never leaves the database for the wrong user.
Does enabling RLS fix the problem?
Only partly. Turning RLS on with no policies blocks your app's own queries, which is why AI tools often turn it back off. Turning it on with a policy that allows everyone leaves the data exposed. A real fix needs policies that grant each user, role or organization exactly the access it needs, for every operation on every table.
My app broke when I enabled RLS. What should I do?
Don't turn RLS off again; that reopens the data to everyone. The app broke because there are no policies allowing legitimate queries yet. Add policies scoped to the logged-in user, then test each feature. If the app has many tables and roles, this is where an engineer saves the most time and risk.
I think my data has already leaked. What should I do first?
Close the open access immediately, rotate any exposed keys, and preserve your logs so you can see what was accessed. Then confirm the full scope of the exposure across all tables, storage and endpoints. If personal data may have been accessed, check your notification obligations with a legal advisor. We can handle the technical containment and investigation urgently.
Can you fix data exposure in Firebase apps too?
Yes. We review Firestore, Realtime Database and Storage security rules, replace open test-mode rules with rules scoped to authenticated users and their own data, and add authorization checks to Cloud Functions and backend endpoints.
How long does it take to fix?
Closing live exposure can often be done the same day. A complete fix, with policies for every table, key rotation, endpoint checks and tests, usually takes a few days to a couple of weeks, depending on how many tables, roles and endpoints the app has.
How much does it cost?
Cost depends on the scope: how many tables, buckets and endpoints need policies, how complex your roles and teams are, whether keys need rotating across services, and whether an investigation of past access is needed. Urgent containment is a small, fixed task. The full fix is scoped after the check, with a fixed price agreed in writing first.
Do you sign an NDA?
Yes. We sign an NDA before you share access, and we only request the access needed for the check and fix.
Don't Wait for a User to Find It First
Send your app. We'll tell you what's exposed and close it.
Get an Urgent Data Exposure Check
Related: AI App Rescue