Skip to content

Scan by stack

Next.js security scanner: see what your app ships to the browser.

Next.js bundles a lot of your app into code anyone can download: client components, the build manifest, sometimes the source maps. A free, read-only scan pulls that apart and shows you the attack surface an attacker reads first, with every finding pinned to the exact file and line.

Run a free scan
  • Read-only
  • No login
  • Results expire in 24h

What the scan surfaces

Public env and keys

Every NEXT_PUBLIC_ value is inlined into the client bundle. The scan flags the ones that are actually secrets (API keys, tokens, third-party credentials) that were never meant to ship.

Routes and screens

Pages, API routes and dynamic segments reconstructed from the /_next build manifest and chunk graph: the full route map, including the screens you never linked publicly.

Source maps and secrets

Source maps left in production hand an attacker your original code. The scan detects them and the hardcoded secrets inside client components, each with its file and line.

How a Next.js app leaks

Why Next.js specifically

The NEXT_PUBLIC_ convention makes it one copy-paste to push a server secret into the browser, and the build manifest turns your file tree into a public map. Both are invisible until someone looks.

Server vs client

A key that belongs only in a Server Component or Route Handler, pasted into a "use client" file, ships to everyone. The scan separates what stayed on the server from what crossed the line.

Fix it at the line

No vague grade. Each finding points at the chunk, the original file, and the line, so you can rotate the key or move the code the same afternoon.

Questions

Is NEXT_PUBLIC_ a secret?

No. Anything prefixed NEXT_PUBLIC_ is inlined into the JavaScript sent to every visitor. Use it for values that are safe to publish, such as an analytics site id. A server key behind that prefix is public the moment the build ships, and rotating it is the only fix.

Are source maps in production a security problem?

They hand a reader your original file names, comments and unminified logic, which turns a bundle into a code review. They are not a vulnerability on their own, but they make every other leak, a hardcoded key or an unlinked admin route, far easier to find. Turn off productionBrowserSourceMaps or stop serving the .map files.

What does the scan contact?

The scan reads public HTML, JavaScript chunks, build manifests and source maps, then automatically crawls the submitted site and runs active security checks. No ownership attestation is required.

Does this work for a React app that is not Next.js?

Yes. The React and Next.js scanner covers any React app, built with Vite, Gatsby or React Router as well as Next.js. This page describes the checks specific to Next.js, which rely on the build manifest and the NEXT_PUBLIC_ convention. A Next.js app on Supabase also gets the Supabase key and table exposure checks.

Built by Keygraph

This free scan is a taste of Keygraph: continuous agentic pentesting that ships every finding with a working exploit.

Explore the platform