r/Supabase • • 11h ago

tips Quick way I audit Supabase RLS leaks using only HEAD + Prefer: count=exact

2 Upvotes

When I review Supabase projects built quickly with Lovable or Bolt, the most common leak is forgetting to enable RLS on a table or leaving a broad SELECT policy for anon.

Instead of pulling actual rows from someone's database during a quick check, you can send a HEAD request to /rest/v1/<table> with the public anon key and Prefer: count=exact. PostgREST returns the exposed row count inside the Content-Range header (for example */142) with an empty response body, so you immediately know whether unauthenticated reads are open without downloading user data.

I wrapped that check together with OpenAPI table discovery, rpc/ probing, and public storage bucket checks into a small open-source CLI (npx supabase-rls-check) and a browser checker. Attached is a sample audit output showing exposed tables and generated ALTER TABLE ... ENABLE ROW LEVEL SECURITY fixes.

Source is on GitHub if you want to run it locally in CI: https://github.com/Tthanh2k6/supabase-rls-check

Curious if anyone here also checks anything else automatically on anon before shipping, like auth.users views or SECURITY DEFINER RPCs?


r/Supabase • • 5h ago

tips My project is running out of Disk IO Budget

Post image
0 Upvotes

I created a Chrome extension that already has 289 users, 190 of them active weekly, with about 15k total requests per day (low numbers).

Apparently, the RAM is maxed out, and Supabase is asking me to upgrade to the next plan ($25 USD).

I don't want to, because the platform is small and I'm not monetizing it. I've tried many things, but nothing has worked.

Has anyone else had the same issue, or does anyone have any advice?

Platform is: Lexigo


r/Supabase • • 11h ago

auth Blocking disposable emails and Gmail alias farming in the Before-User-Created hook

1 Upvotes

Built a tiny API that blocks disposable emails and Gmail alias farming (j.o.h.n+7@gmail) right in Supabase's Before-User-Created hook. One call, 1,000 free checks a month, no card. Looking for 10 people running free tiers who'll try it and tell me what it misses. Snippet in comments.


r/Supabase • • 1d ago

database How to check whether anyone on the internet can read your Supabase tables

2 Upvotes

Edit: commenters caught several things. Check 1 shows grants, check 3 covers a second user and writes, there's a new check 4, and I removed a "most common" claim I couldn't support.

Edit 2: check 1 now shows each privilege separately, and there's a new check 5.

It's easy to ship a Supabase table that anyone can read. These are the checks I run. None of them needs an extra scanner.

1. Tables with row-level security off

select tablename,
       has_table_privilege('anon', t, 'select') as can_read,
       has_table_privilege('anon', t, 'insert') as can_insert,
       has_table_privilege('anon', t, 'update') as can_update,
       has_table_privilege('anon', t, 'delete') as can_delete
from (select tablename, format('%I.%I', schemaname, tablename) as t
      from pg_tables where schemaname = 'public' and not rowsecurity) x;

Any true is open to a signed-out visitor. On my local Supabase, new tables in public got these grants by default; the query shows what yours has. (The anon key is meant to be public. The missing protection is the problem.)

2. Policies that say true, and who they apply to

select tablename, policyname, roles, cmd, qual, with_check
from pg_policies where schemaname = 'public';

Postgres never reads a policy's name. A policy called "authenticated users can read" with no to authenticated shows {public}, which includes anon. A "service role" policy with no to is the same, and you can just delete it: the service role skips RLS. Adding and roles = '{public}' lists the policies that name no role, but look at ones written to anon too.

3. Test what actually happens

As a signed-out visitor:

begin;
set local role anon;
select count(*) from public.your_table;
rollback;

As a signed-in user (without the claims, auth.uid() is null and everything looks locked):

begin;
set local role authenticated;
select set_config('request.jwt.claims', '{"sub":"A-USER-UUID","role":"authenticated"}', true);
select count(*) from public.your_table;
rollback;

Writes have their own policies. Try an insert with otherwise valid values, and update and delete against someone else's rows, inside the same kind of transaction. A blocked update or delete just affects 0 rows. A count of 0 only means something if the table has rows.

4. Things that go around table RLS

Views run with their owner's rights unless you set security_invoker, and materialized views can't:

select c.relname, case c.relkind when 'm' then 'materialized view' else 'view' end
from pg_class c join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind in ('v', 'm')
  and coalesce(c.reloptions::text, '') not like '%security_invoker=true%';

security definer functions that anon can call through /rest/v1/rpc:

select p.oid::regprocedure
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
where n.nspname = 'public' and p.prosecdef
  and has_function_privilege('anon', p.oid, 'execute');

To close one, revoke from public as well: revoke execute on function ... from public, anon, authenticated; then grant back only what should call it.

Storage: look at select * from pg_policies where schemaname = 'storage';, and note that public buckets serve files by URL whatever those policies say:

select id from storage.buckets where public;

5. Policies that trust what users can edit

Users can change their own user_metadata, so never decide roles from it. And an update policy that only checks row ownership lets a user change any column of their row, such as role. Limit the columns:

revoke update on public.profiles from authenticated;
grant update (name) on public.profiles to authenticated;

Not covered: your app code, backend routes that use the service role (they need their own checks), and anything changed in the dashboard but not in your migrations.

Disclosure: I'm building a free, open-source tool called Svetra that automates much of this (npx svetra check --migrations builds your migrations in a throwaway Docker database and lists what's open). It's early and I'm looking for people to try it. You don't need it for any of the above.


r/Supabase • • 1d ago

tips Supabase bugs that only show up when two users click at the same time (from testing a lot of AI-built apps)

1 Upvotes

I've spent the last few months testing AI-built Supabase apps for one kind of bug: the kind that passes every normal test and only breaks when two requests overlap. These are the ones I keep finding.

  1. The last seat gets sold twice. A booking demo checked "is there a seat left?" and then inserted the booking. With two guests at once, both passed the check. In 12 of 20 test orders, the last seat was booked twice. Fix: lock the row before the capacity check (select ... for update), or do the check and the write in one statement.
  2. A limit of 100 ends at 101. A workspace capped at 100 accounts counted the rows, then inserted. At 99, two creates both saw 99 and both got in. Fix: keep a counter column and take a slot with update ... set remaining = remaining - 1 where remaining > 0 returning ..., so only one request can win.
  3. Credits get spent twice. Read the balance in JS, subtract, write it back. Two requests read the same balance and both succeed. Fix: do it in one statement, update profiles set credits = credits - 1 where id = ... and credits > 0, and treat 0 updated rows as "not enough credits".
  4. Stripe webhooks arrive out of order. If your handler copies the subscription status from the event into a table, a late "active" event can overwrite a newer "canceled". In 6 of 7 public handlers I tried, the delivery order changed the final state. Fix: in a worker, re-fetch the subscription from Stripe and write that, one worker per subscription.
  5. Deduping by event ID isn't enough. A new event ID can still carry old state. Dedup protects you from retries, not from order.

How to test any of these: two connections, the same starting state, run the action at the same time, then check what was actually saved. Normal tests run one request at a time, so they stay green.

What would you add to the list?


r/Supabase • • 1d ago

database RLS is on for every table and it still leaks: 5 Supabase mistakes I keep seeing in AI-built apps

0 Upvotes

Been reading a lot of AI-generated Supabase schemas lately (Lovable, Bolt, Cursor projects) and "RLS is enabled on every table" keeps showing up as the security answer. It's a good start, but these are the holes I keep finding anyway.

1. Policies that are just true

The agent hits a 42501 error, "fixes" it with using (true), and now every signed-in user (or anon, depending on the role) can read every row. Quick audit:

select tablename, policyname, roles, cmd, qual, with_check
from pg_policies
where schemaname = 'public'
  and (qual = 'true' or with_check = 'true');

Some of these are fine (public product lists). Anything with emails, orders or Stripe ids is not.

2. Tables added later with RLS off

RLS gets enabled in the first migration, then the agent adds three more tables a week later and forgets. This lists them:

select c.relname
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind = 'r' and not c.relrowsecurity;

3. Views that skip RLS

Views run as their owner by default, so a view over a protected table can hand everything back. On Postgres 15+:

alter view public.my_view set (security_invoker = true);

4. Users can update their own row... including plan or is_admin

RLS is row level, not column level. "Users can update their own profile" also means they can set plan = 'pro' from the browser console. Either move those columns to a table users can't write, or limit the columns:

revoke update on public.profiles from authenticated;
grant update (display_name, avatar_url) on public.profiles to authenticated;

5. security definer functions callable by anon

They bypass RLS, and the agent often writes them that way to make an error go away. If it doesn't need to be public:

revoke execute on function public.my_fn(uuid) from public, anon;

How I test it: two real accounts, then in the SQL editor run as user B and try to read user A's data:

begin;
set local role authenticated;
select set_config('request.jwt.claims', '{"sub":"<user-b-uuid>","role":"authenticated"}', true);
select * from public.orders;
rollback;

If you see A's rows, the policy is wrong.

What else do you check before letting real users into a Supabase app? Curious what I'm missing.


r/Supabase • • 1d ago

database Title: I scanned 3,035 public repos from AI app builders. Here's what keeps showing up in their Supabase setup

0 Upvotes
Disclosure: I make and sell LeakWarden, the scanner I used. These checks are in the paid version.

I scanned 3,035 public GitHub repos made with Lovable, Bolt, v0, Replit, Base44 and Google AI Studio. In the projects that use Supabase:

- Where the SQL is in the repo, a table with RLS off or a write policy with using (true). A third of the Bolt projects had one, and half of the v0 and Base44 ones.
- The service role key in the repo or in browser code. From 3.5% of the Lovable Supabase projects to 15.6% of the Google AI Studio ones (Replit: 4 of 23, too few for a share).

Three checks you can do yourself in a few minutes:

1. Run the Security Advisor in the Supabase dashboard. It catches tables with RLS off.
2. Sign in as two different users and try to read and change each other's rows. If it works, the policy is open even though RLS is "on".
3. For views, run select has_table_privilege('anon', 'public.your_view', 'select'). Views run with their owner's rights by default, so a view over auth.users can hand out every email.

Full numbers and method: https://leakwarden.dev/research/app-builders-3035

r/Supabase • • 2d ago

tips Help

0 Upvotes

Can anyone refer me for supabase squad ??


r/Supabase • • 3d ago

Self-hosting Announcing Supermixer: Management plane for self-hosted Supabase

Thumbnail supermixer.app
0 Upvotes

What is Supermixer?

Supermixer is an open-source dashboard for running and managing multiple self-hosted Supabase projects on your own servers: https://supermixer.app

Self-hosting one Supabase instance is fine. Self-hosting five Supabase instances on your own servers starts to hurt. Each instance has its own Studio, its own `.env` file, and its own ports, and every backup and password change has to be done by hand. There's also no good way to give a teammate access to one project without handing them the keys to everything.

Supermixer, a management plane for self-hosted Supabase, is built to help with this. It runs on your own infrastructure, next to your stacks and gives you a single pane of glass to manage all of them.

What does Supermixer do?

- Run as many as Supabase projects as your hardware can hold. Since you self-host it, there are no plans or project limits.

- Connect Supabase stacks you already run, or create a new one in one click. Supermixer sets up Docker, ports, keys and TLS for you.

- A Studio-style dashboard for every project. SQL editor, table editor, schema visualizer, Auth users, Storage, Edge Functions, a Realtime inspector, logs and advisors. If you prefer, you can use the project's built-in Studio too.

- Supermixer is enterprise ready. Teams, Organizations, invitations, and roles are available. GitHub sign-in and two-factor are built in.

- Hosting on a public URL? TLS through Let's Encrypt for both the dashboard and each stack's API and Postgres ports.

- Audit logs and webhooks.

- Automating Supermixer is easy. Personal Access Tokens and a Supabase-style Management API is available, therefore existing scripts can keep working.

Why "management plane"?

Supermixer doesn't replace Supabase or fork it. Your stacks stay stock upstream Supabase, running on your own machines. Supermixer sits on top at the management layer, keeps track of your instances, and gives your team one login to manage all of them. Your Supabase stacks keep running, even if you stop using Supermixer.

Links

- GitHub: https://github.com/supermixerapp/supermixer

- Demo site: https://supermixer.app

Supermixer is Apache 2.0 licensed, with no telemetry and no paid tier. If you are a developer and use Supabase locally, I'd like to hear your thoughts if this is useful.


r/Supabase • • 3d ago

cli I built an open-source, zero-dependency Supabase security scanner + AI agent skill bundle (128 patterns, 76 static checks, SARIF CI)

2 Upvotes

Most Supabase security tools either charge a subscription or only scan your live URL after you've already deployed a leak.

I built Supalock — local-first, MIT-licensed, zero pip dependencies — to catch RLS, Storage, Auth, Edge Function, and secret leaks directly in your repo, CI, and coding agent before code ever ships:

https://github.com/hermes-lekkas/supalock

What's included:

  • 128 curated patterns across 10 surfaces (RLS, Postgres views/functions, Storage buckets, Auth/SSR, Edge Functions, Secrets, Realtime/RPC, Vibe-coded business logic, Next.js, and supabase/config.toml)
  • 76 static CLI checks that track RLS across multiple migration files, decode JWT payloads to tell anon apart from service_role, ignore TO service_role policies, and output Terminal / JSON / Markdown / SARIF 2.1.0
  • 8 Open Agent Skills (npx skills add Hermes-Lekkas/supalock) + ./install.sh for Claude Code, Cursor, Codex, Antigravity, Gemini CLI, Copilot, Cline, and Windsurf
  • Before/after demo apps (examples/vulnerable-vibe-saas -> 46 findings in 14 ms vs examples/hardened-vibe-saas -> 0 findings in 10 ms)

Try supalock explain SUPA-RLS-009 or run it on your own repo — would love feedback on any patterns I missed!


r/Supabase • • 3d ago

database supabase-rls-check v0.7.0: catching column-level UPDATE privilege escalation (role/credits/plan), non-invoker views, and leaked keys in build bundles

3 Upvotes

Disclosure: I am the author of supabase-rls-check (MIT licensed, free and open-source Python CLI / MCP server / GitHub Action).

just pushed supabase-rls-check v0.7.0 (159 unit & integration tests passing). it adds three checks aimed at bugs that keep showing up in AI-generated Supabase schemas (Lovable, Bolt, Cursor, v0):

repo: https://github.com/Tthanh2k6/supabase-rls-check pypi: https://pypi.org/project/supabase-rls-check/

  1. column_update_escalation (High): a lot of apps enable RLS on public.profiles or public.users with a standard ownership policy: FOR UPDATE TO authenticated USING ((select auth.uid()) = user_id) and also store role, is_admin, plan, tier, credits, balance, subscription_status, or org_id on that same table. because USING only filters which row you can update, and table-level UPDATE is granted to authenticated by default, any signed-in user can send PATCH /rest/v1/profiles with {"is_admin": true, "credits": 99999} and self-elevate. check.sql (for live catalog exports) and scan_sql (for local .sql migration files) now check whether anon or authenticated holds UPDATE on those columns without a WITH CHECK guard or a column-level REVOKE UPDATE + GRANT UPDATE (safe_col1, safe_col2).
  2. view_not_invoker on raw .sql migrations: views in Postgres default to security_invoker = false, running with the view owner's permissions and bypassing base-table RLS when exposed in public. check.sql already flagged these in pg_class.reloptions, and v0.7.0 adds static detection in scan_sql so you can catch CREATE VIEW public.x missing WITH (security_invoker = true) or ALTER VIEW ... SET (security_invoker = true) in local migration files before pushing.
  3. supabase-rls-check scan-bundle <path> (CLI + local MCP tool): scan-env intentionally skips dist/, build/, and web-build/ when scanning a source repo. the new scan-bundle command scans compiled frontend folders or single .js/.html bundles (offline, read-only, up to 5 MB per file) for base64-decoded service_role JWTs (ignoring anon tokens), sb_secret_ keys, and postgres://user:pass@ URLs, masking every secret as first6…last4.

you can inspect the remediation pattern locally with: uvx supabase-rls-check explain column_update_escalation

if there are other column names or RLS anti-patterns you see frequently in vibe-coded repos, let me know and i will add them to the heuristics.


r/Supabase • • 4d ago

tips How I self-host Supabase on a cheap VPS with HTTPS and scheduled backups

4 Upvotes

Disclosure up front: I built the tool this setup uses (ShipperKit, open source and MIT licensed). Mods, remove this if it doesn't fit here.

Getting Supabase running is the easy part. Keeping it running is where I kept losing evenings: the self-hosted Compose stack is a dozen containers, and you have to generate the JWT secret and API keys yourself. This is the setup I use now on a single VPS.

What you need

  • A server running Ubuntu 22.04/24.04 or Debian 12/13, x86-64 or ARM64
  • 4 GB of RAM to be comfortable
  • Ports 80, 443 and 8080 open
  • A domain with an A record pointing at the server, like supabase.yourdomain.com

1. Install ShipperKit

curl -fsSL https://shipperkit.dev/install.sh | sudo bash

Open the address it prints, paste the setup token and create your account.

2. Deploy Supabase

Open the Service Library, search for Supabase and select it. Enter supabase.yourdomain.com as the domain and deploy. The secrets and database passwords are generated for you, and HTTPS comes from Let's Encrypt automatically.

3. Set up backups before you put real data in

Add a backup schedule for the Postgres database and the storage volume. You can store backups on the server itself or in any S3-compatible bucket (Backblaze B2, Cloudflare R2, Wasabi). Restore one as a separate copy once, so you know the restore actually works before you need it.

Supabase-specific things to watch for

  • Plan for 4 GB of RAM.
  • Studio is exposed on your domain, so lock it down.

Repo: https://github.com/matyas-toth/shipperkit Site: https://shipperkit.dev

Happy to answer questions about running Supabase on it, or about self-hosting Supabase in general.


r/Supabase • • 4d ago

tips Added a tenant filter to a service key update. Uploads kept saying success and saved nothing

1 Upvotes

Everybody's talking about the service key skipping RLS this week, and i think the server side gets less attention than it should. Most posts stop at keeping it out of the browser.

On a project of mine an upload ran an update with the service key and no tenant filter, so it could write to another company's row. The fix was one more .eq on the company id. But nobody checked the result, and an update that matches 0 rows isn't an error in supabase-js. error is null, data is empty. So when the ids didn't line up, the user saw "upload succeeded" and the document still pointed at the old file.

What i do now - every service key update that gets a filter also gets .select() and fails when it comes back empty.

Do you check row counts on server side updates, or trust error == null?


r/Supabase • • 5d ago

auth What's the ideal foreign key to use for users in a multi tenant app

5 Upvotes

In a multi-tenant app, you need 4 tables in my opinion to handle all app features correctly:

  1. the default supabase users table
  2. a profiles table that holds extra information about each user like their profile picture, bio and anything about users that needs to be shared between organizations, supabase itself actually recommends using this table. this table should have a one-to-one relationship with the users table.
  3. an organizations table.
  4. a members table that will link the different user profiles with their respective organization. this serves as the pivot table between organizations and profiles.

Now for tables that hold rows that should belong to specific members of specific organizations, I always include a organization_id foreign key to make filtering by an organization easier. even though I could have a member_id foreign key with which I can do a nested join to filter by that member's organization, but having an organization_id directly on the table makes things easier and is a well known practice.

My question: Now that we've established that I should add an organization_id to (nearly) every table. which of the 3 user tables should I use to define who owns a particular table row? user_id, profile_id or member_id.

I could see the argument for either profile_id or member_id honestly, with member_id its makes more semantic sense because it tells us not only which user did the action but which user on which organization.

On the other hand we can figure out the relation pretty easily with the organization_id column we have on every table and using profile_id makes accessing things like user avatars cost one less join.


r/Supabase • • 5d ago

tips I built a deliberately insecure Supabase app and ran an outside check on it. Here's what showed up and how to fix each one

1 Upvotes

I run a small security consultancy, and I wanted a realistic demo, so I built a fake estate-agency CRM on hosted Supabase (plus a bit of Firebase) with common mistakes planted on purpose. All data is fake. Then I ran a read-only, outside-in check against it, the same view anyone with a browser gets.

The Supabase-side findings:

  1. RLS off on a table (contacts: names, emails, phones). Readable by anyone with the anon key, which is in every Supabase front end by design. Fix: alter table ... enable row level security; on every table in public, then add the policies you need.
  2. RLS on, but using (true) for authenticated. Signed in as one test user, I could read every user's deals. Fix: using ((select auth.uid()) = owner_id), and test with two accounts.
  3. service_role key in the JS bundle. That key bypasses RLS entirely. Fix: only the anon/publishable key in the browser; server-only code for the rest; rotate any key that was ever shipped.
  4. Public storage bucket with a list policy for anon. Every file listable and downloadable. Fix: private bucket + signed URLs; no anon select on storage.objects.

What it correctly left alone: a table with an owner-only policy and a private bucket.

Quick self-check for your own project:

  • Database → Advisors (Security Advisor) shows no "RLS disabled" warnings
  • No using (true) on tables with user data
  • Search your live site's JS for service_role and sk-
  • No secrets behind NEXT_PUBLIC_ / VITE_ / EXPO_PUBLIC_

Full write-up with the Firebase findings and a sample report: https://hasafsec.com/insights/insecure-ai-built-app-seven-flaws?utm_source=reddit&utm_medium=social&utm_campaign=p1

Happy to answer RLS or policy questions in the comments.


r/Supabase • • 6d ago

database If you "fixed" infinite recursion on team_members with using (true), your member list is public. Here's the fix the docs use

0 Upvotes

Disclosure: I build a security scanner for AI-built apps. No link, just SQL.

I keep seeing the same thing in team / workspace apps. A policy on team_members needs to check team_members ("can I see other members of my team?"), Postgres throws 42P17 infinite recursion detected in policy for relation "team_members", and the fix that makes the error go away is using (true). Now every signed-in user can list who's in every team, and so can anyone with the anon key if the policy didn't say to authenticated.

The pattern in the Supabase RLS docs is a security definer function that does the membership lookup as its owner, so the policy doesn't call itself:

create schema if not exists private;

create function private.my_team_ids()
returns setof uuid
language sql
security definer
set search_path = ''
stable
as $$
  select team_id from public.team_members
  where user_id = (select auth.uid())
$$;

create policy "see members of my teams"
on public.team_members for select
to authenticated
using (team_id in (select private.my_team_ids()));

Two things that matter:

  • Put it in a schema that isn't in your API's exposed schemas. A security definer function in public can be called by anyone at /rest/v1/rpc.
  • It only skips RLS because the owner is postgres. If you created it as some other role, it'll recurse again.

While you're in there, check the insert policy on team_members:

select policyname, cmd, with_check
from pg_policies
where tablename = 'team_members' and cmd in ('INSERT', 'ALL');

If with_check is just auth.uid() = user_id, it checks the row is you but not which team you're joining. Any signed-in user can insert themselves into another team's id and every "member of this team" policy lets them in. Safer is no client inserts at all (add members server-side after checking the invite) or only allowing inserts when the caller is already an owner of that team, using the same kind of function.

Quick test is two accounts. Make a team as A, sign up as B, try inserting B into A's team from the browser console. Delete the row after.

Curious how others handle invites here. Edge function, or a policy that checks an invites table?


r/Supabase • • 6d ago

database PostgreSQL persistent task queue: concurrency, idempotency and restart recovery

Thumbnail reddit.com
1 Upvotes

For those using Supabase, would you recommend Supabase Queues (pgmq) or a dedicated PostgreSQL queue table for this use case? I'm particularly interested in concurrency, stale worker protection and reliable restart recovery.


r/Supabase • • 6d ago

database I checked the Supabase SQL in public repos from Lovable, Bolt, v0, Base44 and AI Studio. 23% to 50% had an RLS problem

0 Upvotes

Last week I scanned 639 public Lovable repos. This time I ran the same scanner on 3,035 public repos from six app builders: Lovable, Bolt, v0, Replit, Base44 and Google AI Studio. I found them through the file each builder leaves in the project.

The scan reads code only. For the database it reads the SQL in the repo, so the counts below cover only Supabase projects that have their SQL in the repo.

Table without RLS, or an update, delete or all policy with `using (true)`:

BuilderReposShare
Lovable48 of 20623%
Bolt73 of 21933%
v020 of 4050%
Base4416 of 3250%
AI Studio7 of 3023%
Replit2 of 18base too small

Service role key in the repo or read by browser code, out of all Supabase repos:

  • Lovable 10 of 282 (3.5%)
  • Bolt 18 of 266 (6.8%)
  • v0 9 of 71 (12.7%)
  • Base44 7 of 52 (13.5%)
  • AI Studio 7 of 45 (15.6%)
  • Replit 4 of 23

This isn't a ranking. The groups differ in size, age and how many use Supabase at all. That's 44% of the Lovable repos and 55% of Bolt, but 5% to 14% of the others. The v0 and Base44 bases are small.

I reviewed 20 random flagged repos per builder against the code. 50 of them had a database finding, and none of the database findings I checked was a false alarm. The false alarms were in secrets: demo keys, the Supabase local dev key, example connection strings.

Two things I noticed:

  • In Lovable and Bolt, `using (true)` write policies were more common than tables with RLS off. In v0, Base44 and AI Studio it was the other way around.
  • v0 projects often keep their SQL in `scripts/` instead of `supabase/migrations`. A table without RLS there counts only when the app queries it through supabase-js.

The fix:

```sql
alter table public.orders enable row level security;

create policy "own orders" on public.orders
for update to authenticated
using (auth.uid() = user_id)
with check (auth.uid() = user_id);
```

Then test it with two accounts. Sign in as one user and try to read and change the other one's rows.

This is code only. The live database can differ from the SQL in either direction.

No repo is named and I never used or tested any key. I'm emailing the owners I can find an address for.

Disclosure: the scanner is mine. The free version is open source and covers secrets. The RLS checks are in the paid version.

Method, numbers and limits: https://leakwarden.dev/research/app-builders-3035


r/Supabase • • 7d ago

tips Supabase problems that only show up once real users arrive (from fixing a lot of AI-built apps)

69 Upvotes

I run a small dev shop in Mississauga, and these days a good chunk of my work is picking up apps that were built fast with tools like Lovable, Bolt or Cursor on top of Supabase. They usually work fine while the founder and a few friends are testing. Then real users show up and a different set of problems appears. These are the ones I keep running into.

1. Signup emails stop arriving. The built-in email sender is meant for testing and has a very low hourly limit. A launch post brings in a burst of signups and most of those people never get their confirmation link. Set up your own SMTP provider before launch, not after.

2. Auth redirects still point to localhost. Check the Site URL and the redirect URL list under Authentication. When these are wrong, magic links and password resets quietly send people to the wrong place. Check your OAuth provider settings against the production domain too.

3. RLS policies that get slow as tables grow. A policy like user_id = auth.uid() works, but the function gets called for every row. Writing it as user_id = (select auth.uid()) lets Postgres evaluate it once per query. Add an index on the column the policy filters on as well. Supabase's RLS performance docs cover this, and the Performance Advisor in the dashboard can flag it for you.

4. Running out of database connections. If serverless functions connect straight to Postgres, each invocation can open its own connection and you hit the limit during a busy hour. Use the pooler connection string in transaction mode for anything serverless. This mostly matters for direct Postgres clients like Prisma or Drizzle, since supabase-js goes through the API.

5. Turning RLS off to fix a permission error. "permission denied" or "new row violates row-level security policy" (both error 42501) usually means a missing policy or missing grants for the anon or authenticated role, often on a table added later by a migration. Read the error and fix the policy or grant. Disabling RLS makes the error go away and leaves the table open to anyone with your anon key, which is public by design.

6. Storage buckets that are public when they shouldn't be. Fine for avatars. Not fine for invoices, ID documents or anything a user uploaded expecting it to stay private. Use a private bucket and signed URLs.

7. Still on the free plan with paying customers. Free projects get paused after a stretch of inactivity, which is fine for a side project and bad for an app people pay for. A paid plan also gives you daily backups.

None of this is exotic. It just doesn't come up until there's real traffic. What would you add to the list?


r/Supabase • • 7d ago

cli Free CLI that checks whether your tables and storage buckets answer anonymous requests

0 Upvotes

npx leakprobe https://yourapp.com

No install, no signup, runs locally.

What it does for Supabase specifically:

  1. Pulls the anon key out of your published bundle (it's a JWT with role=anon, so it's identifiable), reads /rest/v1/ for the table list, then requests one row from each with limit=1 and reports which ones answer.
  2. Checks whether a service_role token has ended up in the bundle, which is the worse version of the same problem and more common than you'd hope.
  3. Lists your storage buckets anonymously and flags any marked public.

Output is column names only. Row contents are never printed or sent anywhere. There's no server.

It also covers the non-Supabase things that go wrong in the same apps: keys in the JS bundle, .env and backup.sql being served, source maps, session cookie flags, CORS reflecting any origin with credentials, http not redirecting to https.

Every finding comes with a prompt you can paste into Claude Code or Cursor, since knowing RLS is off doesn't help much if nobody explained what to write.

Caps at 25 tables per scan to keep it fast. Exit code 2 on a critical or high, so it works in CI.

MIT, zero deps, Node 18+: https://github.com/NishantDixit1/leakprobe

Firebase RTDB is covered too. Firestore isn't yet, since there's no reliable way to discover collection names from outside. PRs welcome.


r/Supabase • • 7d ago

database Supabase tells me a row was inserted. I wanted "Maya Chen created booking for class 'Vinyasa Basics'". So I built this

0 Upvotes

When something happens in my Supabase app, the logs tell me a row was inserted into bookings, or that a request to /rest/v1/bookings got a 403. What I actually want to know is who it was, what they were trying to do, and, when it failed, why.

So I built EZLogs. It writes what happens in your app as plain sentences that anyone can read, including the non-technical person you're building with:

Maya Chen signed up
Maya Chen created booking for class 'Vinyasa Basics'
Booking creation not allowed

The video is a small Lovable app where I broke an RLS policy on purpose. Users only saw "Your session has ended". EZLogs showed the real reason (the database refused the booking) and sent me a Slack alert. Then Lovable read the same log over a read-only MCP connector and fixed the policy.

How it works, since I know this sub will ask:

It's one SQL file you paste in the SQL editor. It creates its own ezlogs schema and adds AFTER triggers, so each write also drops a small row into an outbox in the same transaction. pg_cron and pg_net send those in the background. It never touches your rows and can't make a write fail. If my server is down, rows wait up to 7 days. The person comes from the JWT Supabase already verified. Columns named like passwords, tokens or keys never leave your database.

RLS refusals don't write a row, so triggers can't see them. A small optional browser package reports those.

It's open source, so you can read every line before you run it: https://github.com/dezsirazvan/ez_logs_supabase
Free while it's in beta: ezlogs.io/supabase

How do you keep track of what your users actually do today?


r/Supabase • • 8d ago

tips Is it realisti to vibe code an internal business app with Supabase with minimal coding experience?

5 Upvotes

Hi all, I run a small business and track data to help buying decisions. We currently use Google sheets as our internal sourcing database, but at about 4000 rows, it’s becoming very low and laggy.

My understanding is that we’ll need to clean up our current data and design a proper database schema and export it via CSV, build a front end, and then connect it to Supabase.

I’m not sure where the source data would stay: if it would live in Google sheets and sync to Supabase, or we switch completely to Supabase. I’ll have to inform myself more on how this could work.

I plan to vibe code this, as its primary and only use is for internal use on a web application that runs light and decently fast.

My question is, is this feasible to vibe code with ChatGPT Pro / Claude Pro? I don’t have SQL / any coding knowledge besides simple Python. If a developer is needed, could you explain why?

Any tips would be greatly appreciated and a huge help! I’m all open ears and would love to know what route is realistic / best for us. TIA!!


r/Supabase • • 9d ago

storage Memory commitment hits the limit during book imports on Micro (Postgres 17), with only ~30 active users. What's using it?

Post image
4 Upvotes

My app (Readbit) has about 70 users and ~30 active. The database restarted on 22 Nov at 18:45 UTC with "database system was not properly shut down; automatic recovery in progress". Memory commitment was at the limit (~2 GB) and swap was ~1 GB. I've since raised the compute plan, but memory still climbs during imports.

What I measured (controlled tests, UTC):

• Memory commitment rises ~20-30 MB/min while a book import runs. It falls back to baseline ~7 min after I pause it.

• 20:34-20:49: ~160 books processed. Commitment went 1.33 → 1.81 GB, swap 200 → 524 MB.

• 21:16-21:21: 19 books. Commitment rose to 1.42 GB.

• 21:23-21:28: same scheduled jobs and calls, but only 4 books. No rise.

• pg_stat_statements shows only ~2.5 s of total DB time per run, no temp files, and Realtime volume of about 1 change/sec. So query work doesn't explain the memory. How to resolve this? There is a long memory swap going onm


r/Supabase • • 9d ago

tips Looking for Supabase SSO Integration Help – TC LIVE + FIVE STAR

2 Upvotes

Hello Supabase Community!

I am looking for technical advice and possibly a volunteer collaboration partner for an existing project.

We have two existing platforms:

  1. TC LIVE
  2. FIVE STAR 4D/6D

Both platforms already use Supabase.

What we need:

  1. Integrate Single Sign-On (SSO) between the two platforms.
  2. Allow FIVE STAR members to log in through TC LIVE.
  3. Remove the normal member email/password login and registration from FIVE STAR.
  4. Keep the administrator login.
  5. Preserve all existing membership, wallets, betting, draw, settlement and database functions.

Our technology:

  • React
  • TypeScript
  • Supabase Auth
  • Supabase Edge Functions

We do NOT need a complete redevelopment. We only need help modifying the existing login system and integrating SSO correctly.

We currently have no development budget, so we would greatly appreciate technical guidance or a volunteer collaboration opportunity.

Has anyone successfully integrated SSO between two separate Supabase projects?

Any advice or help would be greatly appreciated.

Thank you!