Next.jsApplication · Vercel

CVE-2025-30218

MEDIUM · 5.9 CVSS v3.1 Published 2025-04-02
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

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 · unedited
Next.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 confidence

Next.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.

MitigationUpgrade 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.

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
Next.jsApplication
Affected:= 12.3.5= 13.5.9= 14.2.25= 15.2.3

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Next.js version
    Run `npm list next` or check the `next` version in your package.json file
    Affected if version matches 12.3.5, 13.5.9, 14.2.25, or 15.2.3 exactly
  2. Locate middleware implementation
    Look for middleware.ts or middleware.js in your project root or src directory
    Affected if middleware file exists in the project
  3. Inspect middleware for external fetch calls
    Open 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
  4. Verify header leakage in outbound requests
    If possible, capture a network trace of a request originating from middleware to an external service and inspect the request headers for x-middleware-subrequest-id
    Affected 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade 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.

Recommended fix High confidence

[email protected] (or [email protected] for v14, [email protected] for v13, [email protected] for v12)

  1. Identify the current Next.js version in use by checking package.json or running npm list nextjs
  2. Determine which major version branch you are on (12.x, 13.x, 14.x, or 15.x)
  3. Run npm install next@<fixed-version> where <fixed-version> corresponds to your major: [email protected], [email protected], [email protected], or [email protected]
  4. Alternatively, run npm install next@latest to get the latest stable version which will include the fix
  5. Verify the installation by checking the installed version: npm list nextjs
  6. 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.

Fix this in Next.js Scoped from the published advisory
  • Consultation3.0 h
  • Implementation2.0 h
  • Testing6.0 h
  • Review / QA3.0 h
14.0 hours of engineering $2,400
Get help mitigating

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-30218 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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