Skip to main content
Mallory
CriticalPublic exploitVulnerability

CVE-2025-29927: Next.js Middleware Authorization Bypass

Published Mar 21, 2025 · Updated 3 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days9 mentions · peak 7 in a dayToday
CVSS9.1Critical · v3.1
EPSS99.2%100th percentile
CISA KEVNoNot listed
In the wildReported132 exploitation records in Mallory
Vendor
Vercel
IdentifiersCVE-2025-29927CWE-285 · Improper Authorization

CVE-2025-29927 is an authorization bypass vulnerability in Next.js that allows remote attackers to skip middleware processing by spoofing the internal x-middleware-subrequest HTTP header. Applications that enforce authentication or authorization exclusively in middleware can consequently forward attacker requests to protected endpoints without performing those checks. Affected releases begin at 11.1.4, with fixes available in 12.3.5, 13.5.9, 14.2.25, and 15.2.3 for their respective release lines.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can expose protected resources and functionality to unauthorized users, compromising data confidentiality and potentially integrity where protected endpoints support state-changing actions. Other middleware-dependent protections may also be bypassed. Depending on application behavior, additional effects can include Content Security Policy bypass or denial of service through cache poisoning. Impact is constrained by any independent authentication and authorization checks enforced beyond middleware.

Mitigation

If you can’t patch tonight, do this now.

Prevent external user requests containing the x-middleware-subrequest header from reaching the Next.js application, enforcing the restriction at a trusted reverse proxy, gateway, or WAF across all externally reachable ingress paths. Vercel-hosted deployments were automatically protected against this vulnerability; Netlify-hosted deployments are also identified as protected.

Remediation

Patch, then assume compromise.

Upgrade Next.js to a patched release: 12.3.5 or later in the 12.x line, 13.5.9 or later in 13.x, 14.2.25 or later in 14.x, or 15.2.3 or later in 15.x. Prefer a currently supported release containing the fix. No fixed 11.x release is identified; migrate to a patched release line or apply the header-blocking workaround until migration is complete.

Public exploits

Exploits

74 exploits validated by Mallory's analysis. Hidden: 68 rejected by Mallory's analysis as not a working exploit; 5 not yet analyzed, such as Exploit-DB entries. Showing the 25 most capable, earliest first.

View more in app →
NextSploitThis repository provides a Python-based tool, NextSploit, designed to detect and exploit CVE-2025-29927 in Next.js web applications. The main script, NextSploit.py, is a command-line utility that prompts the user for a target URL (or a file containing multiple URLs), determines if the target is running Next.js, checks the version for vulnerability, and, if vulnerable, attempts to bypass middleware authentication by launching a browser session with custom headers. The tool leverages Wappalyzer for technology and version detection, and uses Selenium to automate browser exploitation. It supports mass scanning and can output a list of vulnerable URLs. The secondary script, NextSploit_Custom.py, is a test version for community contributions and does not affect the main exploit logic. The repository includes a README with detailed usage instructions and requirements, and a requirements.txt listing necessary Python packages. The exploit is operational, providing real exploitation capability (not just detection), but is not part of a larger exploitation framework.AnonKryptiQuz · Disclosed Mar 28, 2025 · python · networkOperationalCVE-2025-29927This repository provides a Python-based scanner and exploit for CVE-2025-29927, a critical middleware bypass vulnerability in Next.js (versions 11.1.4 through 15.2.2). The main file, CVE-2025-29927.py, is a command-line tool that can scan single or multiple targets for the vulnerability. It works by sending HTTP requests with a specially crafted 'X-Middleware-Subrequest' header to endpoints on the target server. If the server is vulnerable, the tool demonstrates that protected routes can be accessed without proper authorization, effectively bypassing middleware security controls. The script supports concurrent scanning, SSL verification bypass, silent mode, and custom header values. The README.md provides detailed usage instructions, mitigation advice, and context about the vulnerability. The requirements.txt lists necessary Python dependencies. The exploit is operational, providing a working demonstration of the vulnerability and the ability to confirm unauthorized access to protected resources.gotr00t0day · Disclosed Apr 6, 2025 · python · networkOperationalNextJS-Exploit-This repository contains 'NextSploit', a Python-based command-line tool designed to detect and exploit CVE-2025-29927 in Next.js web applications. The main script, NextSploit.py, guides the user through entering a target URL, selecting a scan type, and then uses Wappalyzer to fingerprint the web application and determine if it is running a vulnerable version of Next.js. If the target is found to be vulnerable, the tool attempts to exploit the issue by injecting a custom HTTP header ('x-middleware-subrequest') to bypass middleware protections. If successful, it launches a Chrome browser session with the necessary headers to demonstrate unauthorized access to restricted pages. The repository includes a README with detailed usage instructions, prerequisites, and a disclaimer. The tool is operational, providing both detection and exploitation capabilities, and is intended for security research and educational purposes.pixilated730 · Disclosed Apr 7, 2025 · python · networkOperationalexploit-CVE-2025-29927This repository provides a working exploit for CVE-2025-29927, an authorization bypass vulnerability in Next.js (versions 11.1.4 - 12.3.4, 13.0.0 - 13.5.8, 14.0.0 - 14.2.24, and 15.0.0 - 15.2.2). The main exploit script, 'exploit-CVE-2025-29927.py', is a Python tool that targets web applications using vulnerable Next.js versions where authorization checks are implemented in middleware. The exploit works by sending HTTP requests with the 'x-middleware-subrequest' header, which causes the middleware to be bypassed, granting unauthorized access to protected routes such as '/admin'. The repository also includes a 'vulnerable-next-app' directory, which contains a sample Next.js application (with Docker support) that demonstrates the vulnerability. The exploit script can automatically detect the Next.js version, attempt the bypass, and save the resulting unauthorized response to a file. The repository is well-structured, with clear documentation, a requirements file for dependencies, and a test environment for demonstration. The primary attack vector is network-based, targeting web endpoints exposed by the Next.js application.UNICORDev · Disclosed Apr 14, 2025 · python · typescript · networkOperationalCVE-2025-29927This repository provides a functional exploit for CVE-2025-29927, a critical authorization bypass vulnerability in Next.js middleware. The exploit consists of a Python script (exploit.py) that allows an attacker to test and exploit the vulnerability by sending crafted HTTP(S) requests to a target Next.js application. The script first sends a baseline request to determine if middleware-based authentication is present (indicated by a 307 redirect). It then attempts to bypass the middleware by including the 'x-middleware-subrequest: middleware' header in a follow-up request. If the bypass is successful, the attacker gains unauthorized access to protected routes. The repository includes a README.md with detailed usage instructions and a requirements.txt listing dependencies (requests, colorama, beautifulsoup4). The exploit targets Next.js versions prior to 15.2.3, 14.2.25, 13.5.9, and 12.3.5, and is effective against self-hosted deployments that use middleware for access control. No hardcoded endpoints are present; the user specifies the target host, port, and path at runtime.rubbxalc · Disclosed Apr 29, 2025 · python · networkOperationalNextJS-CVE-2025-29927-Docker-LabThis repository is a Docker-based lab environment for demonstrating and testing the Next.js CVE-2025-29927 vulnerability, which is a critical authorization bypass in Next.js middleware. The lab includes a full-featured e-commerce application built with Next.js, a MySQL backend, and Docker orchestration for easy setup. The vulnerability allows attackers to bypass middleware-based authentication by sending the X-Middleware-Subrequest HTTP header, granting unauthorized access to protected routes such as /admin. The repository contains both the vulnerable application code and detailed documentation (README.md, VULNERABILITY.md) on how to reproduce the exploit, as well as mitigation strategies. The main attack vector is network-based, targeting HTTP endpoints exposed by the Next.js server. The exploit does not require authentication and can be performed by manipulating HTTP headers in requests to protected routes. The codebase is primarily JavaScript/Node.js, with supporting files in SQL, CSS, Dockerfile, and YAML. The structure includes Next.js API routes, middleware, models, and service layers, all orchestrated for local testing of the vulnerability.enochgitgamefied · Disclosed May 23, 2025 · javascript · json · networkOperationalThank-u-NextThis repository contains a single Python exploit script ('thank_u_next.py') targeting CVE-2025-29927, a vulnerability in web applications that use middleware trusting the 'x-middleware-subrequest' HTTP header for authentication. The exploit works by sending HTTP requests with this header set to 'middleware', which can trick vulnerable middleware into granting unauthorized access to protected routes. The script supports multiple HTTP methods (GET, POST, PUT, DELETE, PATCH) and provides clear output indicating whether the bypass was successful. The README provides a detailed technical breakdown, usage instructions, and legal warnings. The only code file is 'thank_u_next.py', which is the entry point and contains all exploit logic. No hardcoded endpoints are present, but the script is designed to be used against arbitrary URLs and paths specified by the user. The exploit is operational, requiring only Python 3.7+ and the 'httpx' library.mickhacking · Disclosed Jul 14, 2025 · python · networkOperationalCVE-2025-29927This repository provides a comprehensive proof-of-concept and testing toolkit for CVE-2025-29927, a critical authentication/authorization bypass in Next.js middleware. The vulnerability allows attackers to bypass middleware-based access controls by supplying a crafted 'X-Middleware-Subrequest' HTTP header, causing Next.js to treat the request as an internal subrequest and skip middleware checks. The repository includes: - A detailed README explaining the vulnerability, affected versions, and mitigation strategies. - A Nuclei YAML template ('nextjs_nuclei_scan.yaml') for automated active and passive detection of the vulnerability, supporting multiple payloads and endpoint discovery. - A Python script ('scan.py') for multithreaded scanning of multiple targets and paths, sending requests with various crafted 'X-Middleware-Subrequest' header values and analyzing responses for signs of successful bypass. - A sample Next.js application (in 'nextjs/' directory) with middleware enforcing authentication, which can be used as a testbed for the exploit. The main exploit capability is the ability to bypass authentication/authorization on vulnerable Next.js applications by manipulating HTTP headers. The repository is operational and provides both detection and exploitation tools, with clear instructions and code for both automated and manual testing. The attack vector is network-based, targeting HTTP(S) endpoints of Next.js applications. No hardcoded IPs or domains are present; the tools are designed to be used against user-specified targets.iteride · Disclosed Sep 21, 2025 · Framework: nuclei · python · yaml · networkOperationalCVE-2025-29927-Proof-of-ConceptRepository is a small Next.js 15.2.2 + NextAuth (credentials) web app named “PhotoResizer Pro” that doubles as an exploitation walkthrough. Structure: - Auth & access control: `middleware.ts` applies `next-auth/middleware` to `/dashboard(.*)` and `/api(.*)`. Login UI is `app/login/page.tsx`; auth config is `app/lib/auth.ts` using env vars `AUTH_USERNAME`/`AUTH_PASSWORD` and JWT sessions. - Protected functionality: `app/dashboard/page.tsx` provides a file upload form that POSTs to `/api/upload` and then displays the returned image via `/api/images/<filename>`. - Vulnerable server routes: - `app/api/upload/route.ts`: writes the uploaded file to `process.cwd()/uploads` and then runs ImageMagick via `child_process.exec()` with `shell: '/bin/bash'`. The command string interpolates user-controlled `file.name` into the output path (`resized_ + filename`) without safe quoting/whitelisting, enabling OS command injection via crafted filenames. - `app/api/images/[filename]/route.ts`: serves files from the uploads directory after a session check; includes basic traversal checks for `..`, `/`, `\\`. Exploit chain described in README: 1) Enumerate web paths; `/dashboard` and `/api/*` are protected by middleware. 2) Bypass middleware using CVE-2025-29927 by sending a spoofed `x-middleware-subrequest` header containing the middleware name (e.g., repeated `middleware` segments). This causes Next.js to skip middleware execution, granting access to protected routes without a valid session. 3) Use the bypass to reach `/api/upload` and trigger command injection by uploading a file with a malicious filename that appends shell commands (e.g., reverse shell one-liners). This yields RCE as the web service user. 4) README includes an optional post-exploitation privilege escalation scenario (environment-specific): `webuser` can run `sudo /usr/bin/cat /etc/shadow` without a password, enabling offline cracking and root access. Overall purpose: a deliberately vulnerable training/CTF-style application demonstrating (a) Next.js middleware bypass (CVE-2025-29927) and (b) command injection in server-side image processing via ImageMagick `convert` executed through a shell.Si-Ni · Disclosed Feb 1, 2026 · typescript · tsx · network (HTTP) - middleware auth bypass via spoofed internal header (CVE-2025-29927) · network (HTTP) - authenticated route reached via bypass, then command injection via file upload filename into shell execOperationalCVE-2025-29927-Nextjs-AnalysisThis repository is a small self-hosted lab and PoC for CVE-2025-29927, a Next.js middleware authorization bypass. It is not a framework module; it contains a minimal vulnerable Next.js application under `JSR-next15/`, a Bash PoC (`poc.sh`), and supporting documentation in `README.md` and `docs/CVE-2025-29927-Analysis-Report.md`. Core exploit capability: the PoC sends a request to a protected route, by default `http://localhost:3000/admin`, with a crafted `X-Middleware-Subrequest` header set to `middleware:middleware:middleware:middleware:middleware`. In vulnerable self-hosted Next.js versions, this can cause the middleware recursion-prevention logic to skip execution of `middleware()`. Because the lab’s auth check exists only in `JSR-next15/middleware.js`, skipping middleware allows unauthenticated access to `src/pages/admin.js` without the required `lab-auth=1` cookie. Repository structure and purpose: - `JSR-next15/middleware.js`: the key vulnerable lab logic. It logs request path, `x-middleware-subrequest`, and cookie headers; checks for cookie `lab-auth=1`; returns HTTP 401 JSON on failure; and applies only to `/admin/:path*`. - `JSR-next15/src/pages/admin.js`: protected page with no secondary auth validation, intentionally demonstrating the impact of middleware bypass. - `JSR-next15/src/pages/index.js`: landing page advertising the lab and linking to `/admin`. - `poc.sh`: main exploit script. It derives a Host header from the target URL and performs the crafted `curl` request. - `Dockerfile` and `docker-compose.yml`: package and expose the lab on port 3000 for local reproduction. - `docs/CVE-2025-29927-Analysis-Report.md`: detailed write-up of affected versions, attack scenario, example attacker/victim IPs, and mitigation guidance. The exploit is operational but simple: it provides a hardcoded header-based bypass request rather than a customizable exploitation framework. No malware or post-exploitation payload is present; the result is unauthorized page access only.sangrok-jeon · Disclosed Mar 17, 2026 · javascript · bash · networkOperationalCVE-2025-29927__Next.jsRepository is a standalone Python proof-of-concept and scanner for CVE-2025-29927, a Next.js middleware authorization bypass caused by trusting the x-middleware-subrequest header. The main exploit file, exploit/cve_2025_29927.py, creates a requests session, sends a normal GET to a protected path, then repeats the request with x-middleware-subrequest: 1, and marks the target vulnerable when the normal request is blocked (302/401/403) but the crafted request returns 200 and contains admin-related keywords. It supports single-path testing, auto-scanning of common protected routes, loading custom path lists, saving results, and an exploit mode that retrieves protected content. The companion file exploit/batch_scanner.py scales this logic to multiple targets using a thread pool. It can read URLs from a file or generate HTTP targets from single IPs, dash ranges, or CIDR ranges, defaulting to port 3000. This makes the repository capable of both validation and broad network scanning for exposed vulnerable Next.js apps. The repository also includes a full vulnerable lab under target/: a Dockerized Next.js 15.1.0 application with intentionally vulnerable middleware in target/src/middleware.ts. That middleware protects /admin, /api/admin, /api/config, and /dashboard, but immediately allows requests containing x-middleware-subrequest: 1 before checking the auth-token cookie. The admin page demonstrates impact by exposing simulated user/account data and configuration secrets. Additional markdown docs explain usage, vulnerability mechanics, and defensive mitigations. Overall purpose: provide an operational web exploit and batch scanner for detecting and exploiting middleware auth bypass in vulnerable Next.js deployments, plus a reproducible local target for testing and demonstration.hujiaozhuzhu · Disclosed Apr 2, 2026 · python · bash · web · networkOperationaledu-reconedu-recon is a Python 3.10+ reconnaissance, vulnerability-triage, and active assessment orchestrator aimed at education-sector engagements. It has 38 files, primarily Python modules, with `recon.py` as the CLI entry point and `run.sh` as a one-command launcher. Its stdlib web UI (`edurecon/webui.py`) exposes scan submission, live logs, findings, report/reproduction generation, and dump functions; it defaults to localhost but can be bound to all interfaces without authentication. The engine expands CIDRs through nmap ping sweeps and domains through subdomain enumeration, then concurrently runs Shodan enrichment, nmap service/version scanning, dirsearch web discovery, exposure checks, secret/API-key scanning, Moodle auditing, reflected-XSS and SQLi checks, Hydra credential attacks, and WordPress wp2shell processing. Full intensity actively invokes sqlmap and Hydra; recon mode lists those candidates instead. It uses external repositories installed by `setup` for PHP-CGI, React2Shell, WordPress, and directory-scanning capabilities. Built-in CVE probes target PHPUnit eval-stdin RCE (CVE-2017-9841), Apache traversal/LFI (CVE-2021-41773), Struts S2-045 (CVE-2017-5638), Confluence OGNL RCE (CVE-2022-26134), Drupalgeddon2 (CVE-2018-7600), Next.js middleware bypass (CVE-2025-29927), PHP-CGI (CVE-2024-4577/CVE-2024-8926), and React Server Components RCE (CVE-2025-55182). Several internal checks use benign confirmation markers/arithmetic oracles, but the overall repository is an active exploitation platform: full mode can perform credential guessing and injection, external wp2shell can pursue SQLi-to-shell, and React2Shell can be configured away from safe-check mode to run a command. Notable collection functionality includes downloading exposed files and backups, scanning their contents for cloud/VCS/payment/API credentials, and `gitdump.py`, which mirrors an exposed `.git` directory, retrieves reachable loose Git objects, and reconstructs source files. Artifacts, reports, findings, and potentially sensitive material are stored under `runs/<run-id>/`; report code serializes evidence and can therefore retain sensitive values. ScopeGuard supports target/CIDR and subdomain allowlisting, but supplied documentation/configuration describe scope enforcement as disabled by default, materially increasing operator-supplied target risk.yeee3642 · Disclosed Aug 26, 2026 · python · bash · network · webOperationalCVE-2025-29927-PoCThis 14-file repository is an authorized-testing lab and functional proof of concept for CVE-2025-29927, an authorization bypass in vulnerable Vercel Next.js middleware handling. Its principal entry point, exploit.py, is a Python 3 standard-library HTTP client. It prevents redirect following, probes a user-supplied protected route, then cycles through forged x-middleware-subrequest header values. A 200 response following an unauthenticated baseline redirect is reported as a successful bypass, and the tool searches the response for FLAG{...} content. HTTPS certificate validation can optionally be disabled, and request timing, target path, timeout, and verbose output are configurable. The target/ directory supplies a deliberately vulnerable Next.js 14.2.24 application. middleware.js protects /admin solely through a session cookie check and redirects unauthorized users to /login. pages/admin.js performs no secondary authorization check and reads flag.txt using Node.js filesystem APIs, demonstrating sensitive server-side content disclosure once middleware is skipped. package.json defines build and production startup commands; setup.sh provisions Node.js 20, installs dependencies, and builds the application, while start.sh launches it on 0.0.0.0:3000. The tests/mock_target.py entry point is a lightweight Python HTTP simulator that reproduces the expected 307-versus-200 behavior on 127.0.0.1:8123 without requiring Node.js. This is standalone code rather than a Metasploit, Nuclei, or other exploit-framework module.Ritinify · Disclosed Sep 5, 2026 · python · javascript · network · webOperationalCVE-2025-29927This is a standalone CVE-2025-29927 reproduction lab with 16 files: eight programming-code files, a Dockerfile, two Compose configurations, two package manifests, and three Markdown files. The root README.md and WRITEUP.md are empty; exploit/README.md supplies the explanation and lab guidance. Repository URL, git reference, and archive size were not supplied; empty strings and zero represent unavailable metadata. The package-lock content is partially truncated. The target is a small Next.js Pages Router application. src/middleware.js restricts /admin by checking whether lab_auth equals 'ok' and otherwise redirecting to /login. The admin page has no independent authorization check and renders both a fixed LAB_SECRET marker and a runtime flag. The normal login API uses hardcoded lab credentials admin/lab1234. Because the cookie is merely a fixed, unsigned value, the lab also has a separate cookie-forgery weakness; the provided exploit scripts instead demonstrate the middleware-header vulnerability. exploit/poc.py and exploit/poc.sh issue baseline and header-injected requests to /admin. The fixed header repeats the middleware identifier five times, causing vulnerable Next.js middleware handling to skip the authorization middleware. exploit/verify.sh checks homepage availability, a baseline 302/307 response, and disclosure of LAB_SECRET after injection, then prints pass/fail totals and matching secret text. These are active exploitation scripts, not passive version detectors. The target URL is configurable, but the header payload is hardcoded. No reverse shell, persistence, arbitrary command execution, or external collection destination appears in the supplied code. The multi-stage Dockerfile builds and runs the application using Node.js 20.18.1. The main Compose file publishes port 10006 and supplies a local test flag. The optional attacker Compose file runs a curl container on the same bridge network and mounts exploit/ read-only. Containers are lab infrastructure, not the vulnerability's attack vector. Implementation caveats: Python urllib follows redirects, so its baseline may display the login page's final HTTP 200 rather than the original redirect. poc.sh declares /bin/sh but enables pipefail, which is unsupported by some sh implementations. verify.sh reports failures without explicitly returning a failing exit status and does not verify the redirect Location. The Dockerfile's rm -rf command only removes package-manager cache and is ordinary image cleanup, not evidence of a fake exploit. The documentation recommends upgrading the demonstrated Next.js 14.x branch to 14.2.25 or later and stripping externally supplied x-middleware-subrequest headers. No runtime validation was performed.sungue1 · Disclosed Oct 7, 2026 · python · sh · web · networkOperationalcve-2025-29927-nextjs-middleware-bypassThe repository contains a Portuguese README and two standalone Python 3 command-line scripts targeting CVE-2025-29927. The listed file sizes total 32,018 bytes. No repository URL, git reference, or archive size was supplied; the empty repository metadata and zero archive size denote unavailable information, not an empty repository. poc.py (version 1.0.0) provides protected-route scanning, custom paths, middleware-version selection, manual header testing, verbose logging, and JSON-output plumbing. Its visible manual branch sends an operator-supplied x-middleware-subrequest value and prints the response status and selected headers, including Location and Set-Cookie. Contrary to the README, --payload requires a value rather than acting as a standalone payload-generation switch; main also requires a target. The --scan flag is parsed, but the visible main function calls scan_bypass regardless of that flag unless the manual branch is selected. exploit.py (version 2.0.0) extends the bypass workflow. Its visible scanning loop uses eight worker threads and tests each selected route with the first three middleware identifiers: middleware, src/middleware, and pages/middleware. Additional listed identifiers are app/middleware, middleware.ts, middleware.js, src/middleware.ts, and src/middleware.js. These are header-payload identifiers, not evidence of local file access. The script selects the first reported successful bypass and reuses its header for optional dump_tokens, brute_admin_paths, and ssrf_via_api calls. It contains 27 visible administrative-route candidates and a 15-second timeout constant. Both Python files are substantially truncated in the supplied content. Request helpers, bypass-validation logic, token-extraction details, SSRF mechanics, the API_PATHS list, and poc.py's default path list cannot be inspected. Consequently, reported bypasses cannot be independently validated, and the advertised extraction and SSRF capabilities are supported by visible call sites rather than complete implementations. There is no demonstrated shell execution, persistence, or fixed exfiltration destination in the visible excerpts. Attribution links and example domains are not runtime destinations. The underlying bypass is credible, but it does not inherently defeat authorization performed outside middleware, and SSRF would require a separate application capability.Ghost-Bx1 · Disclosed Nov 1, 2026 · python · webOperationalsc3010This repository is a runnable educational reproduction of CVE-2025-29927, combining a deliberately vulnerable Next.js application with a Bash exploit driver. demo.sh sends two cookie-free GET requests to /admin: a baseline request expected to redirect to login and an attack request carrying a hardcoded x-middleware-subrequest header. On the vulnerable implementation, five colon-separated occurrences of 'middleware' trigger the middleware recursion guard, skipping the authorization layer and exposing the admin page. This is an active exploitation demonstration, not merely a version detector. No command execution, persistence, or exfiltration functionality is present. The 12-file repository contains seven source/script files: four TypeScript/TSX application components, middleware.ts, next.config.mjs, and demo.sh. app/admin/page.tsx intentionally lacks resource-level authorization. middleware.ts checks only whether a nonempty session cookie exists and otherwise redirects to /login; authenticated responses receive x-demo-middleware: executed. app/login/page.tsx implements an intentionally insecure stub login, while app/page.tsx and app/layout.tsx provide navigation and presentation. package.json and the lockfile pin Next.js 15.2.2 with React 19.0.0; the remaining files provide TypeScript configuration, ignore rules, and documentation. README.md explains reproduction, the header-trust flaw, and patch comparisons, identifying 15.2.3 as the fix on the 15.2 branch. Important limitations: neither demo.sh nor the npm server commands enforce localhost-only operation; the script accepts an arbitrary base URL, and no explicit loopback bind is configured. Its success check is a response-body string match, and its failure message incorrectly treats every missing match as proof of patching, although connection errors or unrelated responses can also cause failure. The reported Next.js version comes from local dependencies, not remote fingerprinting. Temporary-directory cleanup and documented .next build-cache deletion are consistent with a legitimate demo, not evidence of a fake exploit. Analysis is static, the lockfile content supplied was truncated, and no runtime success was independently verified. Repository URL, Git reference, and archive size were not supplied; empty strings and zero represent unavailable metadata.goheesheng · Disclosed Nov 2, 2026 · typescript · javascript · webOperationalnextjs-middleware-bypass-labThis is a standalone local reproduction and defensive toolkit for CVE-2025-29927, not merely a detector or README. The inventory contains 43 files, including 12 Python files, 12 JavaScript files, and one Bash script; Dockerfiles and YAML configuration are additional infrastructure. No original repository URL, revision, or archive size was supplied, and the two lockfile contents are partially truncated. The exploitation logic resides in demo.sh and tests/test_repro_integration.py. Both send a hardcoded x-middleware-subrequest header containing five middleware tokens to /dashboard. Two otherwise equivalent Next.js apps provide a vulnerable 14.2.24 target and a 14.2.25 patched control. Their middleware checks the deliberately simplistic session=valid-user cookie, while the dashboard itself performs no authorization. Successful exploitation returns HTTP 200 and the synthetic string 'SECRET: internal revenue figures Q3'; the expected normal or patched response is a login redirect. Tests encode these assertions, but no execution results were supplied. The repository does not implement arbitrary command execution, credential theft, persistence, or external data delivery. The nextguard/ Python package has no runtime dependencies and performs no network requests. Its CLI audits package.json, npm lockfiles, and classic yarn.lock files, supports JSON output and CI failure statuses, and reports unresolved version ranges as UNKNOWN. Its log scanner recursively inspects JSON header keys or plain header dumps, raising confidence for repeated middleware-name payloads. detection/sigma/ supplies an auxiliary experimental rule rather than an exploit-framework integration. docs/ contains mitigation guidance; labs/ contains both applications and Docker Compose; tests/ contains unit and real-HTTP integration tests; GitHub Actions configures testing, linting, and security scans. Important limitations: the log scanner's has_valid_id_pairing field only indicates the presence of a nonempty sibling ID header in JSON, or matching header text in a header-dump block. It does not validate the server's secret. An attacker-supplied ID can therefore suppress actionable findings, even without --ignore-paired, because paired detections never cause a failing log-scan exit status. Header logs alone also cannot establish successful exploitation or that traffic is external. The sample log files required by several tests and a CI command are missing from the supplied inventory, so the claimed passing suite cannot be assumed. The auditor classifies every version below 12.0.0 as affected without checking whether middleware exists; that broad rule should not be treated as a verified affected-version boundary. Compose explicitly publishes only on loopback, but the Bash demo and test harness launch next start without an explicit hostname, so their servers are not guaranteed to bind only to loopback. The demo leaves servers running afterward. Exploit requests otherwise target local HTTP services; package registry URLs are installation dependencies and GitHub advisory URLs are documentation references, not command-and-control endpoints.Seif-Abdelhamid · Disclosed Nov 15, 2026 · python · javascript · webOperationalnextjs-cve-2025-29927-pocThis repository is a proof-of-concept (POC) for CVE-2025-29927, an authorization bypass vulnerability in Next.js (version 15.2.2). The repository contains a minimal Next.js application with a middleware (src/middleware.ts) that blocks all requests by returning a 401 Unauthorized response. The README.md provides detailed reproduction steps, showing that by adding a specially crafted 'X-Middleware-Subrequest' HTTP header, an attacker can bypass the middleware and access protected resources (e.g., the 'Secret Page' at '/'). The exploit is network-based and requires the attacker to send a modified HTTP request to the target server. The repository structure is typical for a Next.js project, with configuration files, public assets, and application code. The main exploit capability is the bypass of authentication middleware via HTTP header manipulation, demonstrating the vulnerability in affected Next.js versions.azu · Disclosed Mar 23, 2025 · typescript · javascript · networkPoCvulnerable-nextjs-14-CVE-2025-29927This repository is a proof-of-concept (POC) exploit for CVE-2025-29927, an authorization bypass vulnerability in Next.js (versions 12, 13, and 14). The exploit demonstrates how an attacker can bypass middleware-based authorization on API routes by abusing the 'x-middleware-subrequest' HTTP header. The repository contains a minimal Next.js application with a protected API endpoint at /api/hello, which normally requires a specific Authorization header. The middleware.js file enforces this check. However, by sending a request with a specially crafted 'x-middleware-subrequest' header (e.g., 'middleware:middleware:middleware:middleware:middleware'), the middleware can be bypassed, granting unauthorized access to the endpoint. The README provides detailed reproduction steps and payload examples for different Next.js versions. The codebase is structured as a standard Next.js app, with relevant files including middleware.js (authorization logic), app/api/hello/route.js (vulnerable endpoint), and supporting configuration and UI files. No fake or destructive code is present; the repository is focused on demonstrating the vulnerability.lirantal · Disclosed Mar 23, 2025 · javascript · css · networkPoCCVE-2025-29927This repository is a proof-of-concept (POC) for CVE-2025-29927, a vulnerability in Next.js (versions 13.x < 13.5.9, 14.x < 14.2.25, 15.x < 15.2.3) that allows attackers to bypass middleware-based authentication by sending the internal header 'x-middleware-subrequest: middleware' in HTTP requests. The repository contains a minimal Next.js application with a protected route ('/protected') and a middleware that simulates authentication. The main exploit logic is in 'exploit-test.js', which sends requests to the protected route with and without the exploit header, demonstrating that the protected content can be accessed without authentication when the header is present. The README provides detailed vulnerability information, affected versions, impact, and reproduction steps. The repository structure includes standard Next.js app files, configuration files, and the exploit script. The exploit is network-based and targets self-hosted Next.js applications relying solely on middleware for authentication. No fake or destructive code is present; the repository is a legitimate POC for the described vulnerability.aydinnyunus · Disclosed Mar 23, 2025 · javascript · typescript · networkPoCpoc-nextjs-CVE-2025-29927This repository is a Python-based proof-of-concept (PoC) scanner for detecting the Next.js middleware subrequest vulnerability (CVE-2025-29927). The tool is designed to test whether a target Next.js application is vulnerable to bypasses via the 'x-middleware-subrequest' HTTP header. It supports scanning single or multiple targets, concurrent scanning with multithreading, customizable request paths, and automatic testing of all known payload variations for different Next.js versions. The scanner compares normal and exploit requests to determine if middleware protections can be bypassed, reporting detailed results and optionally exporting them in JSON format. The codebase is organized into modular files: 'main.py' (entry point and CLI), 'scanner.py' (core scanning logic), '_check_path.py' (per-path vulnerability checks), 'output.py' (terminal and JSON output), and 'utils.py' (helper functions for requests and URL handling). The exploit does not provide post-exploitation payloads but is focused on detection and confirmation of the vulnerability. No hardcoded IPs or domains are present; all targets are user-supplied via CLI arguments or files.ticofookfook · Disclosed Mar 23, 2025 · python · networkPoCcve-2025-29927-demoThis repository is a proof-of-concept (PoC) demonstration for CVE-2025-29927, an authorization bypass vulnerability in Next.js (version 15.2.2). The project is structured as a minimal Next.js application with authentication middleware protecting the /protected route. The exploit leverages the 'x-middleware-subrequest' HTTP header, which, when crafted with repeated 'middleware' values (to match the MAX_RECURSION_DEPTH of 5 in Next.js 15.x), allows an attacker to bypass the middleware's authentication checks and access protected resources without valid credentials. The main files of interest are: - middleware.ts: Implements the authentication check for /protected routes. - app/login/page.tsx: Provides a login form for users. - app/protected/page.tsx: The protected page that should only be accessible to authenticated users. - app/page.tsx: The main landing page with instructions and vulnerability details. The README.md provides clear exploitation instructions, including the exact curl command to trigger the bypass. The exploit is network-based, requiring only HTTP access to the target application. No fake or destructive code is present; the repository is a legitimate PoC for the described vulnerability.t3tra-dev · Disclosed Mar 23, 2025 · typescript · javascript · networkPoCnextjs-middleware-bypass-demoThis repository is a proof-of-concept (POC) exploit for CVE-2025-29927, targeting Next.js version 15.2.2. The structure is that of a standard Next.js application, with custom middleware (src/middleware.ts) enforcing authentication by checking for a specific cookie ('auth' with value 'S3CR3T!'). If the cookie is missing or incorrect, users are redirected to a /403 forbidden page. The exploit demonstrates that by sending a specially crafted HTTP request with the 'x-middleware-subrequest' header set to a repeated value (e.g., 'middleware:middleware:middleware:middleware:middleware'), the authentication middleware can be bypassed, granting access to protected resources without the correct cookie. The repository includes all necessary files to run the demo locally, including configuration, static assets, and the relevant middleware and page components. The main exploit capability is bypassing authentication via HTTP header manipulation, and the main fingerprintable endpoint is the local demo server at http://localhost:3000.fourcube · Disclosed Mar 24, 2025 · typescript · javascript · networkPoCnext-CVE-2025-29927This repository is a proof-of-concept (POC) for CVE-2025-29927, an authorization bypass vulnerability in Next.js middleware. The structure includes a Next.js project with a custom middleware (middleware.js) that protects all routes under /protected/* by returning a 401 Unauthorized response if the user is not authorized. The README explains the vulnerability and affected Next.js versions. The exploit demonstrates that, due to a flaw in Next.js, this middleware can be bypassed, allowing unauthorized access to protected routes. The codebase includes minimal pages: a public home page and a protected dashboard page. The main focus is on the middleware logic and its matcher configuration. No hardcoded credentials or external network endpoints are present; the exploit is local to the web application and targets the /protected/* route. The repository is not part of a larger exploit framework and serves as a standalone demonstration of the vulnerability.arvion-agent · Disclosed Mar 24, 2025 · javascript · json · networkPoCCVE-2025-29927This repository provides a proof-of-concept (PoC) exploit for CVE-2025-29927, a vulnerability in Next.js (version 15.2.2) middleware authentication. The main exploit file, 'Poc_CVE-2025-29927.py', is a Pocsuite3 module that demonstrates how to bypass authentication by sending a specially crafted HTTP header ('x-middleware-subrequest') with a value that triggers the middleware's recursion depth check. When the header contains five repetitions of the middleware name, the authentication logic is skipped, allowing unauthorized access to protected routes. The repository also includes a full vulnerable Next.js application under the 'vulenv' directory, with middleware-based authentication and a protected dashboard. The PoC works by comparing the response to a normal request and a request with the malicious header; a successful exploit is indicated by a status code of 200 and a change in response length, showing access to protected content. The exploit is operational as a PoC and is not weaponized. It targets Next.js 15.2.2 and earlier 15.x versions with authentication in middleware. The attack vector is network-based, requiring the attacker to send crafted HTTP requests to the target application. The repository structure includes the PoC script, a README with detailed analysis and setup instructions, and a full Next.js environment for local testing.Oyst3r1ng · Disclosed Mar 24, 2025 · Framework: pocsuite3 · python · javascript · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
VercelNext.Jsapplication
FAQ

Frequently asked questions

Is CVE-2025-29927 exploited in the wild?
Yes. As of Nov 15, 2026, Mallory has reports of exploitation in the wild.
Is there a public exploit for CVE-2025-29927?
Yes. Mallory tracks 74 public exploits or proofs of concept for CVE-2025-29927, the earliest disclosed Mar 23, 2025.
Is there a patch for CVE-2025-29927?
Upgrade Next.js to a patched release: 12.3.5 or later in the 12.x line, 13.5.9 or later in 13.x, 14.2.25 or later in 14.x, or 15.2.3 or later in 15.x. Prefer a currently supported release containing the fix.
What products are affected by CVE-2025-29927?
Vercel Next.Js.
How severe is CVE-2025-29927?
CVE-2025-29927 has a CVSS v3.1 score of 9.1 (Critical) and an EPSS score of 99.2% (100th percentile) as of Nov 15, 2026.
Activity feed

Recent activity

111 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
aws security blogNews · Oct 12, 2026GuardDuty Extended Threat Detection has added five new indicators to surface attack sequences | AWS Security BlogAn authentication-bypass vulnerability in Next.js, observed in the EKS example and frequently on Node web tiers in the launch sample. Its presence contributes vulnerability context but does not demonstrate exploitation.Read more ↗nuclei templates pull requestsNews · Sep 20, 2026Harden CVE-2025-29927 against middleware-bypass false positives by Tito0015 · Pull Request #17286 · projectdiscovery/nuclei-templatesA middleware-bypass vulnerability for which the referenced content discusses refining a detection template to reduce false positives and validate exposure using middleware rewrite/redirect headers and protected-content responses.Read more ↗mbsd blogNews · Sep 16, 20262026年8月度 MBSD-SOCの検知傾向トピックス | 技術者ブログ | 三井物産セキュアディレクション株式会社An authentication/authorization bypass vulnerability in Next.js middleware. An attacker can supply a crafted `X-Middleware-Subrequest` header to cause middleware that should enforce access controls to be skipped, potentially enabling unauthorized actions.Read more ↗cyber security newsNews · Sep 14, 2026Hackers Mass-Scan Exposed Vite Servers to Steal AWS and Azure Cloud CredentialsA Next.js middleware authorization-bypass vulnerability that was probed by a subset of the infrastructure conducting the Vite scanning activity.Read more ↗
+33 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence7Every report linking this CVE to a named adversary.
Associated malware13Malware families linked to this CVE, with evidence and IOCs.
Detection signatures2YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity70Community discussion across Reddit, Mastodon, and other social sources.