# Can free users unlock your paid plan? The Supabase paywall hole in AI-built apps

Your AI-built app takes payments. Stripe is connected, the paywall works when you test it, and paid users get the paid features. The question almost nobody asks before launch is whether a free user can give themselves the paid plan without paying.

In apps built with Lovable, Bolt, Cursor, Replit or v0 on Supabase, the answer is often yes, and it takes one line in the browser console. Here's why it happens, a five-minute way to check your own app, and the fix.

## Why AI-built apps leak paid features

In a Supabase app, the browser talks to the database directly, using the public key in your JavaScript plus the user's sign-in. Row Level Security (RLS) policies are the only thing deciding what each user can change. Anything your page can send, a user can send too, with any value they like.

That leads to three common shortcuts. Each one works fine in a demo and gives paid features away in production.

### 1. The success page marks the user as paid

After checkout, Stripe redirects to `/success`, and that page runs something like `update profiles set is_pro = true`. But the same request works without paying. Anyone can open `/success` directly or run the update from the console.

Stripe's own fulfillment docs also say you "can't rely on triggering fulfillment only from your checkout landing page, because it's not guaranteed customers visit that page." A customer can pay and lose their connection before it loads. So the success-page approach fails in both directions: free users get in, and some paying users don't.

### 2. Users can edit every column of their own row

The usual policy an AI builder writes is "users can update their own profile":

```sql
create policy "Allow update for owners" on profiles
for update using ((select auth.uid()) = id);
```

Supabase's column-level security docs say about exactly this pattern: "this gives the post owner full access to update the row, including all of the columns." By default, "the `authenticated` role can update all the columns in the table."

So if `plan`, `is_pro`, `credits`, `role` or `paid_until` lives on the `profiles` table, every user can change it on their own row. RLS decides which rows a user can touch. It doesn't decide which columns.

### 3. RLS is off on the table entirely

Supabase warns that "a table in an exposed schema without RLS is readable and writable by any role with a grant on it," and that on existing projects new tables in `public` start with every privilege granted to `anon` and `authenticated`. In that case, signed-out visitors may be able to upgrade *anyone*, not just themselves.

## The five-minute check

Use a test account in your own app.

1. Sign up as a free user and sign in.
2. Open DevTools → Console. Your app already loaded the Supabase client. If it's exposed on `window`, or you can import it from your app's code in the Sources tab, run the update your paywall depends on, for example:
   ```js
   await supabase.from('profiles')
     .update({ is_pro: true })
     .eq('id', (await supabase.auth.getUser()).data.user.id)
     .select()
   ```
   Use whatever column your app actually checks: `plan`, `credits`, `subscription_status`, `role`.
3. If the response comes back with your row and the new value, any user can unlock paid features for free.
4. Visit your `/success` (or `/thank-you`, `/payment-success`) route directly without paying, then refresh your account page. If the app now treats you as paid, shortcut #1 is live.
5. Try the same update signed out. If it works, RLS is off on that table and the problem is bigger than the paywall.

**Do this only on an app you own, with test accounts.**

## The fix: only your server grants paid access

The rule is simple. The browser can *ask* for paid features. Only your server can *grant* them, and only after Stripe confirms the payment.

**Step 1: Move the paid flag out of user-editable tables.** Supabase's docs recommend "RLS policies in combination with a dedicated table for handling user roles" over column-level tricks for most apps. Create a table like `entitlements (user_id, plan, paid_until, stripe_customer_id)`:
- signed-in users can `select` only their own row
- users get no `insert`, `update` or `delete`

**Step 2: If the flag must stay on `profiles`, lock the columns.** Revoke the table-wide update and grant only the safe columns back, the way Supabase's example does:

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

Supabase's caution applies: restricted roles can't use `select *` on that table any more, so name the columns in your queries.

**Step 3: Write paid status only from a verified Stripe webhook.** Stripe says fulfillment through webhooks is required, and it's mandatory if you sell subscriptions or accept payment methods that confirm later. Listen for `checkout.session.completed`, plus `checkout.session.async_payment_succeeded` if you take delayed payment methods, and check the session's `payment_status` before granting access.

**Step 4: Verify every webhook signature.** Stripe's docs warn that without verification, "an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders, granting account access, or modifying records." Check the `Stripe-Signature` header against your endpoint's `whsec_` signing secret and the raw request body, using Stripe's official library. If you see "No signatures found matching the expected signature," here's what's usually wrong: https://proofforge.live/errors/stripe-no-signatures-found

**Step 5: Use the right key in the webhook, and keep it server-side.** The webhook writes the entitlement with a Supabase secret key (or legacy `service_role` key), which bypasses RLS. Supabase notes it "bypasses RLS only when the request carries no user access token," so don't pass the user's session into the client your webhook uses. And never ship that key to the browser. If it was ever in your bundle, rotate it: https://proofforge.live/fix/service-role-key-exposed

**Step 6: Re-run the five-minute check.** The update from the console should now fail, and `/success` on its own should grant nothing.

## What an outside scan can and can't tell you

Be clear about what each kind of check sees.

**An outside scan can't see this bug.** It doesn't sign in as your users, so it can't tell whether a signed-in user can edit their own plan column. That takes the console test above, done with your own test account.

**An outside scan does catch the problems that make this worse:**
- a Stripe secret key or Supabase `service_role` key in your public JavaScript
- tables an anonymous visitor can read
- exposed `.env` files

ProofForge's free scan checks all of those from your live URL: https://proofforge.live

For the signed-in side, ProofForge's free two-account test checks whether user B can read user A's rows: https://proofforge.live/two-account-test

## The $9 math

If you charge $10 or $20 a month, one person sharing a console one-liner in a Discord can cost you more in a week than any fix. Trying to fix it by prompting your builder usually spends a few rounds of credits:
- "move the plan column"
- "now the profile page broke"
- "fix the webhook"

ProofForge's free scan shows every finding's severity and the top fix in full. **$9 once** unlocks every finding with exact code fixes and prompts written for your builder. **Fix + Guard ($29 once)** rescans on each deploy for 30 days, so a later prompt can't quietly put the key back in the bundle. There's a 14-day refund and no subscription: https://proofforge.live/pricing

Related:
- https://proofforge.live/fix/stripe-secret-key-exposed
- https://proofforge.live/fix/supabase-rls-disabled

*Sources, checked December 1, 2026:*
- *Supabase docs, "Column Level Security," supabase.com/docs/guides/database/postgres/column-level-security*
- *Supabase docs, "Row Level Security," supabase.com/docs/guides/database/postgres/row-level-security*
- *Stripe docs, "Fulfill orders" (Checkout), docs.stripe.com/checkout/fulfillment*
- *Stripe docs, "Manage webhook endpoints" (verify events), docs.stripe.com/webhooks/signature*
- *ProofForge tiers, proofforge.live/pricing.json*
