{"id":"GHSA-2452-6xj8-jh47","summary":"Opening a malicious website while running a Nuxt dev server could allow read-only access to code","details":"### Summary\nNuxt allows any websites to send any requests to the development server and read the response due to default CORS settings.\n\n### Details\nWhile Vite patched the default CORS settings to fix https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6, nuxt uses its own CORS handler by default (https://github.com/nuxt/nuxt/pull/23995).\n\nhttps://github.com/nuxt/nuxt/blob/7d345c71462d90187fd09c96c7692f306c90def5/packages/vite/src/client.ts#L257-L263\n\nThat CORS handler sets `Access-Control-Allow-Origin: *`.\n\n\u003e [!IMPORTANT]  \n\u003e If on an affected version, it may be possible to opt-out of the default Nuxt CORS handler by configuring `vite.server.cors`.\n\n### PoC\n1. Start a dev server in any nuxt project using Vite by `nuxt dev`.\n2. Send a fetch request to `http://localhost:3000/_nuxt/app.vue` (`fetch('http://localhost:3000/_nuxt/app.vue')`) from a different origin page.\n\n### Impact\nUsers with the default server.cors option using Vite builder may get the source code stolen by malicious websites\n\n### Additional Information\n`/__nuxt_vite_node__/manifest` / `/__nuxt_vite_node__/module` also seems to have `Access-Control-Allow-Origin: *`, so it maybe also possible to exploit that handler.\nhttps://github.com/nuxt/nuxt/blob/7d345c71462d90187fd09c96c7692f306c90def5/packages/vite/src/vite-node.ts#L39\nAlthough I didn't find a valid module id.\nNote that this handler is probably also vulnerable to DNS rebinding attacks as I didn't find any host header checks.","aliases":["CVE-2025-24360"],"modified":"2026-01-30T00:39:15.034104Z","published":"2025-01-27T11:31:14Z","related":["CVE-2025-24360"],"database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2025-01-27T11:31:14Z","nvd_published_at":"2025-01-25T01:15:24Z","cwe_ids":["CWE-200"]},"references":[{"type":"WEB","url":"https://github.com/nuxt/nuxt/security/advisories/GHSA-2452-6xj8-jh47"},{"type":"WEB","url":"https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24360"},{"type":"WEB","url":"https://github.com/nuxt/nuxt/pull/23995"},{"type":"WEB","url":"https://github.com/nuxt/nuxt/commit/7eeb910bf4accb1e0193b9178c746f06ad3dd88f"},{"type":"PACKAGE","url":"https://github.com/nuxt/nuxt"},{"type":"WEB","url":"https://github.com/nuxt/nuxt/blob/7d345c71462d90187fd09c96c7692f306c90def5/packages/vite/src/client.ts#L257-L263"},{"type":"WEB","url":"https://github.com/nuxt/nuxt/blob/7d345c71462d90187fd09c96c7692f306c90def5/packages/vite/src/vite-node.ts#L39"}],"affected":[{"package":{"name":"@nuxt/vite-builder","ecosystem":"npm","purl":"pkg:npm/%40nuxt/vite-builder"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.8.1"},{"fixed":"3.15.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-2452-6xj8-jh47/GHSA-2452-6xj8-jh47.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"}]}