Abbi Labs

2026-12-04 · Daily security tips

Is middleware the only thing guarding your API routes?

In Next.js, middleware.ts (renamed proxy.ts in Next 16) is a handy place to redirect signed-out users. It isn't a lock on your data. Its matcher decides which paths it runs on, and a common pattern, including the example in Next.js's own auth docs, skips everything under /api. If middleware is your only auth check, those API routes answer anyone. A 2025 Next.js bug (CVE-2025-29927) also let one request header skip middleware on self-hosted apps.

Check: open middleware.ts or proxy.ts and read config.matcher. Then, signed out, call one of your API routes with curl or open it in a private window. If you get real data back, it's open.

Fix: verify the session inside every route handler and server action, and keep Next.js updated. Leave middleware for redirects.

Full guide: the matcher that skips /api, Server Actions, proxy.ts, CVE-2025-29927, a 3-minute check and the requireUser() fix.

Read the middleware guide →

Is your live site exposing something like this?

The free quick check looks at what your site already serves publicly: secret keys in your JavaScript, open /.env files and /.git folders, Supabase tables readable with your public key, missing security headers, CORS misconfiguration, insecure cookie flags and TLS certificate expiry. No sign-up needed.

No app handy?

Example result · our deliberately broken demo app

6 issues found: 3 critical, 1 high, 1 medium, 1 low

  • Critical: Stripe live secret key in public JavaScript
  • Critical: /.env file readable by anyone
  • High: Git repository exposed (/.git/HEAD)

The demo's problems are planted on purpose. Paste your own URL above to see yours.

No sign-up. Read-only public-resource and protocol metadata checks. No model prompts or tool execution. Scan only sites you own or are allowed to test.

Run on every deploy or use from Cursor / Claude Code via MCP →

Weekly AI-app security checklist

One short email a week: a practical check for apps built with Supabase, Next.js and AI tools (RLS, leaked keys, headers and more). Unsubscribe anytime.