Application security
Lovable data leaks: how to secure your Supabase app
By Qlinnt · Updated
Protect private Supabase data with explicit database grants, Row Level Security policies and tests as both signed-out and separate signed-in users. A public Supabase key is expected; unintended access to private rows is the problem. Qlinnt can flag some public signals, but it cannot enforce permissions or certify your app as secure.

What the Lovable reports do—and do not—establish
A November 3 DEV article by Yashvi Kothari, citing research at Crissy Field, reports 159,041 apps examined, 34,545 using Supabase and 24,664 exposing database records. It also describes more than 80,000 user profiles. These are figures attributed to that article, not measurements by Qlinnt or totals independently reproduced for this guide. Different counts describe different populations; do not treat all scanned apps as confirmed leaks.
A separate May 7, 2026 WIRED report by Andy Greenberg describes RedAccess research into publicly accessible AI-built apps across several platforms. It includes responses from the vendors and notes that some apparently sensitive data could be test or generated data. That is a different investigation: its totals must not be added to the DEV figures as if they were one study.
Public accessibility, unintended exposure and confirmed theft are different claims. The practical question for your app is which identities can access which records, and whether that matches your intended product behavior. A deliberately public catalog is not the same as a private customer table. None of this establishes that every Lovable app is vulnerable, or that Supabase itself was compromised.
A public Supabase key is not automatically a leaked secret
Supabase explicitly supports publishable keys in browser applications. The newer format starts with sb_publishable_; the legacy anon key is a JWT. These identify the application component. A signed-in user's identity is separate, and database grants plus RLS policies determine which operations and rows that request can reach. Hiding the public key or changing the page URL does not replace authorization.
Secret keys beginning with sb_secret_ and legacy service_role keys belong on trusted servers. They have elevated access and bypass RLS. Never place them in frontend environment variables, browser bundles, public repositories or AI prompts. Moving a key into an environment variable helps only if that variable is never bundled into client code. If a privileged key was exposed, revoke or rotate it using the provider's process; deleting the visible string does not invalidate existing copies.
Before collecting real user data: a prevention checklist
Start with a staging environment and synthetic records. Write down what a signed-out visitor, a regular customer, another customer's account and an administrator should be able to do. Include direct API requests, not just visible buttons. Only test applications and projects you own or have permission to assess.
Use the following list as a review plan. Each item needs evidence from your own project; an AI-generated explanation or a successful login is not proof that access controls work.
- Inventory exposed tables, views, functions, storage buckets and server endpoints; identify where personal or business-sensitive data lives.
- Enable RLS on exposed tables containing private data and review both existing policies and role grants.
- Grant anon only deliberately public operations; grant authenticated only the operations your product needs.
- Scope policies to the row owner or a validated organization membership, and check both reads and writes.
- Keep privileged keys on the server and authorize the caller before using a privileged client.
- Review the actual API fields returned. Hiding an email or document in the UI does not remove it from a response.
- Check storage access, shared links, views and security-definer functions separately; table policies do not prove all those paths are safe.
- Run separate-user regression tests before deploying schema or policy changes, and review Supabase Security Advisor findings.
An RLS example for private rows, with the assumptions made explicit
This SELECT-only example assumes a staging table named private_notes with an owner_id column containing the owning user's auth.users ID. It is not a production migration for every schema. Review existing grants and policies first: permissive SELECT policies can combine with OR, so adding a restrictive-looking policy does not cancel an existing allow-everyone policy.
The example removes anonymous table privileges and gives authenticated users a read path constrained by ownership. It does not implement inserts, updates, deletes, team sharing or administrator access. Design and test those rules separately; writes may also need WITH CHECK conditions to prevent assigning a record to another owner.
Enabling RLS without suitable policies can intentionally block ordinary application access. Test the expected allowed actions as well as the denied ones, and deploy through a reviewed migration. Never use a service-role client to prove that a regular user's RLS restrictions work, because that privileged role bypasses RLS.
-- Staging example only: adapt names and review existing policies.
alter table public.private_notes enable row level security;
revoke all on table public.private_notes from anon;
grant select on table public.private_notes to authenticated;
create policy "Owners read their notes"
on public.private_notes
for select
to authenticated
using ((select auth.uid()) = owner_id);Test signed-out access and isolation between two users
In staging, create two test users and synthetic private records owned by each. Make requests through the same client and endpoints the application uses, with each user's actual session. Request the other user's synthetic record directly rather than relying on a list page that filters it out. For organization-based apps, repeat this with two organizations and a user who has no membership.
The matrix below is an example for an owner-only notes app, not a universal policy. Compare the returned fields and records with the expected result. HTTP 200 with an empty array can be a valid RLS-filtered response; it does not by itself prove a leak. A private record returned to an unauthorized test user is the meaningful failure. Test create, update and delete rules separately using disposable synthetic data.
Example access expectations for owner-only private notes
| Identity | User A's private note | User B's private note | Intentionally public content |
|---|---|---|---|
| Signed-out visitor | Denied | Denied | Allowed |
| User A | Allowed | Denied | Allowed |
| User B | Denied | Allowed | Allowed |
| Another signed-in user | Denied | Denied | Allowed |
Scroll horizontally to read the full table.
Changes that can hide the problem without fixing it
A login screen checks who a visitor is only if the backend validates the session. Even valid authentication does not decide which customer records that user may read. A shared dashboard can still expose another customer's data if the API trusts an ID supplied by the browser without checking ownership.
Likewise, HTTPS protects transport, CORS controls certain browser interactions and robots.txt provides crawler instructions. They do not replace database or server authorization. Protect private records at every path that serves them, not only at the page that normally displays them.
- Do not treat noindex, an unlisted URL or a renamed database table as an access control.
- Do not fix a legitimate access error by disabling RLS or adding USING (true) to private tables.
- Do not rotate a public key and assume unchanged overbroad policies are now safe.
- Do not ask an AI assistant to fix authorization without supplying the intended roles, ownership rules and allowed/denied test cases.
What to do if you discover unintended exposure
Treat this as an incident investigation, not just a visual bug. Restrict the affected access promptly and preserve the logs and configuration history needed to understand what happened. Use the smallest evidence necessary; do not export a full customer table just to demonstrate the issue, and do not post records or credentials publicly.
Exposure alone does not establish who accessed the data. Determine the affected data categories, endpoints and time window, and seek appropriate security and privacy advice about notifications or other obligations. Removing a public URL or passing a later scan does not show that previously exposed records were never accessed.
- Contain the exposed path with reviewed grants, policies or a temporary service restriction, while preserving relevant evidence.
- If privileged credentials leaked, remove the exposure and revoke or rotate them; review deployments, bundles and caches for copies.
- Inspect available API, authentication and infrastructure logs. Record what is known, unknown and unavailable rather than assuming no access occurred.
- Test the corrected permissions with synthetic data as a signed-out visitor and as separate users; confirm legitimate product actions still work.
- Document the cause, deployment changes and follow-up tests, and obtain help for sensitive data or uncertain incident scope.
Can Qlinnt detect or prevent this kind of leak?
Qlinnt is a read-only public website scanner. It cannot change your Supabase grants, apply RLS policies, revoke keys or prevent an attacker from making a request. It can help prioritize some externally observable signals before or after a deployment, alongside an authorization review.
The current Supabase probe observes public browser requests, recognizes sb_publishable_ keys and legacy anon JWTs, and rejects user-session tokens and privileged keys for this check. It discovers a bounded set of table names through OpenAPI and makes limited read requests for at most one row per table. An empty 200 response does not trigger an exposure finding. A nonempty response is reported as a potential public-read signal, because the data may be intentionally public; it does not prove that RLS is missing or misconfigured.
There are still blind spots: the probe does not inspect SQL policies, prove that observed rows are private, or test another logged-in user's session. Unavailable or uninspected checks must not be treated as passed. The secret detector recognizes legacy service_role JWTs and selected provider patterns, but not every possible secret format, including the newer Supabase sb_secret_ format. No finding means no matching signal was reported in the scanned scope; it is not evidence that your app is secure.
Current Qlinnt coverage and the checks you still need
| Area | What Qlinnt can flag | What still needs verification |
|---|---|---|
| Public Supabase reads | Nonempty limited reads using observed publishable or legacy anon keys | Whether rows are private, whether public access is intentional, and any unavailable or uninspected policies |
| Secrets in public assets | Selected recognizable secret patterns and legacy service_role JWTs | Other formats, backend secrets and actual credential privileges |
| Exposed configuration files | Known public file paths with matching content signatures | Other paths and the full server configuration |
| User and tenant isolation | Not tested by a public unauthenticated scan | Separate-user and cross-organization authorization tests, including writes |
Scroll horizontally to read the full table.
A safer launch workflow for your Lovable app
Use the public scan as an initial layer, then spend review time on the data paths that matter most. A marketing page and an app holding identity documents have different consequences if access rules are wrong. For regulated or highly sensitive information, obtain a qualified review before collecting real records.
A useful AI coding request is specific: describe the private tables, each role's intended access, the ownership or membership rules and the synthetic tests that must pass. Ask for a reviewed migration and regression tests, not a promise that the app is secure. Recheck after schema changes and after the next AI-generated feature, because a previously correct policy does not cover a new table automatically.
- Define which data is private and who is allowed to access it.
- Review grants, RLS policies and server authorization in staging.
- Test a signed-out visitor, user A and user B with synthetic records.
- Scan the deployed public surface for supported signals and investigate findings in context.
- Deploy the reviewed changes and repeat both authorization tests and relevant public checks.
Is every Lovable app affected?
No. A platform name does not establish a vulnerability. Exposure depends on the individual app's data, deployment, grants, policies and server authorization. The cited reporting is not a security assessment of your app.
Does enabling RLS prevent every data leak?
No. You still need correct policies and grants, protected privileged credentials and checks on other data paths such as storage, functions and server endpoints. A broad existing policy can defeat the intended restriction.
Is a Supabase anon or publishable key in the browser a breach?
Not by itself. Supabase designs those keys for public components. The important question is what the database allows the resulting role and user to access. Secret and service-role keys must stay server-side.
Does a clean Qlinnt scan prove my database is safe?
No. The scan has limited public coverage and does not audit your database policies or test cross-user authorization. Combine it with manual review and synthetic access tests.
Sources and further reading
- Supabase documentation: Row Level Security
- Supabase documentation: API keys, public keys and privileged keys
- Supabase documentation: securing the Data API
- Yashvi Kothari, DEV, November 3: the commentary and figures discussed above
- Crissy Field research linked by DEV: consult the original methodology before reusing its totals
Start with a public-surface check of your own app
Scan a public website you own or are authorized to assess. Verify your email to read every finding explained in the free diagnosis. Then review the relevant database policies and test user isolation; the scan does not replace those checks. Evidence and fix prompts are not included in the free diagnosis.
Check my public website for free