CapLeak / Guides

Bolt and v0 security checklist

Get a free score for your deployed app in seconds. Then go through the ten checks below.

Scan your app freeFree score in seconds. No password, no card.

Short answer: where secrets can live depends on your app's framework, not on the builder's name. A Vite app runs almost entirely in the browser; a Next.js app also has server code. Check your project's package.json to see which one you have. In both, anything with a public prefix (VITE_ or NEXT_PUBLIC_) is shipped to visitors, your database rules must hold up against the public key, and your deployed site needs HTTPS, headers and no exposed files. Work through the ten checks below.

Vite app or Next.js app?

Vite appNext.js app
Public env prefixVITE_NEXT_PUBLIC_
Where secrets can liveSupabase Edge Functions or a separate backendRoute handlers and server actions, using env vars without the public prefix
Where headers are setYour host's confignext.config headers() or your host's config
Main riskSecrets pushed into the browser to "make it work"Server code that runs for anyone, with no auth check

The checklist

Secrets

  1. No secrets behind a public prefix. List every VITE_ or NEXT_PUBLIC_ variable. Only public values belong there, such as your Supabase URL and anon / publishable key. A variable like NEXT_PUBLIC_OPENAI_KEY is a leaked key.
  2. No secrets in the built code. Open the deployed site, open DevTools, and search all sources for sk-, sk_live_, sb_secret_, service_role and AKIA. Builders sometimes hardcode a key straight into a component.
  3. Source maps off in production. Vite's build.sourcemap and Next.js's productionBrowserSourceMaps are off by default. If someone turned them on, your original source (and any key in it) is readable.

Data

  1. RLS on every Supabase table. Run Supabase's Security Advisor and fix every table it reports with RLS disabled. Replace true policies on user data with auth.uid() checks. Full steps: Supabase RLS checker.
  2. Private storage for private files. User uploads go in private buckets with signed URLs.
  3. Server code checks who's calling (Next.js). Every route handler and server action that reads or changes data should confirm the user is signed in and allowed to touch that record. Server actions can be called directly, not only from your form.
  4. Edge Functions check who's calling (Vite + Supabase). Same rule. A function that holds a secret key and does whatever it's asked is a public endpoint with admin rights.

Deployment

  1. No exposed files. /.env, /.env.local and /.git/config on your live domain should not return file contents, and neither should leftover backups like backup.zip, db.sql or .DS_Store. Public API docs (/openapi.json, /swagger.json, /docs) should not list every endpoint either. See Did my .env leak?
  2. HTTPS and headers. HTTPS redirect, HSTS, a Content-Security-Policy, clickjacking protection (frame-ancestors or X-Frame-Options), nosniff, and referrer and permissions policies.
  3. Preview deploys aren't leaking. Preview URLs often use the same keys and database as production. Make sure they're not indexed, and don't share them publicly unless the app is ready.

Fix prompts

For a Vite app:

Find every secret API key in this project (anything not meant for the browser). Remove it from VITE_ variables and frontend code. Create a Supabase Edge Function for each operation that needs a secret, store the key as a function secret, and make the function verify the signed-in user before doing anything. Then confirm that RLS is enabled on every table.

For a Next.js app:

Rename any NEXT_PUBLIC_ variable that holds a secret so it no longer has the prefix, and only read it in server code. In every route handler and server action, check the user's session and confirm they own the record before reading or writing. Add security headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy) in next.config. List the files you changed.

After any key moves out of the browser, rotate it. Moving it doesn't remove copies people already downloaded.

What CapLeak checks

The free score covers checks 2, 4, 8 and 9 from the outside, and gives a score, a grade and problem counts by severity. It looks for secret keys in your homepage and the JavaScript files it loads. It checks database (Supabase) access using only your public key and a row count, with no rows downloaded. It asks whether .env, .git and source map files are served, without downloading them. And it checks HTTPS and headers. The $12 full report (one time, per app) shows where each issue is, with a plain-English fix and a copy-paste prompt for Lovable, Bolt or Cursor, right after checkout. The deep part (database tables, hidden files like .env and .git, and source maps) is added after a quick ownership check, which takes about a minute. Checks 1, 3, 5–7 and 10 depend on your code and settings, so review those yourself. Using Lovable? Start with Is my Lovable app secure? To keep an app watched every week, Watch is $15 a month per app and Unlimited is $39 a month for up to 25 apps, with no report needed first.

CapLeak runs passive checks only. A passing grade means none of its checks failed; it is not a guarantee of security.

FAQ

Bolt and v0 security, answered.

Are NEXT_PUBLIC_ and VITE_ variables safe for API keys?

Only for keys meant to be public, such as the Supabase URL and anon or publishable key. Both prefixes copy the value into the JavaScript every visitor downloads, so secret keys must never use them.

Where should secrets go in a Next.js app?

In environment variables without the NEXT_PUBLIC_ prefix, read only in route handlers or server actions, which run on the server. Each of those should also check the caller's session.

Where should secrets go in a Vite app?

A Vite app runs in the browser, so secrets belong in Supabase Edge Function secrets or a separate backend, never in VITE_ variables or component code.

Do I need security headers on a small app?

They are cheap to add and limit the damage from bugs like injected scripts or clickjacking. Set them in your host's config or in next.config.

What does CapLeak's free score cover for Bolt and v0 apps?

Secret keys in your homepage and its JavaScript, database (Supabase) access using only your public key, whether hidden files like .env, .git and source maps are served, HTTPS and security headers, plus Google basics, robots.txt, sitemap.xml and broken links. The $12 full report shows where each issue is, with fix prompts. A passing grade is not a guarantee of security.

Run the outside check before launch day.

Free score in seconds. No password, no card.

Get my free score