Skip to content

GHSA-223j-4rm8-mrmf CVE-2025-30218

Next.js may leak x-middleware-subrequest-id to external hosts

Medium npm
Severity
0.0 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.43%
Chance of exploitation in the next 30 days. Higher than 37.41% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
Fix
12.3.6
Upgrade next to this version or later

Description

Summary

In the process of remediating CVE-2025-29927, 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.

Credit

Thank you to Jinseo Kim kjsman and RyotaK (GMO Flatt Security Inc.) with takumi-san.ai for the responsible disclosure. These researchers were awarded as part of our bug bounty program.

Affected versions

npm

PackageVulnerableFixed in
next
>= 12.3.5, < 12.3.6
12.3.6
next
>= 13.5.9, < 13.5.10
13.5.10
next
>= 14.2.25, < 14.2.26
14.2.26
next
>= 15.2.3, < 15.2.4
15.2.4

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

next npm → 12.3.6

npm
npm install next@12.3.6
yarn
yarn add next@12.3.6
pnpm
pnpm add next@12.3.6

Severity breakdown

CVSS 4.0 0.0

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

Attack vector
Network
Attack complexity
High
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
Low
Integrity (vulnerable system)
None
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None
Exploit maturity
Unreported

CVSS 3.1 5.9

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Weakness

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 to prevent it
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-673q-mjm6-r5xr
Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays
Critical Also affects next
GHSA-2464-fhr4-w9xw
Next.js: Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used
Critical Also affects next
GHSA-p3m5-59mp-jv5r
Next.js: Denial of Service in App Router using Server Actions
High Also affects next
GHSA-3w37-wq28-93x7
Next.js: Pending `use cache` fill can leak Draft Mode content into regular responses and persisted pages
Medium Also affects next
GHSA-4jqv-mc3x-m676
Next.js has cache poisoning of SSG and ISR pages in self-hosted applications
Medium Also affects next
GHSA-39w2-rjm5-chcv
Next.js has information disclosure in development server's Model Context Protocol endpoint
Medium Also affects next
GHSA-f87g-xv8r-7p7x
Next.js has information disclosure in App Router metadata image routes via dynamicParams bypass
Medium Also affects next
GHSA-mcj8-r9mp-w47p
Next.js has cache poisoning in SSG/ISR rendering that leads to cross-user content substitution and persistent denial of service
Medium Also affects next
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor