Lovable, Bolt and similar tools build working apps fast, and their built-in checks keep getting better. Lovable, for example, runs a Quick security scan every time you publish, covering your database access rules, known-vulnerable dependencies and any MCP server exposed without sign-in. But “it works” and “it’s safe” are different tests. Lovable’s own security docs call misconfigured RLS rules “a common cause of data leaks,” and that kind of mistake never shows up as a bug.
This vibe coding security checklist is for apps built on Supabase (directly or through Lovable Cloud). Every item comes with a test you can run in a few minutes. Only run these tests against apps you own.
Why this matters: CVE-2025-48757
CVE-2025-48757 (published 30 May 2025, CVSS 3.1 base score 9.3, Critical) describes an insufficient Row-Level Security policy in apps Lovable generated through 15 April 2025, which let remote unauthenticated attackers read or write to arbitrary database tables of those generated sites. The record is tagged disputed. Lovable’s position is that “each individual customer of the Lovable platform accepts a responsibility over protecting the data of their application.”
Wherever you land on the dispute, the takeaway doesn’t change: checking who can read and write your data is your job. The CVE covers Lovable through April 2025, not Lovable today, and the same misconfiguration can happen in any app where the browser talks to Supabase directly.
How Supabase security works, in one paragraph
Your frontend calls Supabase with a publishable key (sb_publishable_..., or the legacy anon JWT). Supabase treats this key as public: anyone can read it from your site, and it can only touch rows your RLS policies let through. What protects your data is table grants plus Row Level Security (RLS). The secret key (sb_secret_..., or the legacy service_role JWT) skips every RLS policy and must never reach a browser. Supabase is deprecating the legacy JWT keys by the end of 2026, so new code should use the sb_ keys. So don’t ask whether a key is visible. Ask which key is visible, and what your policies let it do.
1. RLS is enabled on every table
- Test: in the Supabase SQL editor, list tables without RLS:
select schemaname, tablename
from pg_tables
where schemaname = 'public' and rowsecurity = false;
Any result is a table the public key may be able to read, edit or delete. Also open Advisors → Security Advisor in the Supabase dashboard and resolve every error.
- Fix: run
alter table public.<name> enable row level security;and write the policies alongside it. With RLS on and no policies, the API returns nothing, which is safe but will break your app until the policies exist.
2. Policies are scoped to the owner, per operation
- Policies are owner-scoped, one per operation. In
pg_policies, flagtrue, a bareauth.uid() is not null, and private data granted topublicoranon; updates need bothusingandwith check. See Supabase RLS policies explained and the “new row violates…” fix. - Two-account test: signed in as user A, try to open, change and delete user B’s rows. Every attempt should fail.
3. The logged-out curl test passes
This test does exactly what an attacker would do with your public key, so run it even if every scanner is green.
- On your live app, open DevTools → Network, pick any call to your project’s
/rest/v1/endpoint, and copy itsapikeyheader. - Set
SUPABASE_URLtohttps://<project-ref>.supabase.co,PUBLIC_KEYto the key you copied, andTBLto each table name in turn, then run:
curl -s -H "apikey: $PUBLIC_KEY" \
"$SUPABASE_URL/rest/v1/$TBL?select=*&limit=3"
Pass: [] or a permission error for anything private. Fail: rows come back.
- Test writes too. An open read is bad, but an open write or delete is worse:
curl -i -X PATCH -H "apikey: $PUBLIC_KEY" \
-H "Content-Type: application/json" -d '{"note": "x"}' \
"$SUPABASE_URL/rest/v1/$TBL?id=eq.$ROW_ID"
Swap note for a real column and ROW_ID for a throwaway row in a table you own. A 204 with changed data means anonymous users can edit it.
- Re-run after every fix, against production, not the preview. In Lovable the live site keeps serving the version you last published until you publish again, but preview and published share the same backend.
4. Grants: never GRANT ALL to anon
Supabase checks table grants first and applies RLS only after that. If a query fails with 42501 “permission denied for table”, the role has no grant on that table. A tempting quick fix, and one an AI assistant may suggest, is GRANT ALL ON public.profiles TO anon. After that, your policies are the last line of defense for that table. The 42501 guide walks through granting only what’s needed.
- Test: check what
anoncan do:
select table_name, privilege_type
from information_schema.role_table_grants
where grantee = 'anon' and table_schema = 'public';
- Fix: grant each role only what it needs. For
anon, that’s nothing, orselecton tables that are meant to be public. Keep RLS on either way.
5. No secret key in the bundle, env vars, or git history
- No secret key reaches the browser. Only public values, like the project URL and publishable key (
VITE_SUPABASE_URL,VITE_SUPABASE_PUBLISHABLE_KEY), belong inVITE_variables, because Vite builds them into the client bundle. Stripe secret, OpenAI and email keys and Supabasesb_secret_/service_rolekeys belong in Secrets, which in Lovable are write-only and are injected into your Edge Functions and server-side integrations, never the browser. - Search for leaks. Grep
dist/andgit log -p --allforsk_live_|sk_test_|sb_secret_|service_role|whsec_, and decode anyeyJJWT indist/:"role":"service_role"is a leak. - Don’t rely on the browser block. Supabase rejects a new
sb_secret_key with HTTP 401 when the request comes from a browser, but the same key still works fromcurlor any script. A secret key in your bundle is a leak even if your own app can’t use it.
Already leaked a key?
Move the code that uses it server-side first, then rotate: create a new key, deploy it, confirm the app works, and only then revoke the old one. In Lovable, the built-in LOVABLE_API_KEY has its own Rotate action in the Secrets view. For Stripe keys, see Step 5 of the Stripe guide.
6. Edge Functions check who is calling, and CORS is deliberate
Edge Functions are public URLs. A URL nobody has guessed yet protects nothing.
- Test: for each function, call it with no
Authorizationheader:
curl -i -X POST "https://<project>.supabase.co/functions/v1/<function>" \
-H "Content-Type: application/json" -d '{}'
A function that should require a user must reject this. Supabase verifies the caller’s JWT by default (verify_jwt = true). Deploying with --no-verify-jwt, or setting verify_jwt = false to make a 401 go away, turns that check off.
- Test again with only the public key: add
-H "apikey: <public-key>"to the same call. Supabase’s docs say theverify_jwtcheck accepts publishable keys for compatibility, but passing it doesn’t prove who the caller is. A user-only function should still reject this request, which means checking the user inside the function, for example withwithSupabase({ auth: 'user' })fromnpm:@supabase/server. Even with a valid user, check that this user may act on the specific record. If your own app gets a 401 or another error from a function, see Edge Function returned a non-2xx status code. - CORS: Supabase’s docs say browser calls need preflight (
OPTIONS) handling. ThewithSupabasewrapper handles it, or you can importcorsHeadersfromnpm:@supabase/supabase-js@^2/cors. Remember that CORS is not authentication. It only stops other websites’ JavaScript from reading responses in a browser.curlignores it completely. If a function only serves your own site, restrictAccess-Control-Allow-Originto your domain instead of*, and still enforce auth inside the function. - Test CORS:
curl -i -X OPTIONS <function-url> -H "Origin: https://evil.example" -H "Access-Control-Request-Method: POST"and read which origin comes back.
7. Storage buckets match what’s in them
Supabase buckets are private by default. A public bucket serves any file to anyone who has its URL, which suits avatars and marketing images but not invoices, IDs or user uploads. Uploads, deletes, moves and copies in a public bucket are still controlled by policies.
- Test: go through Storage in the Supabase dashboard. For every bucket marked Public, ask whether any file in it belongs to a single user.
- Test private buckets: check that the policies on
storage.objectslimit reads and writes to the owner, for example by folder:
create policy "own_folder_read" on storage.objects
for select to authenticated
using (bucket_id = 'documents'
and (storage.foldername(name))[1] = (select auth.uid())::text);
- Fix: make sensitive buckets private and serve files with short-lived signed URLs.
8. Stripe: only a verified webhook can grant paid access
When the browser landing on your success page is what flips an account to paid, any visitor can fake that landing.
- Test: find where the
paid,planorsubscribedflag is set. Only server code that has checked a Stripe webhook should write it. Client code shouldn’t, and neither should any table the user can update through RLS. - Test: send an unsigned fake event to your webhook endpoint:
curl -i -X POST https://<your-webhook-url> \
-H "Content-Type: application/json" \
-d '{"type":"checkout.session.completed","data":{"object":{}}}'
It must be rejected (4xx) and change nothing.
- Fix: check each request’s
Stripe-Signatureheader against the raw request body, using the endpoint’swhsec_...secret. Stripe warns that a framework which parses or reformats the body first will make verification fail. In a Supabase Edge Function (Deno), use the async verifier with Stripe’s SubtleCrypto provider, because Supabase notes the synchronousconstructEvent()throws on that runtime:
import Stripe from 'npm:stripe'
const stripeClient = new Stripe(Deno.env.get('STRIPE_SECRET_KEY')!)
const cryptoProvider = Stripe.createSubtleCryptoProvider()
Deno.serve(async (req) => {
const sig = req.headers.get('Stripe-Signature') ?? ''
const body = await req.text() // raw body, not req.json()
let event
try {
event = await stripeClient.webhooks.constructEventAsync(
body, sig, Deno.env.get('STRIPE_WEBHOOK_SECRET')!,
undefined, cryptoProvider)
} catch (err) {
console.error('Signature check failed:', err)
return new Response('Bad signature', { status: 400 })
}
// handle event.type ...
return new Response('ok', { status: 200 })
})
Set verify_jwt = false for the webhook function, since Stripe doesn’t send a Supabase JWT. The signature check is the authentication. Stripe also publishes the IP addresses it sends webhooks from, if you want to allowlist them on top. If the webhook returns 401 or 400 for real Stripe events, Step 3 of the Stripe guide goes through each status.
- Idempotency: Stripe says one event can arrive twice. Store each processed event ID and ignore any ID you’ve already handled.
9. Auth settings point at production
- Site URL and Redirect URLs are your production domain, not
localhost, with**wildcards for local and preview only. See Supabase auth redirecting to localhost. If you just moved to your own domain, finish that first with the Lovable custom domain guide, then update these URLs. - Decide deliberately whether users must confirm their email before getting access. If confirmation emails don’t arrive, see Supabase auth emails not sending.
10. Rate limits on features that cost you money
- Anything that calls a paid AI API, sends an email or text, or opens a new account can be hit by a script. Set per-user caps in server code, turn on spending limits with each provider, and put a CAPTCHA on the sign-up form once bots show up.
11. Use the tools’ own reviews, then verify independently
- Lovable: the Quick security scan starts as soon as the Publish dialog opens. The Deep security scan, which reads your application code for issues like data the wrong users can read, endpoints anyone can trigger, leaked secrets and payment flaws, does not run automatically on publish, except when the app exposes an MCP server without sign-in. Start it from the project’s Security tab (More → Security) before each significant publish. Both scans are free. Lovable’s docs say plainly that automated scans can’t ensure complete security.
- Supabase: keep Security Advisor clean.
- AI code review: if you use GitHub Copilot or another AI reviewer, read what Copilot’s security review checks and where AI review stops and human review starts.
- Then run tests 2, 3, 5, 6 and 8 yourself, because scanners can’t know your business rules (for example, “a coach can read their clients’ notes, but not other coaches’ clients”).
Quick pass before launch
- Run the RLS query (#1).
- Run the logged-out curl on the three tables you’d least want leaked (#3).
- Grep the build for secret keys (#5).
- Check which buckets are public (#7).
- Send an unsigned event to your Stripe webhook (#8).
If any of these fail, fix them before you announce the app. The production readiness checklist covers the non-security side of launching.
FAQ
Is Lovable secure?
Lovable’s platform gives you real tools: basic RLS policies set up automatically, Secrets that never reach the browser, and Quick and Deep security scans. But Lovable’s docs also say you’re responsible for your app meeting the security your use case needs. Whether your app is secure depends on your policies and code, so run the tests above against your live app. For Lovable-specific failures beyond security, see Lovable app not working.
Is my vibe-coded app safe to launch?
It’s ready when the quick pass above succeeds on production, the two-account test in #2 fails for every cross-user attempt, and your scanners show no critical findings. If you hold medical records, card numbers or data about minors, plan for a professional audit as well.
Does a clean Lovable security scan mean my app is secure?
No. When a scan finds nothing, Lovable’s docs say only that the last scan surfaced no issues, not that every risk is covered. The Quick scan doesn’t read your application code at all. A clean scan plus passing tests 2, 3, 5, 6 and 8 is a much stronger signal.
Is it a problem that my Supabase key is visible in the browser?
Not if it’s the publishable key (sb_publishable_... or the legacy anon JWT). Supabase designs that key to be public and relies on RLS to limit it. It is a problem if a sb_secret_ or service_role key is visible, because that key skips RLS. Follow the steps under “Already leaked a key?” above.
Do I need to check Bolt apps differently?
The Supabase tests are the same wherever the frontend was built, because they test the database and functions, not the builder. If your Bolt app uses Supabase, run them against that project.
When to get a second pair of eyes
Some failures are quick fixes. Others aren’t: a leaked secret that has to be rotated while the app stays in use, policies for multi-role apps (teams, admins, coaches and clients), or payment logic the AI keeps re-fixing in circles. A senior engineer can review your policies and code directly, fix the root cause, and explain it so the next prompt doesn’t undo it.
This checklist doesn’t replace a penetration test or a compliance audit, and apps holding medical, card or children’s data should get both.
Comments