Possible Next.js Middleware Auth Bypass via X-Middleware-Subrequest Header (CVE-2025-29927)

PremiumReviewedSigma · High · v1
Category
webserver
Author
HuntRule
Published
2026-09-08
Updated
2026-09-08

ATT&CK techniques

Initial Access → Defense Evasion
  1. Recon

  2. Resource Dev

  3. Execution

  4. Defense Evasion

  5. Cred Access

  6. Discovery

  7. Lateral Movement

  8. Collection

  9. C2

  10. Exfiltration

  11. Impact

What it detects

This rule detects HTTP requests carrying the X-Middleware-Subrequest header, which Next.js internally uses to prevent middleware recursion and which attackers forge to bypass middleware-based authentication in CVE-2025-29927 as analyzed by Assetnote. A client-supplied value for this header causes the framework to skip auth middleware and return protected content. Because legitimate external clients never send this internal header, its presence strongly indicates an exploitation attempt.

Related detections9 linkedT1190 — drag to rearrange
Suspicious SmarterMail Force Password Reset API Request Indicating Account Takeover
Windows Failed Logon (Event ID 4625) From Non-Private Public IP
Suspicious Login Shell Assigned to Service Account games on Linux
Suspicious SSH Daemon Configuration Change Enabling Root Login
Malicious Command Shell Spawned by SQL Server via Process Creation (via process_creation)
Malicious Command Shell or PowerShell Spawned by Tomcat via Process Creation (via process_creation)
Suspicious NTLM Network Logon From Attacker Controlled Workstation Names (via security)
Suspicious Shell Script Execution From Temp Directory on SonicWall SMA1000 Appliance (via process_creation)
Possible TP-Link Command Injection via WlanNetworkRpm Endpoint (via webserver)
Possible Next.js Middleware Auth Bypass via X-Middleware-Subrequest Header (CVE-2025-29927)
Pivot detection · T1190 · 9 related

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.