KeyLeak

Runs 100% in your browser

Find exposed API keys, tokens, and database credentials in your website's JavaScript bundles before attackers do.

Star on GitHub

Scan code

Live Site Scanner Bookmarklet

Drag the button to your bookmarks bar. Open your own website, click the bookmarklet, and it will fetch same-origin scripts and render an isolated Shadow DOM audit report directly on the page.

Findings

Ready to scan
No scan run yet Paste code above, drop build files, or click "Try a sample" to test 24+ secret detectors.

How it works

01

Pattern + Entropy Verification

Combines vendor-specific token prefixes and lengths with Shannon entropy checks and JWT payload decoding to separate real secrets from random bundle hashes.

02

Context-Aware Severity

Distinguishes public-by-design keys (like Stripe pk_live or Supabase anon) from privileged backend credentials (sk_live or service_role).

03

Zero-Upload Architecture

All parsing, file reading, and bookmarklet scanning happens strictly inside your browser tab. Secrets are immediately masked in reports so exports stay safe to share.

Frequently asked questions

Why do API keys leak in frontend code?

Modern bundlers (Vite, Next.js, Webpack) inline environment variables prefixed with VITE_ or NEXT_PUBLIC_ directly into compiled JavaScript chunks. Fast-shipped and AI-generated apps often accidentally prefix private backend secrets or hardcode client SDK credentials directly in browser components.

Which keys are safe to be public?

Publishable identifiers designed for client SDKs—such as Stripe pk_live_ keys, Firebase web config keys, Google Maps/Places browser keys, and Supabase anon keys—are meant to ship in frontend code. However, they still require domain/HTTP referrer restrictions and strict Row-Level Security (RLS) policies on the backend.

What should I do if I find a leaked secret?

Treat any secret exposed in a public bundle or git history as compromised. Immediately revoke and rotate the credential in the provider's dashboard, move the new secret to a server-only environment variable, proxy sensitive API calls through your own backend endpoint, and audit provider logs for unauthorized usage.

Is my code or secret data sent anywhere?

No. KeyLeak makes zero external network requests. Uploaded files are read locally via the browser FileReader API, and the bookmarklet only fetches scripts from the same origin you are actively inspecting.

Ethical use: what sites may I scan?

Scan only websites, repositories, and build artifacts that you own or have explicit written authorization to test. KeyLeak is built as a defensive pre-flight and self-audit utility for developers and security teams.