Skip to main content
Mallory
← Back to News
internet-facing-service-vulnerabilitywidely-deployed-product-advisoryidentity-authentication-vulnerability

Critical Next.js Middleware Bypass Enables Authorization Evasion

Vulnerability Disclosure · 4 sources · Updated 3mo ago · First seen Mar 25, 2025

Critical Next.js Middleware Bypass Enables Authorization Evasion

A critical vulnerability in Next.js tracked as CVE-2025-29927 allows attackers to bypass authorization controls when applications rely on Middleware for access checks under specific deployment conditions. Researchers showed that specially crafted requests using the x-middleware-subrequest header can cause Middleware processing to be skipped, forwarding requests directly to protected endpoints. The issue was described as an authorization bypass with a CVSS 9.1 severity rating and was later detailed by the Next.js team in a postmortem.

The flaw affects multiple Next.js release lines, with fixes released in 15.2.3, 14.2.25, 13.5.9, and 12.3.5. Guidance from defenders and the vendor says organizations should patch immediately, and those unable to update should block external requests containing the x-middleware-subrequest header. The exposure is tied to applications run with next start using the output: 'standalone' setting, while hosted Next.js deployments on Vercel and Netlify were reported as protected from this issue.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

5 events · Feb 27, 2025 – Mar 25, 2025
  1. Reported Jul 18, 20264mo ago

    Assetnote details improved CVE-2025-29927 detection methodology

    Assetnote reported that common public checks could miss redirect-based Next.js middleware implementations because expected middleware headers may not be exposed. It described using x-nextjs-data to reveal redirect or rewrite indicators, consolidating middleware-path tests in X-Middleware-Subrequest, and filtering locale redirects to reduce scanning false positives.

    Next.js Middleware Bypass CVE-2025-29927: Due Diligence Analysis
  2. Mar 25, 20252y ago

    CSIRT.SK issues advisory with mitigation guidance

    CSIRT.SK published an advisory on the critical Next.js flaw, summarizing affected versions, patched releases, and the recommendation to block external requests carrying the x-middleware-subrequest header if patching was not immediately possible. The notice also stated that Vercel- and Netlify-hosted instances were protected.

    Kritická zraniteľnosť Next.js | CSIRT.SK
  3. Mar 25, 20252y ago

    Next.js discloses CVE-2025-29927 and releases patched versions

    Next.js publicly disclosed CVE-2025-29927, a critical authorization bypass affecting applications that rely on Middleware for auth checks in certain deployment configurations. Patched releases were made available for multiple supported branches, including 15.2.3, 14.2.25, 13.5.9, and 12.3.5.

    Postmortem on Next.js Middleware bypass
  4. Mar 18, 20252y ago

    Researchers publish technical analysis of the middleware bypass

    Zhero Web Security published research describing how the x-middleware-subrequest header could be abused to bypass authorization checks implemented in Next.js Middleware. The write-up publicly documented the issue's mechanics before the vendor postmortem.

    Next.js and the corrupt middleware: the authorizing artifact
  5. Feb 27, 20252y ago

    Researchers privately report Next.js middleware bypass to Vercel

    According to Next.js's postmortem, Vercel received a private report from researchers about an authorization bypass involving Next.js Middleware and the x-middleware-subrequest header. This initiated the coordinated response to what became CVE-2025-29927.

    Postmortem on Next.js Middleware bypass
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Affected products

1 linked
Next.Js
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.