ShipBastion AI Watch — $19/mo

ShipBastion / Security guides / Check your JavaScript bundles for leaked API keys

Guide · VibeShield · Updated 2026-11-30 · 6 min read

Check your JavaScript bundles for leaked API keys

Anything in a NEXT_PUBLIC_ or VITE_ variable ends up in the JavaScript every visitor downloads. That is fine for publishable keys and a disaster for secret ones.

Free scan. Sign in with Google to see the full report; paid plans start with a 7-day free trial.

Public by design vs secret

Safe in the browser: Stripe pk_live_, Supabase anon key, Firebase web config, Google Maps keys restricted by referrer. Never in the browser: Stripe sk_live_ or rk_live_, OpenAI and Anthropic keys, AWS AKIA access keys, Supabase service_role, database URLs.

Grep your build

grep -rEo 'sk_live_[0-9A-Za-z]{20,}|AKIA[0-9A-Z]{16}|sk-(proj-)?[A-Za-z0-9_-]{20,}|service_role' .next/static dist/ 2>/dev/null | sort -u

After a leak

  1. Rotate the key at the provider first; deleting it from the code does not help, it is already in caches and archives.
  2. Move the call behind your own server endpoint and check the provider's usage logs.
  3. Disable public source maps, which expose original source including comments.

Try it on your own domain

Free scan, no card. Pro is $19/mo after a 7-day free trial and covers all four scanners: VibeShield, CiteReady, InboxShield and BrandShield.

FAQ

How does ShipBastion find leaked keys?

VibeShield downloads your HTML and up to 24 JavaScript bundles and runs 221 secret rules over them.

Related