Next.js security scanner for production apps
Next.js blurs the line between server and browser code, which is where most of its security mistakes hide: a secret behind a public prefix, an API route that forgets to check the user, a middleware you can step around. ScanAnt checks the deployed site and, if you upload the source, the code itself.
Free, no signup. We only read what your site already shows every visitor.
What we check
Each item is tagged with the scan that reports it. The quick scan is free and needs no signup. The others run only on sites you have proved you own.
Secrets in client chunks
Quick scanKeys that ended up in the JavaScript under /_next/static, such as payment, AI, database and service keys. Matches are shown masked.
Public source maps
Quick scanWhether .map files for your bundles are served, which exposes your original code, comments and routes.
Headers and cookies
Quick scanNext.js sends few security headers by default. We check HSTS, CSP, framing, nosniff, Referrer-Policy and cookie flags.
Middleware bypass
Deep scanA harmless single GET with a crafted header tests CVE-2025-29927, which lets requests skip authorisation done in middleware.
Version and known CVEs
Deep scanWe detect the Next.js and server versions and compare them with published vulnerabilities and end-of-life status.
NextAuth and exposed endpoints
Deep scanWhether the NextAuth provider list is public, and whether API documentation, debug paths and development leftovers are reachable.
Server secrets behind public variables
Code scanA server secret placed in a variable that ships to the browser, found in your .env and source.
API routes and server logic
Code scanRoute handlers that do powerful things without checking who calls them, missing owner checks (IDOR), SQL built from strings, Stripe webhooks without signature checks and prices taken from the browser.
- Quick scan: No signup. Reads only what every visitor receives.
- Deep scan: After you prove ownership and tick the deep option.
- Code scan: You upload your project as a ZIP.
No scan can promise to find every problem. A clean result means no known problems were found on what the scan could see.
Common mistakes
Using NEXT_PUBLIC_ for a secret
The build inlines the value into JavaScript for every visitor.
Doing all authorisation in middleware
If middleware is skipped, as in CVE-2025-29927 on unpatched versions, the routes behind it are open. Check auth in the handler too.
API routes that trust the id in the URL
Without an owner check one signed-in user can read another user's records.
Shipping production source maps
They make a hostile read of your code as easy as a local checkout.
Stripe webhook without signature verification
Anyone can post a fake "payment succeeded" event.
How to fix it
Upgrade Next.js to a patched release and keep a note of the version you deploy.
Rename server-only variables to drop the public prefix, then rotate any value that already shipped.
Check the session inside each route handler and server action, not only in middleware, and compare the record owner with the user.
Set headers in next.config or your proxy, and disable productionBrowserSourceMaps.
Verify Stripe webhook signatures and compute prices on the server.
Questions
Do I need to upload my code?
No. The scan of the live URL works on its own. Uploading a ZIP of the project adds the code scan, which finds issues invisible from outside, such as missing owner checks.
Is the middleware bypass check safe?
Yes. It is one GET request with a single header, run only on sites you verified. It reports whether protected content became reachable and changes nothing.
Does it support the App Router and Server Actions?
The code scan reads route handlers and server code in JavaScript and TypeScript projects. Coverage varies, and the report says what could not be analysed instead of hiding it.
Will it work on Vercel?
Yes. Any publicly reachable deployment can be scanned. The platform name changes nothing about the checks.
Related checks
Find API keys and secrets exposed on your website
Leaked Stripe, OpenAI, AWS and database keys in public JavaScript.
Open →Security headers check: CSP, HSTS and friends
Is your CSP, HSTS, framing and referrer policy set up properly?
Open →Supabase security check: RLS, storage and auth
What anyone can read or write with your anon key, and whether service_role leaked.
Open →
Run the scan now
Free for any public site, no signup. Need the verified, deep or code scan? Choose the level on the scan page.
Choose a scan level →