Leaked keys and open Supabase tables in 640 public Lovable repos
LeakWarden is a security scanner I make and sell. I ran it on 640 public GitHub repositories made with Lovable. One of them was deleted before the final run, so the numbers below cover 639. 91 of them (14.2%) had at lea
LeakWarden is a security scanner I make and sell. I ran it on 640 public GitHub repositories made with Lovable. One of them was deleted before the final run, so the numbers below cover 639.
91 of them (14.2%) had at least one high-severity finding.
The free version is open source and covers secrets and .env files. The Supabase, webhook and browser key checks in this post are in the paid version.
How I picked the repos
Lovable adds a dev dependency called lovable-tagger to the projects it generates. I used GitHub code search to find public repositories whose package.json contains it.
The sample is whatever the search returned. It is not every Lovable project on GitHub.
285 of the 639 repos use Supabase. 209 of those have their SQL migrations in the repo, so the database rules could be checked. The other 76 don't, and are left out of the Supabase rows. The median repo has 23 commits on its default branch.
The search and the final scan were done in November 2026.
How I scanned them
Each repo was cloned and scanned with LeakWarden 0.2.1. The scan covered the current files and the git history of all branches, up to 2000 commits. Then the clone was deleted.
No key was used or tested. LeakWarden never validates the keys it finds, and it prints them redacted.
I checked samples of the high-severity findings and fixed the scanner where it raised false alarms. Then random samples of 20 repos were reviewed finding by finding against the code, with each verdict written down and a new set of repos each round.
The first round found 13 false alarms in 61 high findings, in patterns like demo login lists and policies that a later migration dropped. I fixed those. The second round was worse: only 29 of 49 high findings were real. The database findings held up (25 of 31), but hard-coded passwords, default values for secrets and .env files with only public keys were mostly noise. I moved those rules down to medium or low and ran the scan again.
The third round judged 20 repos none of the earlier rounds had seen. 51 of 58 high findings were real, 5 were false alarms, and 2 could not be decided from the code alone. 17 of the 20 repos had at least one real problem. Read the numbers below with that rate in mind: roughly one flagged repo in seven is a false alarm.
Findings are counted per repository. A repo with five leaked keys counts once in the secrets row.
Low-severity findings are left out of the numbers. These are things like CORS on Supabase edge functions, Supabase anon keys and env values that are meant to be public. They are usually fine.
Repository names are not published.
Results
| Finding | Repos | Share |
|---|---|---|
| At least one high-severity finding | 91 of 639 | 14.2% |
| Secret in the current files | 15 of 639 | 2.3% |
| Secret only in git history | 15 of 639 | 2.3% |
| .env with server-side values tracked in git | 17 of 639 | 2.7% |
| Supabase table without RLS | 16 of 209 | 7.7% |
Write policy with using (true)
|
39 of 209 | 18.7% |
| Either of the two RLS problems | 49 of 209 | 23.4% |
| Supabase service role key in the repo or read by browser code | 11 of 285 | 3.9% |
| Payment webhook with no visible verification | 5 of 46 | 10.9% |
The RLS rows count only the 209 Supabase repos whose migrations are in the repo. The webhook row counts only the 46 repos that have a webhook handler. "Only in git history" means the secret is not in the current files of any branch but is still in an older commit.
The database was the weak spot. Almost one in four Supabase projects with migrations in the repo had a table without RLS or a write policy that lets every user change every row they can read. Leaked keys were rarer: 28 repos (4.4%) had a high-severity secret in their files or history. Hard-coded passwords in code were common, but most turned out to be demo logins or test data, so they count as medium and are not in these numbers.
Secrets and .env files
15 repos (2.3%) had a high-severity secret in the current files, and 15 (2.3%) had one only in git history. A secret that only exists in an old commit is still public. Anyone can clone the repo and check out that commit.
A quarter of the repos (164) track a .env file in git. In most of them it only holds the Supabase URL and anon key, which are meant to be public, so those count as low. 17 (2.7%) had values in it that the scanner treats as server-side. This row is the least precise one: in the last review, 4 of 10 such findings were client tokens of a payments SDK that are meant for the browser.
Supabase
Out of the 209 Supabase repos with migrations, 16 (7.7%) created a table and never turned RLS on. 39 (18.7%) had an update, delete or all policy with using (true), so any signed-in user, and sometimes anyone, can change every row they can read. Signing up is usually open, so "signed in" protects little.
11 of the 285 Supabase repos (3.9%) had the service role key in the repo or read it in browser code. That key skips RLS completely.
Webhooks
46 repos had a webhook handler. In 5 of them a payment webhook acted on the event without checking a signature, a shared secret or the provider's API. The base is small, so take the share with care.
What these problems look like
I wrote the snippets below for this post. None of them comes from a scanned repo.
Tables without RLS, or with open policies
Supabase puts the anon key in the browser on purpose. Row level security is what decides which rows that key can touch. If RLS is off on a table the API exposes, anyone with the anon key can usually read and change it.
A migration like this creates such a table:
create table public.orders (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users,
total numeric
);
-- RLS is never enabled
RLS can also be on and still let everyone in:
alter table public.orders enable row level security;
create policy "anyone" on public.orders
for all using (true) with check (true);
Enable RLS on every exposed table. Then write policies that compare the row to the logged-in user:
alter table public.orders enable row level security;
create policy "own orders" on public.orders
for select to authenticated
using (auth.uid() = user_id);
Add insert, update and delete policies only where the browser really needs them. Anything else can run in an edge function.
Then check the live database too. The migrations in the repo may not match it.
Webhooks that trust the body
A payment provider calls your webhook when someone pays. If the handler doesn't check the signature, anyone who finds the URL can post a fake "payment succeeded" event.
// trusts any request
app.post("/api/webhook", express.json(), async (req, res) => {
const event = req.body;
if (event.type === "checkout.session.completed") {
await grantPro(event.data.object.client_reference_id);
}
res.sendStatus(200);
});
Verify the signature with the provider's SDK and your webhook secret. With Stripe it looks like this:
app.post("/api/webhook", express.raw({ type: "application/json" }), async (req, res) => {
let event;
try {
event = stripe.webhooks.constructEvent(
req.body, req.headers["stripe-signature"], process.env.STRIPE_WEBHOOK_SECRET);
} catch (err) {
return res.sendStatus(400);
}
// handle the event as before
});
The check needs the raw body. If you parse it as JSON first, verification fails. Other providers have the same kind of check in their SDK.
Committed .env files and secrets in history
# .env, committed to the repo
VITE_SUPABASE_URL=https://abcd.supabase.co
VITE_SUPABASE_ANON_KEY=eyJhbGciOi...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOi...
OPENAI_API_KEY=sk-...
The first two lines are meant to be public. LeakWarden rates them low. The last two are server secrets.
Deleting the file in a new commit doesn't remove it. The old commits still have it.
Fix it in this order:
- Rotate every real secret in the file. Treat the old values as known.
- Remove the file from history, for example with
git filter-repo --invert-paths --path .env, and force-push. - Add
.envto.gitignore. Commit a.env.examplewith empty values instead.
Forks and old clones keep the old commits. That's why rotation comes first.
Server keys in browser variables
Any VITE_ variable your code reads ends up in the JavaScript Vite ships to the browser. Next.js does the same with NEXT_PUBLIC_. A secret with one of those prefixes is public, even if the repo is private.
const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_SERVICE_ROLE_KEY // skips RLS
);
The service role key skips RLS. In the browser it gives anyone read and write access to every table the API exposes.
Rotate the key and use the anon key in the browser. Anything that needs the service role moves to an edge function or your own server.
Limits
This is a sample of public repos. Private repos and deployed apps may look different.
I only looked at code. A migration that shows a policy does not prove the live database has it. Changes made in the dashboard after the migration can go either way.
A repo doesn't tell me whether the app is live or has users.
Per-repo counts don't show how many secrets or tables each repo has.
A repo with only low findings does not show up in the results table.
In repos with more than 2000 commits, part of the history was not scanned.
Only samples were reviewed, and the last review above still found some false alarms. The scanner can also miss things it has no rule for.
Try it on your own repo
The free scanner checks your files and git history for secrets and committed .env files. It's at https://leakwarden.dev, or pipx install leakwarden.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.