Understanding CVE-2025–29927: Next.js Security Vulnerability
Next.js middleware, which is meant to block unauthenticated access to protected pages, could be bypassed by adding a special request header. An attacker could then reach pages that should require login or membership without any credentials.
Published on medium.com
Have you ever visited a website and been asked to log in before seeing certain pages? That’s a form of security to keep private information safe.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
Protected pages and members-only content could be viewed without authentication, potentially exposing customer information and private company data.
What the attacker needed
Target runs an affected Next.js version; protected routes rely on middleware; no account needed
The fix
It should be fixed by upgrading Next.js to a patched release (15.2.3, 14.2.25, 13.5.9 or 12.3.5 depending on the major version).
How it was found
- Visit a protected page without logging in and observe the redirect to login.
- Send the same request again with the special header added.
- The middleware check is skipped and the protected page is returned.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Next.js is a toolkit for building websites, and its 'middleware' is a checkpoint that decides whether a visitor may see a page. The bug let anyone skip that checkpoint by sending an extra instruction with their web request, so private pages opened without logging in.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.