CVE-2025-30218
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedNext.js is a React framework for building full-stack web applications. To mitigate CVE-2025-29927, Next.js validated the x-middleware-subrequest-id which persisted across multiple incoming requests. However, this subrequest ID is sent to all requests, even if the destination is not the same host as the Next.js application. Initiating a fetch request to a third-party within Middleware will send the x-middleware-subrequest-id to that third party. This vulnerability is fixed in 12.3.6, 13.5.10, 14.2.26, and 15.2.4.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceNext.js middleware forwards the internal x-middleware-subrequest-id header to third-party external services when making fetch requests, leaking potentially sensitive internal application identifiers to untrusted external destinations. This bypasses the intended scope of the header which was meant only for internal middleware subrequests.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 12.3.5= 13.5.9= 14.2.25= 15.2.3CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- High
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify installed Next.js versionRun `npm list next` or check the `next` version in your package.json fileAffected if version matches 12.3.5, 13.5.9, 14.2.25, or 15.2.3 exactly
-
Locate middleware implementationLook for middleware.ts or middleware.js in your project root or src directoryAffected if middleware file exists in the project
-
Inspect middleware for external fetch callsOpen the middleware file and search for fetch(), fetch(), or fetch() calls that target external URLs (not relative paths or internal hostnames)Affected if middleware contains fetch requests to external third-party domains
-
Verify header leakage in outbound requestsIf possible, capture a network trace of a request originating from middleware to an external service and inspect the request headers for x-middleware-subrequest-idAffected if the x-middleware-subrequest-id header appears in requests to external hosts
You are affected if your installed Next.js version is one of the affected releases AND your middleware makes fetch requests to external third-party URLs, causing the internal x-middleware-subrequest-id header to leak to untrusted destinations.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade Next.js to versions 12.3.6, 13.5.10, 14.2.26, or 15.2.4 which contain the fix preventing the x-middleware-subrequest-id header from being sent to external third-party hosts.
[email protected] (or [email protected] for v14, [email protected] for v13, [email protected] for v12)
- Identify the current Next.js version in use by checking package.json or running npm list nextjs
- Determine which major version branch you are on (12.x, 13.x, 14.x, or 15.x)
- Run npm install next@<fixed-version> where <fixed-version> corresponds to your major: [email protected], [email protected], [email protected], or [email protected]
- Alternatively, run npm install next@latest to get the latest stable version which will include the fix
- Verify the installation by checking the installed version: npm list nextjs
- Test your application's middleware functionality to ensure the upgrade does not break existing behavior
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation2.0 h
- Testing6.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,840.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-30218 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-30218 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data