By Andrey Kamensky · · 6 min read
Last updated on

Vibe-Coded App Security: Missing Supabase RLS, Exposed Keys, and Client-Side Billing Bugs


Audits of Lovable, Bolt, and Replit apps reveal missing Supabase RLS, exposed keys, and payment bypasses. Check your AI app before adding real data.

TL;DR

Vulnerability patternWhat the AI builder generatedBusiness exposure if deployed liveNon-negotiable production fix
Missing / permissive Supabase RLSDatabase tables created quickly without strict PostgreSQL Row-Level Security (e.g., CVE-2025-48757 pattern)Any outsider inspecting your site’s public anon_key can query customer lists, orders, or pricing tablesEnable RLS on every public table + write explicit auth.uid() / tenant-scoped read & write policies
Secret keys in frontend codeservice_role, OpenAI, Google Maps, or Stripe keys stored in browser-bundled env varsAttackers drain API credits or bypass all database security policies completelyMove privileged calls to server routes / edge functions; rotate exposed keys immediately
Client-trusted billing & rolesBrowser sends is_paid: true or role: "admin" straight to database writesUsers upgrade accounts, mark invoices paid, or grant admin rights without paying a centVerify Stripe/payment webhooks server-side and enforce roles strictly on the backend
Untested unauthenticated endpointsHelper routes left open without session validation during prompt iterationsBulk scraping or malicious state changes via simple HTTP requestsAutomated route auth tests before every deploy + fixed-scope security audit

Across 2025 and 2026, security researchers and automated scanners audited thousands of live apps built with Lovable, Bolt.host, and Replit. The headline finding wasn’t a flaw in Supabase or PostgreSQL, it was a consistent failure mode of prompt-driven coding: 5% to 7.3% of scanned vibe-coded deployments shipped with critical security exposures, compared to 0% in control groups built under standard engineering review.

For an SMB owner using AI tools to replace spreadsheets or launch a client portal, the risk is direct and financial: a leaky database exposes customer PII, leaks supplier cost sheets, or silently lets anyone drain third-party API keys on your company card.

How a “working” AI demo leaks your entire database

AI app generators optimize above all else for getting the happy path on screen fast. If a save button errors out because database permissions blocked it, the prompt loop often “fixes” the friction by turning permissions off or leaving them wide open.

Four specific bugs show up repeatedly when we audit rescued AI projects:

1. Client-side Supabase queries without Row-Level Security (RLS)

Tools like Lovable and Bolt commonly wire the frontend browser straight to Supabase using a public anon_key embedded in JavaScript. That design is completely safe only when PostgreSQL Row-Level Security (RLS) strictly restricts who can read or change every row.

When researchers investigated apps cataloged under CVE-2025-48757, roughly 10.3% of early scanned Lovable projects had tables left open or gated by placeholder policies like USING (true). Because every visitor’s browser already holds the anon_key and project URL, anyone with browser DevTools can dump entire customer tables or modify order records in seconds.

2. Service-role & paid API keys pasted into frontend code

When builders hit an RLS block (or wire up an LLM, PDF parser, or maps lookup) prompts often drop a Supabase service_role key (which bypasses all RLS security) or third-party vendor keys directly into client components or VITE_* / NEXT_PUBLIC_* variables. Those keys ship straight to every visitor’s laptop.

3. Client-side payment and approval bypasses

Audit reports repeatedly documented apps where Stripe checkout redirects back to a success URL and the browser calls the database to flip is_paid = true or increment account credits. A user who skips checkout and replays that single update request gets paid access or triggers wholesale order fulfillment for free. Billing state must only ever change inside a verified server-side webhook.

4. Orphaned admin routes left behind by prompt iterations

Over 50–100 prompts (“add an export button,” “let managers approve quotes,” “revert that screen”), AI agents leave half-wired endpoints and stale helper functions behind. Because there’s no route-level test suite checking authorization, test backdoors stay live in production.

5. Post-launch blind spots: your coding agent knows your code, not your live app

Once a Lovable or Bolt app goes live with real customers, founders hit a second wall: the chat window only sees the generated source files, not production logs, failed webhook traces, or database state from last night. Asking the same AI builder to “fix why checkout failed for one customer” without structured logging, staging isolation, or an infrastructure inventory often triggers blind edits that break working features.

Five-minute red-flag checklist for non-technical owners

If you already have an internal tool or client portal built in Lovable, Bolt, or Replit, ask whoever manages it to prove four things today:

  1. Every table in Supabase returns rowsecurity = true: and zero public tables rely on blanket USING (true) policies for sensitive data.
  2. A clean key rotation has happened: service_role, Stripe, OpenAI, and Google credentials exist strictly on the backend server, never in VITE_* or frontend network payloads.
  3. Invoices and subscriptions update only from signed webhooks: never from a frontend button click or redirect query string.
  4. There’s an automated backup and rollback test: not just platform “history,” in case an errant prompt drops a live column.

(Remember our rule in Your Replit or Lovable App Isn’t Production-Ready: once real customer data, employee workflows, or money touch the app, you’ve crossed out of prototype territory.)

Audit & harden before a customer tells you your database is public

The cost of discovering an open customer table or leaked API key after launch dwarfs the cost of auditing the schema up front.

Andrey Kamensky (kamensky.dev) audits, hardens, and migrates AI-generated prototypes into properly structured, owned systems (see the rescue & takeover process). Pair a security check with a clean architecture plan through an Operations & Data Audit, or book a 20-minute fit call → to get an honest fix-vs-rebuild verdict.

Sources & further reading

Frequently asked questions

Are Lovable or Bolt apps using Supabase insecure by default?

Supabase itself is secure, but AI code generators frequently deploy prototypes with Row-Level Security (RLS) disabled or set to overly broad rules like USING (true). Because Supabase apps place a public anon key inside frontend JavaScript, anyone inspecting browser network traffic can read or overwrite unprotected tables directly.

What was CVE-2025-48757 in AI-generated web applications?

CVE-2025-48757 documented widespread missing and misconfigured authorization across live AI-generated projects using Supabase, exposing user records, internal API keys, and payment logs on public URLs because security policies had never been hardened past prototype testing.

What should a founder check before putting real customer or financial data into an AI-built app?

Verify that Row-Level Security is enabled with strict user-scoped policies on every database table, confirm no service_role or third-party secret keys live in client bundles, and ensure all Stripe or invoice payment updates happen exclusively through verified server-side webhooks.