CVE-2025-30218: Next Next.js May Leak X-middleware-subrequest-id To Vulnerability
LOWCVE-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
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.
npm install next@12.3.6
npm install next@13.5.10
npm install next@14.2.26
npm install next@15.2.4
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
CVE-2025-30218 Affected Next Versions
4 component(s)| 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?
Which Next versions are affected?
What version fixes CVE-2025-30218?
Is next affected?
What CWE is associated with CVE-2025-30218?
How can I check npm dependencies for CVE-2025-30218?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}