{"id":"CVE-2026-45669","aliases":["CVE-2026-45669","GHSA-fx6j-w5w5-h468"],"related":[],"kind":"vulnerability","state":"published","title":"Nuxt: Reflected XSS in `navigateTo()` external redirect","summary":"Nuxt is an open-source web development framework for Vue.js. From versions 3.4.3 to before 3.21.6 and 4.0.0-alpha.1 to before 4.4.6, navigateTo() with external: true generates a server-side HTML redirect body containing a <meta http-equiv=\"refresh\"> tag. The destination URL is only sanitized by replacing \" with %22, leaving <, >, &, and ' unencoded. An attacker who can influence the URL passed to navigateTo(url, { external: true }) can break out of the content=\"…\" attribute and inject arbitrary HTML/JavaScript that executes under the application's origin. This issue has been patched in versions 3.21.6 and 4.4.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Nuxt is an open-source web development framework for Vue.js. From versions 3.4.3 to before 3.21.6 and 4.0.0-alpha.1 to before 4.4.6, navigateTo() with external: true generates a server-side HTML redirect body containing a <meta http-equiv=\"refresh\"> tag. The destination URL is only sanitized by replacing \" with %22, leaving <, >, &, and ' unencoded. An attacker who can influence the URL passed to navigateTo(url, { external: true }) can break out of the content=\"…\" attribute and inject arbitrary HTML/JavaScript that executes under the application's origin. This issue has been patched in versions 3.21.6 and 4.4.6.","source":"cvelist"},{"lang":"en","text":"### Summary\n`navigateTo()` with `external: true` generates a server-side HTML redirect body containing a `<meta http-equiv=\"refresh\">` tag. The destination URL is only sanitized by replacing `\"` with `%22`, leaving `<`, `>`, `&`, and `'` unencoded. An attacker who can influence the URL passed to `navigateTo(url, { external: true })` can break out of the `content=\"…\"` attribute and inject arbitrary HTML/JavaScript that executes under the application's origin.\n\nThis is a different root cause from CVE-2024-34343 (GHSA-vf6r-87q4-2vjf), which addressed `javascript:` protocol bypass. The issue here is triggered by any valid URL containing `>`.\n\n### Impact\nApplications that pass user-controlled input to `navigateTo(url, { external: true })` — typically via a `?next=` / `?redirect=` query parameter used for post-login or \"return to\" flows — are vulnerable to reflected cross-site scripting. The injected script runs in the context of the application's origin during the server-rendered redirect response, before the meta-refresh fires.\n\n### Details\nIn `packages/nuxt/src/app/composables/router.ts`, the SSR redirect path builds an HTML response body with only `\"` percent-encoded in the destination URL:\n\n```ts\nconst encodedLoc = location.replace(/\"/g, '%22')\nnuxtApp.ssrContext!['~renderResponse'] = {\nstatus: sanitizeStatusCode(options?.redirectCode || 302, 302),\nbody: `<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=${encodedLoc}\"></head></html>`,\nheaders: { location: encodeURL(location, isExternalHost) },\n}\n```\n\nThe `Location` header is normalised through `encodeURL()` (which uses the `URL` constructor and correctly percent-encodes attribute-significant characters). The HTML body uses a narrower sanitiser. That mismatch is the root cause.\n\n### Proof of concept\n\nGlobal middleware that forwards a query parameter to `navigateTo`:\n\n```ts\n// middleware/redirect.global.ts\nexport default defineNuxtRouteMiddleware((to) => {\nconst next = to.query.next as string | undefined\nif (next) {\n return navigateTo(next, { external: true })\n}\n})\n```\n\nRequest:\n\n```\nGET /?next=https://evil.example/x><img src=x onerror=alert(document.domain)>\n```\n\nResponse body:\n\n```html\n<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=https://evil.example/x><img src=x onerror=alert(document.domain)>\"></head></html>\n```\n\nThe `>` after `evil.example/x` terminates the `content=\"…\"` attribute, and the `<img onerror>` tag executes JavaScript in the application's origin before any redirect\noccurs.\n\n### Patches\nFixed in `nuxt@4.4.6` and `nuxt@3.21.6` by [#35052](https://github.com/nuxt/nuxt/pull/35052). The fix percent-encodes the full set of HTML-attribute-significant characters (`&`, `\"`, `'`, `<`, `>`) before interpolating the URL into the meta-refresh body\n\n### Workarounds\nIf you can't upgrade immediately, validate user-controlled URLs before passing them to `navigateTo(url, { external: true })`. At minimum, normalise through `new URL(input).toString()` and reject inputs containing `<` or `>` (a normalised URL with these characters is malformed and safe to refuse).","format":"markdown","source":"ghsa"}],"published":"2026-05-19T15:49:25.000Z","modified":"2026-07-08T17:45:14.967Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-83"],"affected":[{"ranges":[{"version":">= 3.4.3, < 3.21.6","status":"affected"},{"version":">= 4.0.0-alpha.1, < 4.4.6","status":"affected"}],"vendor":"nuxt","product":"nuxt","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.4.3","status":"affected","fixed":"3.21.6"}],"ecosystem":"npm","package":"nuxt","purl":"pkg:npm/nuxt","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0-alpha.1","status":"affected","fixed":"4.4.6"}],"ecosystem":"npm","package":"nuxt","purl":"pkg:npm/nuxt","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.4.3","fixed":"3.21.6"},{"status":"affected","introduced":"4.0.0","fixed":"4.4.6"}],"vendor":"nuxt","product":"nuxt","cpe":"cpe:2.3:a:nuxt:nuxt:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nuxt/nuxt/security/advisories/GHSA-fx6j-w5w5-h468","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nuxt/nuxt/pull/35052","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45669","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nuxt/nuxt","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-06-12T14:03:21.230Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45669","url":"https://www.cve.org/CVERecord?id=CVE-2026-45669","licence":"CVE Terms of Use","modified":"2026-06-12T14:07:21.725Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fx6j-w5w5-h468","url":"https://github.com/advisories/GHSA-fx6j-w5w5-h468","licence":"CC-BY-4.0","modified":"2026-07-08T17:45:14.967Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45669","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45669","licence":"Public domain","modified":"2026-06-17T10:52:26.740Z"}],"updatedAt":"2026-11-25T22:59:24.503Z","epss":{"score":0.00177,"percentile":0.0751,"date":"2026-12-01T12:00:22.000Z"}}