{"id":"CVE-2024-34344","aliases":["CVE-2024-34344","GHSA-v784-fjjh-f8r4"],"related":[],"kind":"vulnerability","state":"published","title":"Remote code execution via the browser when running the test locally in nuxt","summary":"Nuxt is a free and open-source framework to create full-stack web applications and websites with Vue.js. Due to the insufficient validation of the `path` parameter in the NuxtTestComponentWrapper, an attacker can execute arbitrary JavaScript on the server side, which allows them to execute arbitrary commands. Users who open a malicious web page in the browser while running the test locally are affected by this vulnerability, which results in the remote code execution from the malicious web page. Since web pages can send requests to arbitrary addresses, a malicious web page can repeatedly try to exploit this vulnerability, which then triggers the exploit when the test server starts.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Nuxt is a free and open-source framework to create full-stack web applications and websites with Vue.js. Due to the insufficient validation of the `path` parameter in the NuxtTestComponentWrapper, an attacker can execute arbitrary JavaScript on the server side, which allows them to execute arbitrary commands. Users who open a malicious web page in the browser while running the test locally are affected by this vulnerability, which results in the remote code execution from the malicious web page. Since web pages can send requests to arbitrary addresses, a malicious web page can repeatedly try to exploit this vulnerability, which then triggers the exploit when the test server starts.","source":"cvelist"},{"lang":"en","text":"### Summary\nDue to the insufficient validation of the `path` parameter in the NuxtTestComponentWrapper, an attacker can execute arbitrary JavaScript on the server side, which allows them to execute arbitrary commands.\n\n### Details\nWhile running the test, a special component named `NuxtTestComponentWrapper` is available.\nhttps://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/nuxt-root.vue#L42-L43\n\nThis component loads the specified path as a component and renders it.\n\nhttps://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L9-L27\n\nThere is a validation for the `path` parameter to check whether the path traversal is performed, but this check is not sufficient.\n\nhttps://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L15-L19\n\nSince `import(...)` uses `query.path` instead of the normalized `path`, a non-normalized URL can reach the `import(...)` function.\nFor example, passing something like `./components/test` normalizes `path` to `/root/directory/components/test`, but `import(...)` still receives `./components/test`.\n\nBy using this behavior, it's possible to load arbitrary JavaScript by using the path like the following:\n```\ndata:text/javascript;base64,Y29uc29sZS5sb2coMSk\n```\n\nSince `resolve(...)` resolves the filesystem path, not the URI, the above URI is treated as a relative path, but `import(...)` sees it as an absolute URI, and loads it as a JavaScript.\n\n### PoC\n1. Create a nuxt project and run it in the test mode:\n```\nnpx nuxi@latest init test\ncd test\nTEST=true npm run dev\n```\n2. Open the following URL:\n```\nhttp://localhost:3000/__nuxt_component_test__/?path=data%3Atext%2Fjavascript%3Bbase64%2CKGF3YWl0IGltcG9ydCgnZnMnKSkud3JpdGVGaWxlU3luYygnL3RtcC90ZXN0JywgKGF3YWl0IGltcG9ydCgnY2hpbGRfcHJvY2VzcycpKS5zcGF3blN5bmMoIndob2FtaSIpLnN0ZG91dCwgJ3V0Zi04Jyk\n```\n3. Confirm that the output of `whoami` is written to `/tmp/test`\n\nDemonstration video: https://www.youtube.com/watch?v=FI6mN8WbcE4\n\n### Impact\nUsers who open a malicious web page in the browser while running the test locally are affected by this vulnerability, which results in the remote code execution from the malicious web page.\nSince web pages can send requests to arbitrary addresses, a malicious web page can repeatedly try to exploit this vulnerability, which then triggers the exploit when the test server starts.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Nuxt es un framework gratuito y de código abierto para crear sitios web y aplicaciones web completos con Vue.js. Debido a la validación insuficiente del parámetro `path` en NuxtTestComponentWrapper, un atacante puede ejecutar JavaScript arbitrario en el lado del servidor, lo que le permite ejecutar comandos arbitrarios. Los usuarios que abren una página web maliciosa en el navegador mientras ejecutan la prueba localmente se ven afectados por esta vulnerabilidad, que resulta en la ejecución remota de código desde la página web maliciosa. Dado que las páginas web pueden enviar solicitudes a direcciones arbitrarias, una página web maliciosa puede intentar explotar esta vulnerabilidad repetidamente, lo que luego activa la vulnerabilidad cuando se inicia el servidor de prueba.","source":"nvd"}],"published":"2024-08-05T19:49:45.000Z","modified":"2026-06-17T07:33:13.003Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-94","CWE-706"],"affected":[{"ranges":[{"version":">= 3.4.0 < 3.12.4","status":"affected"}],"vendor":"nuxt","product":"nuxt","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"3.4.0","fixed":"3.12.4","status":"affected"}],"vendor":"nuxt","product":"nuxt","cpe":"cpe:2.3:a:nuxt:nuxt:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.4.0","status":"affected","fixed":"3.12.4"}],"ecosystem":"npm","package":"nuxt","purl":"pkg:npm/nuxt","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.4.0","fixed":"3.12.4"}],"vendor":"nuxt","product":"nuxt","cpe":"cpe:2.3:a:nuxt:nuxt:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nuxt/nuxt/security/advisories/GHSA-v784-fjjh-f8r4","tags":["third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34344","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nuxt/nuxt","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L15-L19","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L9-L27","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-08-05T20:43:19.664Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-34344","url":"https://www.cve.org/CVERecord?id=CVE-2024-34344","licence":"CVE Terms of Use","modified":"2024-08-12T19:50:45.928Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v784-fjjh-f8r4","url":"https://github.com/advisories/GHSA-v784-fjjh-f8r4","licence":"CC-BY-4.0","modified":"2024-11-18T16:27:00.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-34344","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34344","licence":"Public domain","modified":"2026-06-17T07:33:13.003Z"}],"updatedAt":"2026-11-25T22:58:43.805Z","epss":{"score":0.01644,"percentile":0.76878,"date":"2026-11-30T12:00:22.000Z"}}