Skip to content

Supabase's October 30 change: new public tables need a grant for Data API access. What to doSupabase's October 30 change is live: new public tables need a grant for Data API access. What broke and how to fix it

25 tools · 142 fixes · 43 issue guides · Sources: Supabase, GitHub, Vercel, postgresql.org + 56

Issues

Is my Bolt app secure? What to check before you publish

Vite documents that VITE_ values are bundled into the client, and Vercel's Bolt export guide says the Secrets panel values are not in the zip you deploy.

Share link · Share on X

By ShipSecurely Editorial · Updated · How we make these guides

criticalSecretsSecrets and API keys

Shows up in: Supabase, Vercel

What it is

Bolt's own security pages do not give a yes or no for your project. Before you publish, check the database Security page, run the project security audit, and keep secrets in server functions.

Bolt's support docs are the source for the Secrets steps on this page. Two vendor pages describe the stack a Bolt app often ships with. Vite's env guide says variables prefixed with VITE_ are exposed in client source after bundling, and that those variables should not contain API keys. Vercel's guide to deploying a Bolt project says Bolt does not include Secrets panel values in the exported zip, so API keys are missing until you recreate them as Vercel environment variables.

If the app talks to Supabase, Supabase's securing-data guide still applies: the publishable key may be in the client only with row level security and grants, and a secret key bypasses RLS. This page does not claim a count of Bolt apps that ship with RLS off. That number was not on the pages above.

Is my Bolt app secure? What to check before you publish

Bolt's pages name the checks. They do not score the project.

Check your project's security says to run a security check at least once before you publish. The project security audit is Run security audit in the Publish menu. Bolt says that button does not use tokens, and that prompting Bolt to audit does. The audit reviews the whole project, including its code and database, and is available on paid plans. Bolt says it checks that private keys and passwords are not stored in the project's code or sent to visitors' browsers. It also looks for ways one person could see, change, or delete another person's information. A separate database security check is available on all plans.

Database security settings says the Security page checks the database, not the whole project. Open it from the database icon, then Security. It looks for missing row-level security and an access policy that is too open, using the same checks as Supabase's Security Advisor. Bolt says it turns row-level security on for the tables it creates, and that a table you add needs it on too, because a table without it can be read and changed by anyone. An RLS Policy Always True warning means a policy has no conditions that limit who can access a row. Bolt says that warning is acceptable only if you are comfortable with every visitor being able to change or delete that data. Open the page again after you update the database.

Secrets says a secret is read only when a server function needs it, and that Bolt does not write that value into project files, browser code, or the published site. Environment variables in .env are different: if browser code reads one, that value is sent to anyone visiting the published site. Bolt says never paste a secret into the project's code. Add it as a secret instead. Secrets named with the SUPABASE_ prefix are reserved and cannot be deleted. On an individual account only the project owner can open Secrets. On a team account the owner, co-owners, and admins can. Editors and Viewers cannot.

Our advice: use the signed-out SELECT check further down this page to see whether the publishable key returns another user's row.

Can I put my Supabase secret key in a VITE_ variable in Bolt?

No.

Vite's env guide says variables prefixed with VITE_ are exposed in client-side source code after bundling, because their values are bundled into your source code at build time. Supabase's API key guide says the secret key bypasses row level security and must never go in a browser. Only the Supabase URL and the publishable key belong in VITE_ names, and Supabase says the publishable key only reaches what row level security allows, so turn RLS on first.

# Public: Vite bundles VITE_ values into the browser JavaScript
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
# The secret key (sb_secret_...) never gets a VITE_ name

The secret key belongs only in server-side code. Bolt's Secrets settings hold values such as API keys and database passwords for server functions, which Bolt says are sometimes called edge functions, so private information never ends up in users' browsers. Open them by clicking the database icon in the project, then Secrets. Bolt's integrations troubleshooting page says the same Secrets steps work with a connected Supabase database, and that Supabase's dashboard under Edge Functions > Secrets updates the same secrets. Inside a Supabase Edge Function, Supabase says to use its @supabase/server SDK rather than reading the secret key from the environment.

In a production build, Vite writes the output to dist by default (build.outDir). Search it for the secret key prefix and the legacy role name:

grep -rE "sb_secret_|service_role" dist

Inspect every match, because example text or a variable name can contain either string. No match only shows those literal strings are not in the built files. It does not prove the app is safe. A legacy service_role key is a JWT with no sb_secret_ prefix, so the sb_secret_ search does not find it, and service_role only matches where that literal text appears.

Then test as a signed-out visitor. Open the deployed app in a private window with the browser's developer tools open, and confirm the secret key is not in the loaded JavaScript or in any network request. Send one SELECT request with the publishable key for a table that holds private rows. Supabase says a missing grant returns a permission error. A SELECT filtered out by RLS returns no rows. Either is a pass. Another user's row is the failure. An INSERT or UPDATE rejected by an RLS WITH CHECK policy can return 42501, per the 42501 troubleshooting page.

How to check in 5 minutes

  1. Search the Bolt project for VITE_ and open the built JavaScript if you have a production build. Vite's guide says a VITE_ value is in the client bundle and a variable without that prefix is not.

  2. If you exported a zip for Vercel, open the Vercel project's environment variables. Vercel's Bolt guide says Secrets panel values are not in the export. A missing key fails closed. A key you pasted into a VITE_ name fails open.

  3. If the app uses Supabase, open the table's RLS flag in the Supabase dashboard. Confirm a signed-out request with the publishable key does not return another user's row.

How to fix

Bolt

Remove the VITE_ prefix from any value that is a secret, and stop reading it from import.meta.env in client code. Call the third party from a server or edge function. Keep the Supabase publishable key as the client key only after RLS is on.

Vercel

Recreate Bolt secrets as Vercel environment variables, using the Secret type for credentials. Vercel's env docs say Secret values are write-only after saving, and Config values stay readable. Redeploy. An old deployment keeps the previous values.

Supabase

Enable RLS and policies for the roles the client uses. Do not put the secret key in a VITE_ variable. Supabase says that key bypasses RLS.

Copy the fix prompt

Paste this into Cursor, Lovable, Bolt, or Claude Code. Read the diff before you merge it.

You are fixing secret exposure in a Bolt project that uses Vite. Do not add features.

1. List every VITE_ variable. Any secret in that list moves to a server-side env var and out of client code.
2. If the app uses Supabase, enable RLS and show the policy. Do not put the secret key in the client.
3. Do not invent a statistic about Bolt apps. Show the files you changed.

Questions

Can I put my Supabase secret key in a VITE_ variable in Bolt?

No. Vite's env guide says VITE_ values are bundled into client-side source code at build time, and Supabase says the secret key bypasses row level security and must never go in a browser. Put only the Supabase URL and the publishable key in VITE_ names, and turn on row level security before you rely on the publishable key. Keep the secret key in server-side code only, such as a Bolt server function. Bolt's Secrets settings hold sensitive values for server functions so they never end up in users' browsers. After a production build, grep -rE "sb_secret_|service_role" dist searches Vite's default output folder for those literal strings. Inspect any match. No match does not prove the app is safe, and a legacy service_role key is a JWT with no sb_secret_ prefix. As a signed-out visitor, confirm the secret key is not in the shipped JavaScript or network requests, and that the publishable key cannot read another user's row.

Does the Vercel export include Bolt secrets?

No. Vercel's Bolt deployment guide says the Secrets panel values are not in the zip, and that you recreate them as Vercel environment variables before features that call external services will work.

Does Vite hide a VITE_ key?

No. Vite's env guide says the prefix exists to expose values to client code, and that API keys should not use it.

Sources

Related

Need someone to fix it for you? See /help.

The weekly fix

The weekly fix: 3 real security mistakes in vibe-coded apps and how to fix them, every Tuesday.

One email, every Tuesday. A welcome note follows the first signup.