CVE-2025-30218: Next Next.js May Leak X-middleware-subrequest-id To Vulnerability

LOW
Advisory Identifier: GHSA-223j-4rm8-mrmf
CWE-200
Published
Advisory Summary

CVE-2025-30218 is a LOW next.js may leak x-middleware-subrequest-id to vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Next libraries in the npm ecosystem. The issue involves next.js may leak x-middleware-subrequest-id to external hosts. Remediation is available by upgrading affected packages to version 12.3.6, 13.5.10, 14.2.26, 15.2.4.

CVE-2025-30218 at a Glance

CVE Identifier CVE-2025-30218
GHSA Identifier GHSA-223j-4rm8-mrmf
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-30218

To remediate this vulnerability, upgrade all affected Next dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

next fixed: 12.3.6
npm install next@12.3.6
next fixed: 13.5.10
npm install next@13.5.10
next fixed: 14.2.26
npm install next@14.2.26
next fixed: 15.2.4
npm install next@15.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls next

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-30218, inspect your project dependencies using npm:

npm ls next

Analyze the terminal output to locate any version of Next in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.3.6), your application is affected.

Note: The npm ls next command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Next, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary In the process of remediating [CVE-2025-29927](https://github.com/advisories/GHSA-f82v-jwr5-mffw), we looked at other possible exploits of Middleware. We independently verified this low severity vulnerability in parallel with two reports from independent researchers. Learn more [here](https://vercel.com/changelog/cve-2025-30218-5DREmEH765PoeAsrNNQj3O). ## Credit Thank you to Jinseo Kim [kjsman](https://hackerone.com/kjsman?type=user) and [RyotaK](https://hackerone.com/ryotak?type=user) (GMO Flatt Security Inc.) with [takumi-san.ai](https://takumi-san.ai) for the responsible disclosure. These researchers were awarded as part of our bug bounty program.

CVE-2025-30218 Affected Next Versions

4 component(s)
Fixed Versions:
12.3.613.5.1014.2.2615.2.4
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 12.3.5
< 12.3.6
All 1 versions
12.3.5
12.3.6
next
npm
≥ 13.5.9
< 13.5.10
All 1 versions
13.5.9
13.5.10
next
npm
≥ 14.2.25
< 14.2.26
All 1 versions
14.2.25
14.2.26
next
npm
≥ 15.2.3
< 15.2.4
All 1 versions
15.2.3
15.2.4

References

Frequently Asked Questions

What is CVE-2025-30218?
CVE-2025-30218 is a security vulnerability in Next involving Next.js may leak x-middleware-subrequest-id to external hosts under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Next versions are affected?
Affected versions include releases prior to 12.3.6, 13.5.10, 14.2.26, 15.2.4 across affected packages: next.
What version fixes CVE-2025-30218?
Upgrading to 12.3.6, 13.5.10, 14.2.26, 15.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 12.3.6, 13.5.10, 14.2.26, 15.2.4. Upgrade your dependency to 12.3.6, 13.5.10, 14.2.26, 15.2.4 or later.
What CWE is associated with CVE-2025-30218?
CVE-2025-30218 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2025-30218?
Run the dependency tree command: 'npm ls next'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-223j-4rm8-mrmf",
  "modified" : "2025-10-13T15:35:50Z",
  "published" : "2025-04-02T22:35:37Z",
  "aliases" : [ "CVE-2025-30218" ],
  "summary" : "Next.js may leak x-middleware-subrequest-id to external hosts",
  "details" : "## Summary\nIn the process of remediating [CVE-2025-29927](https://github.com/advisories/GHSA-f82v-jwr5-mffw), we looked at other possible exploits of Middleware. We independently verified this low severity vulnerability in parallel with two reports from independent researchers.\n\nLearn more [here](https://vercel.com/changelog/cve-2025-30218-5DREmEH765PoeAsrNNQj3O).\n\n## Credit\n\nThank you to Jinseo Kim [kjsman](https://hackerone.com/kjsman?type=user) and [RyotaK](https://hackerone.com/ryotak?type=user) (GMO Flatt Security Inc.) with [takumi-san.ai](https://takumi-san.ai) for the responsible disclosure. These researchers were awarded as part of our bug bounty program.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.3.5"
      }, {
        "fixed" : "12.3.6"
      } ]
    } ],
    "versions" : [ "12.3.5" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.5.9"
      }, {
        "fixed" : "13.5.10"
      } ]
    } ],
    "versions" : [ "13.5.9" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "14.2.25"
      }, {
        "fixed" : "14.2.26"
      } ]
    } ],
    "versions" : [ "14.2.25" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "15.2.3"
      }, {
        "fixed" : "15.2.4"
      } ]
    } ],
    "versions" : [ "15.2.3" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-223j-4rm8-mrmf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-30218"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://vercel.com/changelog/cve-2025-30218-5DREmEH765PoeAsrNNQj3O"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-02T22:35:37Z",
    "nvd_published_at" : "2025-04-02T22:15:19Z"
  }
}