AZSecureby Azguards Technolabs

Exploited vulnerabilities · Node.js

Next.js middleware authorization bypass (CVE-2025-29927)

One request header lets attackers skip Next.js middleware, and any login or access check that lives only there.

Exploited in the wildCVE-2025-29927CVSS 9.1 (critical)

Free website scan

Is your store serving malware right now?

Checks home, product, cart and checkout pages, blocklists, exposed files and spam shown only to Google. Takes about a minute.

How Next.js middleware authorization bypass works

Next.js adds an internal header to requests to stop middleware from calling itself in a loop. On self-hosted sites, nothing stopped an outside request from carrying that header too. Send it, and Next.js skips your middleware entirely.

If your login, admin or paywall checks run only in middleware, they could be bypassed. Sites hosted on Vercel or Netlify weren't affected. Sites running next start or the standalone output, including most Docker setups, were.

What attackers do with it

  • Access to pages and API routes that only middleware was protecting, such as admin areas.

Signs of a Next.js middleware authorization bypass compromise

  • Requests with an x-middleware-subrequest header in your proxy or access logs.

How to fix Next.js middleware authorization bypass

  1. Update Next.js to a fixed version and redeploy.
  2. Can't update today? Drop the x-middleware-subrequest header at your reverse proxy or load balancer.
  3. Check authorization again inside the protected pages and API routes, so middleware isn't your only line of defence.

Check if your Node.js site is exposed

The free scan flags headers that advertise Next.js, though from outside it usually can't see which version you run. A deep scan reads your lockfile and checks Next.js and every other npm package against public advisories.

Patched late, or not sure when?

A deep scan checks your installed version against this advisory and looks for what attackers leave behind, with read-only access. An Azguards engineer signs off the report.

Common questions about Next.js middleware authorization bypass

We host on Vercel. Are we affected?

No. Vercel and Netlify deployments weren't affected. Self-hosted Next.js was, whether it runs with next start, the standalone output or in Docker.

Sources

Reviewed by Asif, Azguards security team. Last updated 9 Nov 2026.