Is my v0 app secure? A security checklist before you publish
· PlugLeak
A checklist before you publish a v0 app: what v0 already blocks, secrets out of NEXT_PUBLIC_ and client components, auth in every Server Action and Route Handler, Supabase RLS, Vercel Secret env vars, and the live URL.
A published v0 app is a Next.js app, usually on Vercel. The live URL is what a visitor can read. v0 already does part of this list. Confirm the rest before you publish. The free scan is at https://plugleak.com/#scan, and the v0 page is /scan/v0. Session checks, Row Level Security, and Server Actions are manual.
1. What v0 already does
On the v0 security page, only variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Variables without that prefix stay on the server. v0 analyzes NEXT_PUBLIC_ usage and warns about security risks, and the AI can move code to Route Handlers, Server Actions, or other server-side contexts. The same page says never to expose sensitive tokens with the NEXT_PUBLIC_ prefix, and to run DeepSec before you ship to check the chat's changes for vulnerabilities (v0 security).
The August 4, 2025 post "v0: vibe coding, securely" adds deploy blocks. Its words: "Since launch, v0 blocked over 100k insecure deployments on Vercel." Also: "In the past 30 days, v0 blocked over 17k deployments on Vercel due to exposed secrets alone," and "Over 17k insecure deployments blocked in July alone." It names the most common issues as "Exposed API keys, NEXT_PUBLIC_ misuse, unauthenticated API routes." Vulnerabilities are flagged and require review before deploy (v0: vibe coding, securely).
2. No secrets in NEXT_PUBLIC_ or in client components
Next.js inlines NEXT_PUBLIC_ at build time into browser JavaScript and leaves other variables in Node. Change a public value by building and deploying again (Environment variables). Pass only public fields into a Client Component (Data security). A hardcoded string skips the prefix. The Vercel post says many generated projects put secrets directly in source files.
| Value | In the browser |
|---|---|
Supabase URL, sb_publishable_, legacy anon key | OK with RLS. It only reaches what Row Level Security allows. Never prefix the secret, or the bundler ships it (API keys). |
Stripe pk_ | OK, including pk_test_ and pk_live_. Only publishable keys are safe outside the back end (API keys). |
sb_secret_, service_role | Never. A secret key bypasses RLS. Rotation is the service_role guide. |
Stripe sk_, rk_, webhook signing secret | Never. Stripe says you are responsible for protecting secret and restricted keys. The webhook signing secret stays on the server. |
| OpenAI or Anthropic key, database URL | Never. Read DB_HOST, DB_USER, and DB_PASS in a Route Handler. Vercel, on NEXT_PUBLIC_DATABASE_URL: "That database URL is public. Anyone can view your page source and see it." |
Search the repo for NEXT_PUBLIC_, sk_, rk_, sb_secret_, service_role, and postgres://, then search the deployed files in section 7. If a secret reached the browser, rotate it, store the new value with no public prefix, rebuild, and search again. The wider prefix table is the NEXT_PUBLIC_ and VITE_ guide.
3. Server Actions and Route Handlers are public endpoints
An exported Server Action is reachable by a direct POST, not only from the UI. Verify authentication and authorization inside each one. A page-level check does not extend to the action (Data security). Do the same in each Route Handler (Authentication). The authentication guide says: "While Proxy can be useful for initial checks, it should not be your only line of defense in protecting your data." middleware.ts is deprecated and renamed to proxy, unless it still needs the Edge runtime (Renaming Middleware to Proxy). proxy.ts and route.ts have a lot of power. The redirect is not the owner check.
Open every "use server" file and every route.ts. Load the session in that function, then match the row's owner to that user. In the Next.js samples that helper is auth from @/lib/auth. With Supabase Auth, compare the server user id to the row. Return 401 with no session and 403 for someone else's row. The same checks for Cursor are the Cursor app security checklist.
4. Supabase: RLS and the two-account test
Supabase warns that a table in an exposed schema without RLS is readable and writable by any role with a grant on it. Enable RLS on every exposed table. On existing projects a new public table already has every privilege granted to anon, authenticated, and service_role. A policy does not remove those grants. Revoke the client roles, then grant back only what the app uses. A publishable key sees no rows until a policy exists. to anon using (true) opens every row that role can reach, so use it only for public data (Row Level Security).
Write one owner policy per operation. Insert uses with check, update uses using and with check, and delete uses using. Grants and the other three are the Supabase RLS checklist.
create policy "Users can view their own profile."
on profiles for select
to authenticated
using ( (select auth.uid()) = user_id );Then the two-account test. The docs' pgTAP example creates two users and, as the second, expects "another user reads no profiles" and a rejected write of the owner's row. The policy is what stops that signed-in stranger.
- As A, create a private row and confirm A can still read it. Empty for everyone can mean no policy allows the owner.
- Signed out, in a private window, A's row should not load. A call with only the publishable or anon key should not return it.
- As B, B cannot read or edit A's row, and B can still read B's own row.
- With the CLI, put that case in
supabase/tests/and runsupabase test db. Until it passes, you don't know the policies do what you intended.
The free scan does not test RLS or grants and does not query the database. An sb_secret_ or service_role key in the bundle bypasses the policies.
5. Vercel env vars: Secret, and a separate production value
v0 says to use Vercel environment variables for production deployments, and different keys for development and production. Choose Secret for passwords, API keys, and tokens. Secret values are write-only after saving. Existing Sensitive variables continue to work as Secrets, and each Secret can differ by environment or Preview branch (Sensitive environment variables). The optional Require Separate Values policy forces Production to differ from Preview, Development, and custom environments. Build logs replace a Secret of 32 characters or more with [REDACTED]. Secret does not stop Next.js from inlining a NEXT_PUBLIC_ name. In the env table, confirm the Secret label, a distinct production value, and no public prefix on a secret.
6. Nothing extra published, and security headers
Open https://your-domain/.env and https://your-domain/.git/config. An env file or a [core] git section in the body means the file is public. An HTML shell on unknown paths is only a rewrite. Leave productionBrowserSourceMaps off. Production builds disable browser source maps unless you opt in. With the flag on, Next.js writes maps next to the JavaScript and serves them on request (productionBrowserSourceMaps). Request a script URL with .map added.
Set them in headers() (headers). The HSTS example, max-age=63072000; includeSubDomains; preload, forces HTTPS and blocks HTTP-only hosts in that set, including subdomains. The only valid X-Content-Type-Options value is nosniff. X-Frame-Options has been superseded by CSP frame-ancestors. The CSP guide uses frame-ancestors 'none' (Content Security Policy). Rebuild after you add this.
// next.config.js — same headers() key in next.config.ts
module.exports = {
async headers() {
return [
{
source: "/:path*",
headers: [
{ key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains; preload" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Content-Security-Policy", value: "frame-ancestors 'none'" },
],
},
];
},
};7. Check the live URL from the outside
- View Source, and in DevTools Sources search every loaded file for
sk_,rk_,sb_secret_,service_role,postgres://, and-----BEGIN. Apk_key, ansb_publishable_key, or a JWT with"role":"anon"can be there on purpose. curl -sI https://your-domain/should liststrict-transport-security,x-content-type-options: nosniff, andcontent-security-policycontainingframe-ancestors.curl -s https://your-domain/.envandcurl -s https://your-domain/.git/config. Read the body.
Scan the live URL
The free scan is at https://plugleak.com/#scan, and for v0 at /scan/v0. Each request is a GET of the page and same-site JavaScript, max 25 files / 12 MB. It checks /.env, /.git/config, security headers, and TLS, and it detects Stripe, OpenAI, Anthropic, and AWS keys, GitHub tokens, PEM private keys, sb_secret_ keys, and service_role JWTs. It does not test Row Level Security or grants, query the database, log in, or crawl other routes, and it does not check auth or Server Actions. How the free scan works lists each request. The wider pass is the 10-minute self-check.
Quick checklist
- Run DeepSec, then review the deploy for a
NEXT_PUBLIC_secret. - Every Server Action and Route Handler checks the session, then the owner.
- Supabase: RLS, trimmed grants, an owner policy per operation, then two accounts.
- Vercel secrets are Secret, and production differs from preview.
curl -sIshows HSTS,nosniff, andframe-ancestors./.env,/.git/config, and.mapare absent.- Run the free scan, then check auth, Server Actions, and RLS yourself.
FAQ
Is my v0 app secure?
v0 keeps unprefixed environment variables on the server, warns on NEXT_PUBLIC_ usage, and can move calls to Route Handlers or Server Actions. Also walk this page: no secret in NEXT_PUBLIC_ or a client component, a session and owner check in every Server Action and Route Handler, Supabase RLS with a two-account test, separate production secrets on Vercel, and no public /.env, /.git/config, or production source maps. The free scan does not check RLS, auth, or Server Actions.
Is a Supabase key or a Stripe pk_ key in my v0 app a leak?
A Supabase URL, publishable key (sb_publishable_), legacy anon key, and Stripe pk_ key are meant for the browser. An sb_secret_ key, service_role JWT, Stripe sk_ or rk_ key, webhook signing secret, OpenAI or Anthropic key, or database URL is not. NEXT_PUBLIC_ values are inlined at build time. Rotate any secret that reached the browser, drop the public prefix, rebuild, and search the live JavaScript again.
Does middleware or proxy protect a v0 Server Action?
Proxy is an initial check. The authentication guide says it should not be your only line of defense. An exported Server Action is reachable by a direct POST, and a page-level check does not extend to it. middleware.ts is deprecated and renamed to proxy, unless it still needs the Edge runtime. Check the session and the row's owner inside every Server Action and Route Handler.
Does the free scan check RLS, auth, or Server Actions?
No. It is a passive GET of the page and same-site JavaScript (max 25 files / 12 MB). It checks /.env, /.git/config, security headers, and TLS, and it detects Stripe, OpenAI, Anthropic, and AWS keys, GitHub tokens, PEM private keys, sb_secret_ keys, and service_role JWTs. It does not test Row Level Security or grants, query the database, log in, or crawl other routes, and it does not check auth or Server Actions.
Sources
- v0: Security
- Vercel: v0: vibe coding, securely (August 4, 2025)
- Next.js: Environment variables
- Next.js: Data security
- Next.js: Authentication
- Next.js: Renaming Middleware to Proxy
- Next.js: headers
- Next.js: Content Security Policy
- Next.js: productionBrowserSourceMaps
- Supabase: Row Level Security
- Supabase: API keys
- Stripe: API keys
- Vercel: Sensitive environment variables
Check your app now — free, passive, about 20 seconds.
Same scanner as the homepage scan. Paste the live URL. It reads what a visitor already downloads. It does not log in or query your database.
Related guides
- GitHub token in the frontend
- Stripe secret key in the frontend
- CheckVibe alternatives
- OpenAI API key in the frontend
- Claude Code settings.local.json keys
- Bolt environment variables vs Secrets
- Cursor app security checklist
- NEXT_PUBLIC_ and VITE_ API keys
- Lovable app data exposure check
- Supabase 42501 permission denied
- Supabase RLS checklist
- Bolt Supabase API key visible
- Supabase service_role key exposed
- Lovable app security check
- Is my vibe-coded app secure?
Scan by builder