Apps built quickly with Lovable, Bolt, Cursor, or Replit on top of Supabase or Firebase tend to ship with the same small set of security holes. Code generation gets features working fast, which often means access rules, secret boundaries, and webhook verification get skipped or stubbed out.

You can check the most damaging ones yourself in about 20 minutes without buying any tools.

Before you start: only test code and apps you own or are explicitly authorized to review. Run every check against a staging or preview copy—never against live user data—and never paste secrets anywhere.

Below are the eight issues that show up repeatedly, a bad-vs-good code or SQL fix for each, and a manual test you can run right away.

1. Row Level Security (RLS) left off

When RLS is disabled on a Supabase table that holds user or business data, any request made with your public anon key and a valid user token (or even unauthenticated, depending on grants) can read or write every row in that table.

-- Bad: RLS disabled or never enabled on a user table ALTER TABLE invoices DISABLE ROW LEVEL SECURITY; -- Good: enable RLS on every table holding user or business data ALTER TABLE invoices ENABLE ROW LEVEL SECURITY; 

Try it yourself: Sign into your staging app as test user A, copy user A's JWT from browser DevTools, and query a row belonging to test user B through the Supabase client or REST API. With RLS enabled and scoped properly, it should return zero rows or fail.

2. Policies written as using (true) (or if true in Firebase)

Turning RLS on does not protect data if the policy itself is USING (true). That lets every authenticated user—and sometimes anonymous callers—access all rows in the table. In Firebase Firestore or Realtime Database, the equivalent mistake is allow read, write: if true; or ".read": true.

-- Bad: any signed-in user can read every user's profile CREATE POLICY "read_profiles" ON profiles FOR SELECT USING (true); -- Good: scope rows to the authenticated owner CREATE POLICY "read_own_profile" ON profiles FOR SELECT USING (auth.uid() = user_id); 

Try it yourself: Authenticated as test user A on staging, run a .select('*') filtered to test user B's user_id from the browser console or a small test script. If user B's rows come back, tighten the policy to check auth.uid() (or request.auth and ownership in Firebase).

3. service_role or secret keys in frontend code

Supabase's service_role key bypasses RLS completely. If a service_role key, Stripe sk_live_ key, or private key sits inside src/, app/, components/, pages/, or public/, it ships to every visitor's browser. Only anon or publishable keys belong in frontend code. While checking, make sure .env is git-ignored and absent from git history (git log --all -- .env).

// Bad: service_role key exposed in client-bundled code const supabase = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY!); // Good: anon key in the browser; service_role only in a server or edge function const supabase = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!); 

Try it yourself: Check your built frontend bundle—not just your source files—by searching the production/preview build output or browser DevTools Sources tab for service_role, sk_live_, or sk_test_. If anything secret appears there, rotate the key and move that call to a server route or edge function reading from environment variables.

4. Missing with check on INSERT and UPDATE policies

A USING clause controls which existing rows a user can see or target, whereas INSERT and UPDATE policies also need a WITH CHECK clause. Without it—or with WITH CHECK (true)—a user can insert or rewrite a row with another user's user_id.

-- Bad: lets a caller write another user's user_id CREATE POLICY "insert_orders" ON orders FOR INSERT WITH CHECK (true); -- Good: enforce that written rows belong to the caller CREATE POLICY "insert_own_orders" ON orders FOR INSERT WITH CHECK (auth.uid() = user_id); 

Try it yourself: Signed in as test user A on staging, attempt to insert or update a row with user_id set to test user B's ID. The database must reject the write.

5. Unverified payment webhooks

Payment webhook handlers for Stripe, Razorpay, or PayPal often read req.body directly and mark an order paid. If the route does not verify the provider's cryptographic signature before trusting the body, anyone on the internet can POST a forged payment succeeded event. Also ensure prices and amounts are read on the server, never trusted from the browser.

// Bad: trusts unverified request JSON export async function POST(req: Request) { const event = await req.json(); if (event.type === "checkout.session.completed") await fulfillOrder(event.data.object.id); } // Good: verify signature against the raw body before acting export async function POST(req: Request) { const rawBody = await req.text(); const sig = req.headers.get("stripe-signature")!; const event = stripe.webhooks.constructEvent(rawBody, sig, process.env.STRIPE_WEBHOOK_SECRET!); if (event.type === "checkout.session.completed") await fulfillOrder(event.data.object.id); } 

Try it yourself: Send a forged JSON POST request with curl and no valid signature header to your staging webhook endpoint. It must return 400 or 401 and leave order and payment state unchanged.

6. IDOR via a record or user id from the browser

Custom API routes and edge functions frequently bypass RLS by using a server-side admin client, then trust an id or userId sent in the request body or URL params. Hiding an admin or edit button in the UI does not protect the API behind it. Identity must come from the verified session, and every route that reads or modifies a record must check ownership.

// Bad: fetches any order ID supplied by the browser const { orderId } = await req.json(); const { data } = await adminClient.from("orders").select("*").eq("id", orderId).single(); // Good: derive identity from the verified session and check ownership const { data: { user } } = await sessionClient.auth.getUser(); if (!user) return Response.json({ error: "Unauthorized" }, { status: 401 }); const { data } = await adminClient .from("orders") .select("*") .eq("id", orderId) .eq("user_id", user.id) .single(); 

Try it yourself: Log into staging as test user A, trigger a request that reads or updates one of user A's items, replay it with the id swapped to one of test user B's items, and confirm the API rejects it instead of returning or modifying user B's record.

7. Wildcard CORS with credentials

Calling cors() with default or wildcard settings (Access-Control-Allow-Origin: * or origin: true combined with credentials: true) allows untrusted websites to send authenticated requests to your API on behalf of a logged-in user.

// Bad: reflects any origin while allowing credentials app.use(cors({ origin: true, credentials: true })); // Good: allowlist exact application origins app.use(cors({ origin: ["https://app.example.com"], credentials: true })); 

Try it yourself: Run curl -i -H "Origin: https://untrusted.example" https://your-staging-api.example/api/profile and read the response headers. You should not see Access-Control-Allow-Origin: https://untrusted.example alongside Access-Control-Allow-Credentials: true, nor * with credentials.

8. Raw HTML sinks like dangerouslySetInnerHTML

Passing user input—or AI-generated text influenced by user input—into dangerouslySetInnerHTML, Vue's v-html, or innerHTML = opens the door to stored or reflected XSS. An attacker can execute JavaScript inside another user's browser session.

// Bad: renders raw user-supplied HTML <div dangerouslySetInnerHTML={{ __html: comment.body }} /> // Good: render as plain text (or sanitize with a vetted library if HTML is required) <div>{comment.body}</div> 

Try it yourself: On staging, submit a harmless probe string like <b>test</b> or <img src=x onerror=alert(1)> into any bio, comment, or message field that displays back on a page. Check the rendered DOM: it should appear as literal text, not parsed HTML elements.

Putting the 20-minute pass together

Work through the checks in roughly this order on a staging copy:

  1. Check frontend source, built bundles, and .env history for exposed keys.
  2. Review every database table for RLS enabled, owner-scoped policies, WITH CHECK clauses, and private storage buckets.
  3. Test API routes for session verification, ownership checks (IDOR), webhook signatures, CORS headers, and raw HTML sinks.

Pattern checks catch obvious mistakes fast, while manual checks catch the missing-code bugs—like absent ownership checks or client-trusted roles. Record every failure with file:line evidence so each fix can be verified cleanly before launch.

I packaged the scanner, checklist and report template as a kit: https://saggurthi4.gumroad.com/l/pcenqc (code LAUNCH30 takes 30% off until 11 Dec)